开发者

Select an array from an array of arrays to display in uitableview (iphone)

开发者 https://www.devze.com 2023-03-05 14:58 出处:网络
I have an array called addArray which I am adding array objects to: NSMutableArray *addArray = [NSMutableArray array];

I have an array called addArray which I am adding array objects to:

NSMutableArray *addArray = [NSMutableArray array];
[addArray addObjectsFromArray: delegate.arrayobjectOne];
[addArray addObjectsFromArray: delega开发者_JAVA百科te.arrayobjectTwo];
// etc...

Now, if I only want to init one of these arrays to display in my table (preferably from another view controller but that's another question), how would I do this? And how would I access a specific property of each array object, e.g. arrayobjectOne.info?

Thanks for your time.


you can say

someObject = [addArray objectAtIndex: someIndex];


use this Example

NSMutableArray *objectsToAdd= [[NSMutableArray alloc] initWithObjects:@"one",@"two", nil];

NSMutableArray *myArray = [[NSMutableArray alloc] initWithObjects:objectsToAdd,nil];

self.list = [[NSMutableArray alloc] init];

[self.list addObjectsFromArray:myArray];
0

精彩评论

暂无评论...
验证码 换一张
取 消