I want to write something like this:
@interface Foo{
__strong id idArray[];
}
@end
But the compiler complains about it:
Field has incomplete type '__strong id []'.
How can I create an id array member instance under ARC? And how do I init that array?
Using malloc? new[]?
I don’t want to use NSArray because I’m converting a large library to ARC and that will cause a lot of work.
If you want to allocate dynamically the array, use pointer type of id __strong.
Allocate the array using calloc. id __strong must be intialized with zero.
When you are done, you must set nil to the entries of the array, and free.