Push and Pop behaviour is strange, why?

后端 未结 1 879
走了就别回头了
走了就别回头了 2021-01-26 11:25

I have two classes, the one is addAlarm and second is Name,,,

for now I am in addAlarm (addAlarm is subclass of UITableViewController), as it selects the row, then it go

相关标签:
1条回答
  • 2021-01-26 12:14

    Instead of passing data in dealloc method You can Pass data in below method.

    -(void)viewWillDisappear:(BOOL)animated{
    
    }
    

    Another Method is to store it in appDelegate file like below.

    In appDelegate.h file

    NSString *strName;
    

    @property (nonatomic, retain) NSString *strName;

    In appDelegate.m file

    @synthesize strName;
    

    Now, you can create object of Application in your NameController like below

    AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; 
    

    And store value like this

    appDelegate.strName = @"Value to be passed to addAlarm View"
    

    Hope this help.

    0 讨论(0)
提交回复
热议问题