How to call and declare object for a method call in iOS
Say have "normal" class开发者_如何学运维 in iOS, called A. I'd like to pass this as a parameter to class B, method "myMethod".
"A" is declared as a pointer:
A *myA;
I'm unclear as to the syntax of call. Here's the method (I think this is probably correct:
- (void *) myMethod:(A *) myA
Should the call be
[b myMethod:myA]
or
[b myMethod:&myA]
Since myA is a pointer, it's seems it should be the second one, but somehow I'm thinking it's the first.
It's the first:
[b myMethod:myA]
I rarely dereference pointers in Objective-C as I used to do in C/C++.
精彩评论