Within MyController, I call:

      notifyCenter = [NSNotificationCenter defaultCenter];

      [notifyCenter addObserver:self

                    selector:@selector(mySelector:)

                    name:@"StatusChanged"

                    object:sentNotifyObject];

      // We will be the observer and sentNotifyObject will equal the

// object encapsulated in the NSNotification passed to the selector.

// When this encapsulated [NSNotification object] = nil, the observer

// is notified when *any* encapsulated object is sent to the selector.



and mySelector looks like:

- (void) mySelector:(NSNotification*)sentNotification {

      MyController *theNotifyObject;

      theNotifyObject = [sentNotification object];

      if (theNotifyObject == myOtherController) {

      }

}

=====

Note that the sent notifyObject encapsulated in the NSNotification is a different controller than the observer, myController.

Now, the questions. It appears that everytime I see a need to check the Status, I need to call:

- (void) postCalculationStatusChanged:(id)sentNotifyObject {

[notifyCenter postNotificationName:StatusChanged object:sentNotifyObject];

}

Shouldn't my call to -addObserver automatically monitor "StatusChanged" rather than my having to -postNotificationName??



John Love


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to