Re: Unable to disassemble objc_assign_strongCast
Re: Unable to disassemble objc_assign_strongCast
- Subject: Re: Unable to disassemble objc_assign_strongCast
- From: "Stephen J. Butler" <email@hidden>
- Date: Mon, 2 Nov 2009 23:43:46 -0600
On Mon, Nov 2, 2009 at 9:47 PM, Leonardo Borsten
<email@hidden> wrote:
> NSError **saveError;
> [importContext save:saveError]; // <--- crashes here
Think for a minute about what the parameter is trying to do: return an
object. To do that it needs to assign to a variable the caller
provides. Is that what you're doing? No. You're passing the function a
junk address (whatever happens to be on the stack when space for
saveError is reserved). Here's the normal way to do it:
NSError *saveError;
[importContext save:&saveError];
_______________________________________________
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