assigning protocol parameter to object member

51 views Asked by At

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?

1

There are 1 answers

0
gulyashki On BEST ANSWER

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

id<IAdmobTestSuite> testSuite;