How can I create NSMutableArray of Structures?
I can create an array of Structures in standard-c but am running into problems in objective-c.
standard-c:
struct person people[10];
thanks
You need to copy each struct into an NSData or NSValue object in order to place it in an NSArray.
// in
struct person someGuy = ...;
NSData *personData = [NSData dataWithBytes:&someGuy length:sizeof(struct person)];
[personArray addObject:personData];
// out
NSData *personData = [personArray objectAtIndex:whatever];
struct person someGuy;
[personData getBytes:&someGuy];
You should understand the difference between stack and heap and how to work with pointers (or be ready to learn), otherwise you will see a lot of EXC_BAD_ACCESS (or worse, no exceptions, just mysterious garbage data).
Peopleand it should be added to anNSArrayorNSMutableArray. It will be so much easier to get memory management right.personcan't be a classPerson(at least no reason as indicated by your questions so far). You are going down a path that is a complete waste of time, it seems.