How do I pass variables between view controllers?

前端 未结 6 1408
礼貌的吻别
礼貌的吻别 2020-12-06 20:21

i\'m having a hard time with Xcode; for some reason, it just won\'t let me pass a variable from one view controller class to another. It should work, i was basically just co

6条回答
  •  孤城傲影
    2020-12-06 21:12

    This doesn't exaclty answer your question, but your memory management is a bit wonky. This line:

    [dvc dealloc];
    

    should read like this:

    [dvc release];
    dvc = nil;
    

    In Cocoa, you should never call dealloc directly -- follow the retain/release/autorelease pattern and things will work better and as intended.

提交回复
热议问题