Michael A
Michael A

Reputation: 5850

assigning protocol parameter to object member

In my header file i am defining a class member:

id<IAdmobTestSuite>* testSuite;

Later i want to assign this variable using this function:

- (void) setTestSuite:(id<IAdmobTestSuite>)_testSuite {
if(testSuite == nil) {
    testSuite = _testSuite;
  }
}

but here xcode show we this error: "Assigning to 'id IAdmobTestSuite *' from incompatible type 'id IAdmobTestSuite '; take the address with &"

Dont really understand this error, How can i properly assign this member?

Upvotes: -2

Views: 38

Answers (1)

gulyashki
gulyashki

Reputation: 459

id is a pointer, to fix the error you should remove the * in your header

id<IAdmobTestSuite> testSuite;

Upvotes: 0

Related Questions