ios - How to pass NSMutableArray from one class to another -


this question has answer here:

i know question asked several times before none of solutions don't work in case.

i have 2 classes: in first 1 (class a) data user , contain in property:

@property (nonatomic, retain) nsmutablearray *firstclassarray; 

and synthesize it. @ same time, have class b, property taking place.

@property (strong, nonatomic) nsmutablearray *games; 

i tried in viewdidload:

classa *a = [[classa alloc] initwithnibname:@"classa" bundle:nil]; games = a.firstclassarray; 

and

classa *a = [[classa alloc] init]; a.view; games = a.firstclassarray; 

all in all, need information firstclassarray , store in games array show in tableview. how can it?

what going wrong in code?

thanks!

in instance of class do:

classb *b = [[classa alloc] initwithsomething:something]; b.games = self.firstclassarray; 

or, if classb implemented accordingly, do:

classb *b = [[classa alloc] initwithsomething:something andgames:self.firsclassarray]; 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -