Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RossOliver

macrumors regular
Original poster
Nov 6, 2006
157
0
Hey,

What I need is for a class of my own, say MyClass, to be able to send messages to a class that uses it, say MyOtherClass. For instance, if MyClass is running a variable length timer and when the timer expires it needs to notify MyOtherClass to handle it, how would I go about setting up the required relationship?

I'm sure there is an article somewhere on what I need and I would be grateful if someone could point me to one if they know of any, or try and give me a breif explanation of the steps I need to take...

Cheers,

-Ross
 
Hey,

What I need is for a class of my own, say MyClass, to be able to send messages to a class that uses it, say MyOtherClass. For instance, if MyClass is running a variable length timer and when the timer expires it needs to notify MyOtherClass to handle it, how would I go about setting up the required relationship?

I'm sure there is an article somewhere on what I need and I would be grateful if someone could point me to one if they know of any, or try and give me a breif explanation of the steps I need to take...

Cheers,

-Ross

I'm assuming you've got some programming experience based on this question. Languages like Java and C# require you to attach listeners to objects that have events, a form of loose coupling.

This article on Apple's developer site should be pretty useful to you.
 
I'm assuming you've got some programming experience based on this question. Languages like Java and C# require you to attach listeners to objects that have events, a form of loose coupling.

This article on Apple's developer site should be pretty useful to you.

Just what I was after, cheers :)

I have another question which I may as well ask in here instead of starting a new thread...

In my AppDelegate class I open a connection to an sqlite database, with a reference to the database stored as an instance variable (accessible via a get method).

I need to get at this reference in my main view controller. My main view is loaded automatically, though (with [window makeKeyAndVisible] and the nib specified in a plist). How do I go about calling a custom init method in my main view controller which will allow me to pass the database reference in:

initWithDatabase: ( sqlite3 * )database;

Thanks for your time,

-Ross
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.