• 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: How to notify of an error...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to notify of an error...


  • Subject: Re: How to notify of an error...
  • From: "I. Savant" <email@hidden>
  • Date: Tue, 6 Nov 2007 10:43:41 -0500

> I thought about just passing the window controller to the initWith
> section but to me that just seems like a waste of memory...

  Premature optimization. A single pointer to an interesting object on
a desktop computer really is nothing at all to worry about
memory-wise. After all, you're not making a copy of your window
controller, just referencing it ...

> In .NET I would use events, but I am not sure in Cocoa?

  In Cocoa you could use NSNotification ... however depending on your
requirements it might be simpler for the controller to call the
object's "open and parse the file" method, which would pass back the
overall status of the command, displaying an error if the status isn't
"a-okay".

  Many mechanisms within Cocoa itself already use this pattern
(they're handed an NSError** which is specified if there's a problem,
then the caller checks this error and displays it to the user if it's
set).

--
I.S.
_______________________________________________

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

References: 
 >How to notify of an error... (From: Tim Davis <email@hidden>)

  • Prev by Date: Seeking clarification on NSManagedObjectID
  • Next by Date: Re: Seeking clarification on NSManagedObjectID
  • Previous by thread: Re: How to notify of an error...
  • Next by thread: Seeking clarification on NSManagedObjectID
  • Index(es):
    • Date
    • Thread