ios - Copying of NSMutableArray from one viewcontroller to another viewcontroller? -


i have 1 nsmutablearray in firstviewcontroller declared firstarray. want copy secondarray firstarray.

in secondviewcontroller,

self.firstviewcontroller.firstarray = self.secondarray; 

when attempt nslog firstarray.count firstviewcontroller, display 0. should have 2 objects in array

anyone can advise on this?

you can choose 1 of solutions:

  1. singleton
  2. passing data between viewcontrollers
  3. delegation

you can find info need right here: https://stackoverflow.com/a/9736559/1578927

singleton example:

static mysingleton *sharedsingleton;      + (void)initialize     {         static bool initialized = no;         if(!initialized)         {             initialized = yes;             sharedsingleton = [[mysingleton alloc] init];         }     } 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -