• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Notifications
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Notifications


  • Subject: Re: Notifications
  • From: Chuck Hill <email@hidden>
  • Date: Fri, 29 Aug 2008 14:41:12 -0700


On Aug 29, 2008, at 1:33 PM, Ted Archibald wrote:

I've been racking my brains for a while now and I can't figure out how notifications work.

What I want to do is trigger a method in a session(or application) after an ERXGenericRecord has been updated/inserted.  I'm pretty certain that I want to use notifications to do this, but I am lost when it comes to setting one up with the NotificationCenter.

Any ideas?

See bottom of http://developer.apple.com/documentation/WebObjects/Enterprise_Objects/Introduction/chapter_2_section_6.html


To send a notification:

NSNotificationCenter.defaultCenter().postNotification("MyObjectChangedNotification", eo);

To receive it:

NSSelector method = new NSSelector("handleChangedObject", new NSArray(new Class[] {NSNotification.class});
NSNotificationCenter.defaultCenter().addObserver(this,
method, "MyObjectChangedNotification", null);

public void handleChangedObject(NSNotification notification) {
	EOEnterpriseObject eo = (EOEnterpriseObject) notification.object()
	// whatever you want to do here
}

Chuck

-- 
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.    
http://www.global-village.net/products/practical_webobjects






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Notifications (From: "Ted Archibald" <email@hidden>)

  • Prev by Date: Re: Entity dependence analisys
  • Next by Date: EOGen whoes
  • Previous by thread: Re: Notifications
  • Next by thread: Re: Notifications
  • Index(es):
    • Date
    • Thread