If i have 2 NSMutableArray declared in .h, synthesize in .m files, how can i copy whole contents of array 1 to 2? actually the sam开发者_JAVA技巧e array.
I tried using this code only:
[self.data addObjectsFromArray:self.temparray]
to copy data from temparray to data.
doesn't seems to work.....
Did you initialize your self.data at all? I.e. self.data = [NSMutableArray array];
somewhere.
If you did, please post some code.
- (NSArray *)arrayByAddingObjectsFromArray:(NSArray *)otherArray
is the method your looking for.
精彩评论