Trying to implement the following structure from “c” to use NSArray in objective-c:
In standard-c:
struct structDog{
char *name;
int age;
};
struct structLitter{
struct structDog puppy[10];
};
Then I use malloc to allocate space.
But since I am using NSArray.
But in Objective-c I am using NSArray… so ???
NSArray struct structDog *puppy; // <<---this doesn't work
thanks
Assuming that you are trying to do is get your
structinto yourNSArrayyou need to use NSValue. For instance you can do something like: