ios - How to pass NSMutableArray from one class to another -
this question has answer here:
- passing data between view controllers 35 answers
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
Post a Comment