I have two classes, both inherited from NSObject
. One is called class1
, the other is called class2
. They both each have one instance, class1
->obj1
, and class2
->obj2
.
In class1
's init
method, I make the instance of开发者_如何学Go class2
. From obj2
's init
method I want to call the instance method -(void)methode
from obj1
How do I do this (what are delegates, could I use one)?
- initWithThingy:(Class1 *)anObj
{
self = [super init];
if (self) {
obj1 = [anObj retain]; // or use your set method/property, if you have one
[obj1 methode];
}
return self;
}
精彩评论