Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I use data dictionary in passing data to a new viewController and uncomment the codes in the .m:</p> <pre><code> /* // The designated initializer. Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad. - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { // Custom initialization } return self; } */ </code></pre> <p>and add the new parameter in my case a dictionary:</p> <p>Supposed the name is passDataHereController and selectedNews was declared as NSDictionary in the .h</p> <pre><code>// Note that I added the withDataDictionary:(NSDictionary*)passedDataDictionary - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil withDataDictionary:(NSDictionary*)passedDataDictionary{ if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) { // Custom initialization self.selectedNews = passedDataDictionary; } return self; } </code></pre> <p>Then in the controller where you are going to pass the data</p> <pre><code>//supposed dataTobePassed is already populated passDataHereController *newView = [[passDataHereController alloc] initWithNibName:@"passDataHereController" bundle:nil withDataDictionary:dataTobePassed]; [self.navigationController pushViewController:newView animated:YES]; [newView release]; </code></pre> <p>That's one way in passing data to another view, others may have simpler solutions. Hope it helps.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload