开发者

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++.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜