Is it poss开发者_开发技巧ible to pass an array as an argument for a function?
Yes, of course.
C-array:
- (void)myFunction:(int*)array;
...
int bar[12];
[obj myFunction:bar];
NSArray:
- (void)myFunctionWithNSArray:(NSArray*)array;
...
NSArray *array = [[NSArray alloc] initWithObjects...];
[obj myFunctionWithNSArray:array];
精彩评论