Write it as:
int* privateObjMemory = [myObject privateMethod];
;)
The reason you want to avoid this is that it's ambiguous to ARC. performSelector:
returns an object -- should that int*
be retained? hmmm... no.
Update
Based on comments, and removing previous writing:
But that's not a very good solution. If you are calling a specific private API, then you must know its signature (e.g. parameter and return types). If it is your private API, then figure out a way to make that private interface visible selectively.
If it is somebody else's private API, then declare a category on the type which has the correct parameters and return type.
Then the selector is declared properly, and the compiler will be able to setup the call correctly by messaging the object directly -- without the need for using performSelector:
.