Your method does not take an array parameter -- it takes a pointer parameter.
In C, it's not possible to have a parameter of array type. If you write a parameter of type "array of X", it is automatically changed to type "pointer to X".
Objective-C methods are C functions, but the story is a little different. In recent versions of Xcode, it appears that you can have method parameters of array type (although this does not seem to be documented anywhere). But it must be a concrete array type, i.e. with a length hardcoded at compile-time:
- (void)takeIntsAndRecieveIntsAsync:(MyInt *__strong [5]);
When it's an incomplete array type (e.g. MyInt *__strong []
), it is still automatically adjusted to a pointer (e.g. MyInt *__strong *
), the value being a pointer to the first element of the array.
In C (and thus Objective-C), it is not possible to know, given a pointer to the first element of an array, how many elements this "array" has. You must get this information separately somehow (whether it be a separate length parameter, the length and pointer packaged together in some kind of structure, a "sentinel" value in the array, etc.).
It should match the type of the array you're passing the pointer to the first element of. If it's an array of
__strong
, then it needs to be pointer to__strong
, etc. If your operation is asynchronous, then you probably need to copy the array (which requires you to figure out the solution to question 1, how to figure out the length of the array), so that your asynchronous operation will have strong references to thoseMyInt
objects. Thus your copy of the array should contain__strong
pointers.