Hardy
Hardy

Reputation: 639

How can i pass as object as function parameter in objective-c?

I having Two class(ClassA,ClassB).From ClassB i have to call a method of ClassA while calling that method i have to pass my ClassB object and i need to receive it in ClassA.Method in ClassA is a static method.How can i pass an Object in a method? if any one knows please help me..

Upvotes: 0

Views: 852

Answers (1)

Ilanchezhian
Ilanchezhian

Reputation: 17478

You pass the reference of the ClassB by sending self as parameter to a method in ClassA.

[ClassA methodName:self];

In ClassA,

+(void)methodName:(ClassB*)param;

Upvotes: 1

Related Questions