• 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: Bill Bumgarner <email@hidden>
  • Date: Thu, 16 Jul 2009 13:58:35 -0700

On Jul 16, 2009, at 1:37 PM, Kyle Sluder wrote:

This makes many people's lives difficult.  It's kinda bogus that if I
pass in the address of a pointer-to-NULL and receive back a YES that I
have to turn around and re-NULL that pointer before reusing it.  Many
AppKit methods have a tendency to set the *error argument to 0x8 when
they return YES, causing havoc with our error-wrapping macros.

Then your macros are buggy.

Given:

NSError *foo;
result = [moc save: &foo];

(1) if the result is NO, the value of foo is undefined.

(2) If result is YES, foo *must* be set to a valid NSError

(3) -save: *must not* assume anything about foo; must not treat it is a valid pointer to anything.

Setting foo to NULL before the call is a wasted instruction. Checking foo for NULL after the call doesn't make sense since you have to test result to know if foo was set.

For completeness, the above is distinct from [moc save: NULL]; -save: does check for a NULL and the common optimization is to not create an NSError at all.

b.bum





_______________________________________________

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


  • Follow-Ups:
    • Re: Core Data debugging
      • From: Timothy Wood <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>)

  • Prev by Date: Re: Crash in ATIRadeonX2000GLDriver/IKImageFlowView - any workaround?
  • Next by Date: movieFileTypes, imageFileTypes and Info.plist's
  • Previous by thread: Re: Core Data debugging
  • Next by thread: Re: Core Data debugging
  • Index(es):
    • Date
    • Thread