I have a static array of NSString
defined in my implementation file like so:
NSString * const knames[] = { @"", @"", @"", ..., @"" };
and what I'd like to do is get the length dynamically. Since this is a C array, length
and count
are not valid, so I've tried using sizeof
:
int count = (sizeof knames) / (sizeof knames[0]);
However, it results in the error message:
Invalid application of 'sizeof' to an incomplete type 'NSString *const _strong[]'