I have run across some code and I don't think it is a correct approach, but I thought I would ask and see what other thinks.
Essentially, you have a class (MyClass) and a protocol (<MyClassDelegate>) and a protocol selector
...
It seems to me that dealloc should be called on my instance of MyClass as soon as it is released in the protocol method.
If there are any other calls after calling the protocol method within MyClass, then the app should crash I would think.
Essentially, you have a class (MyClass) and a protocol (<MyClassDelegate>) and a protocol selector
Code:
MyClass *myClass = [[MyClass alloc] init];
[myClass setDelegate:self];
...
Code:
- (void) myClass:(MyClass*)thisMyClass myObject:(id)someObj
{
...
...
[thisMyClass release];
}
It seems to me that dealloc should be called on my instance of MyClass as soon as it is released in the protocol method.
If there are any other calls after calling the protocol method within MyClass, then the app should crash I would think.