ios - Delegation in Xcode -


When a user clicks an 'add' button, a model view pops up to enter information. I have the 'Cancel' button at the top left of a navigation bar and I want to dismiss it when I press the current view controller. How do I set an object as a class representative? I understand how to make protocols and implement its methods, but I do not have to set up a representative. When running 'debugger' is always my [self representative] in the 'edited' view controller, then zero .

Do you increase the model view controller through the set in your storyboard? If so, then set FORSegue: Method

  - (minus) prepareForSegue: (UIStoryboardSegue *) segue this: (ID) This {if ([identifier isEqualToString: @ "userGuideSegue_home"]) {UserGuideViewController * VC = segue.destinationViewController; [[Destination Destination Viewer] Set Deliaget: Self]; }}   

On the other hand, if you model ViewController through fully address, you are setting set representative then it will become an example of model ViewController. <> East - (minus) showModelView: (NSString *) VIEWNAME {// code project so ripped out some specific if ([VIEWNAME isEqualToString: @ "userGuide_name"]) {modalViewController = (UserGuideViewController * ) [[UIStoryboard storyboardWith name: @ "Mainstoreboard_Ifone" bundle: NULL] Instant viewer: PowerPower: @ "Usgguide"]; } ModalViewController.delegate = self; ModalViewController.modalPresentationStyle = UIModalPresentationFormSheet; ModalViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; ModalViewController.view.frame = [[UIScreen main screen] applicationframe] ;; [Self presentViewController: animated modalViewController: yes complete: ^ {// kept your code here}]; }

Of course this code understands all that you have a <> delegate is used to define the property on your model ViewController.

Comments