trying to figure out a best way of doing things. I'm new to objective c as a language.
I have object class A, and object class B and would like A to call a method on class B and once that method is done to have B call A back tell the result.
What I'm doing now is on class A adding self to NSNotificationCenter. Than having class B post that Notification. It works but it seems like an overkill for this type of simple process.
Is it legal to simply pass pointer of self to class B? something like?
// from class A
- (void)methodInClassA
{
B * b= [[B alloc]init];
[b callMethod:self];
[b release];
b = nil;
}
where class B would be
- (void)callMethod:(A*)sender
{
[sender resultCallbackMethod];
}