• 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: Core Data debugging
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data debugging


  • Subject: Re: Core Data debugging
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 16 Jul 2009 19:17:30 -0700

On Jul 16, 2009, at 18:33, Timothy Wood wrote:

and if there's something to do that doesn't return a NSError:

	if (![... do something ...]) {
		OBError (nil, ...);
		return NO;
	}

Um, no. This doesn't fill *outError if you pass nil. Either way, you'd end up having to tweak code more as it got moved about.


Well, I admit I wasn't thinking straight when I wrote that, but I'm gonna stand by it (except it should be NULL not nil). If I was doing something like this, I'd have the macro *assume* the method's output parameter is called 'outError', and make the first macro parameter be the thing to encapsulate instead. That covers some useful ground: First, it allows cases where you need to use an auxiliary NSError:

	NSError* error;
	if (![... error: &error] && error.code != something) {
		OBError (&error, ...)
		return NO;
	}

and, second, it produces a compile error if the enclosing method *doesn't* have an outError parameter, which addresses the concern in your other post. I don't know about you, but *all* my outErrors *are* called "outError" anyway, because it cheaply documents the error handling "protocol" in effect.

Anyway, perhaps we've done this to death. I understand your point of view now. (But by all means have the last word if you wish.)

Heh. I worked with Wil long enough that I can't be sure whether he started that approach at Omni, or Ken or me.

Ah, apologies for not apportioning the credit fairly ... and thanks for foisting this on the world. :)



_______________________________________________

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: 
 >Re: Core Data debugging (From: email@hidden)
 >Re: Core Data debugging (From: Fritz Anderson <email@hidden>)
 >Re: Core Data debugging (From: BJ Homer <email@hidden>)
 >Re: Core Data debugging (From: Bill Bumgarner <email@hidden>)
 >Re: Core Data debugging (From: Kyle Sluder <email@hidden>)
 >Re: Core Data debugging (From: Bill Bumgarner <email@hidden>)
 >Re: Core Data debugging (From: Timothy Wood <email@hidden>)
 >Re: Core Data debugging (From: Quincey Morris <email@hidden>)
 >Re: Core Data debugging (From: Quincey Morris <email@hidden>)
 >Re: Core Data debugging (From: Timothy Wood <email@hidden>)
 >Re: Core Data debugging (From: Quincey Morris <email@hidden>)
 >Re: Core Data debugging (From: Timothy Wood <email@hidden>)

  • Prev by Date: Re: UITextView Doesn't seem to function
  • Next by Date: Re: Core Data debugging
  • Previous by thread: Re: Core Data debugging
  • Next by thread: Re: Core Data debugging
  • Index(es):
    • Date
    • Thread