medley
medley

Reputation: 75

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

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

NSMutableArray *addArray = [NSMutableArray array];
[addArray addObjectsFromArray: delegate.arrayobjectOne];
[addArray addObjectsFromArray: delegate.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.

Upvotes: 1

Views: 159

Answers (2)

Deepesh
Deepesh

Reputation: 643

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];

Upvotes: 0

user745098
user745098

Reputation:

you can say

someObject = [addArray objectAtIndex: someIndex];

Upvotes: 1

Related Questions