Is it possible 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];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With