I tried searching for _countf in objective-c, but it does not seem to exist, therefore, assuming the sizeof and typeof operators are working correctly, and you are passing a valid c array, then the following might work.
#define _countof( _obj_ ) ( sizeof(_obj_) / (sizeof( typeof( _obj_[0] ))) ) NSString *s[2]={@"1", @"2"} ; NSInteger iCount = _countof( s ) ;
source share