Event Broadcaster
Event Broadcaster
- Subject: Event Broadcaster
- From: Aaron Wallis <email@hidden>
- Date: Tue, 27 Sep 2005 19:43:43 +1000
Hi there fellow cocoa developers.
I've got a question about events in Cocoa.
I need to build a events broadcaster class to assist in a large
application im currently developing.
Let me define Events Broadcaster.
Basically, I need to construct a class that listens to every active
object and can 'broadcast' events to anything thats listening.
A SUPER example of this is the ASBroadcaster object in ActionScript
[ as in Macromedia Flash ActionScript] which distributes application
wide events to that triggers functions in whoever is listening.
From an events perspective, im looking at 'listening' objects to
call a self selector when the 'broadcaster' distributes an event, say
for example:
[ myBroadcaster broadcastEvent:@"BigEvent" withParams:myArrayOfParams ];
and for the listeners to go
- onEventRecieve:(NSString)eventToCall :(NSArray)eventParams
{
if ( //selector exists )
{
// self call event from string
}
}
I understand that this could be done by passing each object a copy of
a broadcaster object [ and for each sub class/object to get its
parents broadcaster and so on] and just get the broadcaster to cycle
through a dictionary of listening objects calling their selectors if
they exist. but I was wondering if Cocoa had something like this
already!?
Any ideas?
Cheers and thanks in advance !
_/Az.
Send instant messages to your online friends http://au.messenger.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden