Re: Objective-C parameter mutation
Re: Objective-C parameter mutation
- Subject: Re: Objective-C parameter mutation
- From: Charles Steinman <email@hidden>
- Date: Wed, 15 Oct 2008 17:50:15 -0700 (PDT)
--- On Wed, 10/15/08, James Trankelson <email@hidden> wrote:
> So, I've got the following method:
>
> + (void)done:(MyObj*)dObj structure:(void*)pStruct
>
> ... and when I call it with a "structure"
> parameter, say a malloc'ed
> char* at address 0x171eb070, as soon as I step into this
> method, the
> address is no longer 0x171eb070, but some garbage value
> that causes
> all sorts of trouble. Here's to hoping someone can tell
> me why this
> doesn't work...
Most likely you have a memory-stomping bug somewhere. Can you come up with a minimal case to demonstrate the problem? Your pseudocode is hiding whatever is wrong. Any type that you could use in a function call is a valid Objective-C method parameter.
Cheers,
Chuck
_______________________________________________
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