Re: Newbie query re notifications
Re: Newbie query re notifications
- Subject: Re: Newbie query re notifications
- From: Kyle Sluder <email@hidden>
- Date: Fri, 6 Mar 2009 11:59:03 -0500
On Fri, Mar 6, 2009 at 11:18 AM, McLaughlin, Michael P. <email@hidden> wrote:
> Today, I realized that I should have a separate class for some of the data
> processing. This separate class, SatManager, has no GUI elements and does
> not appear in IB in any way. Its implementation includes
Classes whose names end in "Manager" are often signs of bad
architecture. Be careful how you approach this factorization.
> This enqueueing worked fine when getGPS() was a method of appDelegate but
> not now when getGPS() is a method of SatManager. Now, the notification does
> not reach getGPS() even though the SatManager addObserver() call gave no
> errors.
>From your use of parentheses, it looks like you're more familiar with
Java or C# or other such languages. In Objective-C, you can send any
message you want to any object you want. I could send an instance of
your SatManager class a method called -jumpOffABridge if I wanted to.
Are you sure you've defined -[SatManager getGPS]? Check the run
console for messages about unrecognized selectors.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden