Re: How to debug a corrupted stack
Re: How to debug a corrupted stack
- Subject: Re: How to debug a corrupted stack
- From: "Sean McBride" <email@hidden>
- Date: Thu, 7 Aug 2008 22:04:57 -0400
Gerriet M. Denkmann (email@hidden) on 2008-8-8 9:49 PM said:
> some_type a;
> NSValue *data = [ NSValue value: &a withObjCType: @encode
>(some_type) ];
>followed by:
> some_type b;
> [ data getValue: &b ];
>is unsafe, dangerous and strictly to be avoided - especially if the
>definiton of "some_type" is buried in some frameworks.
>
>Instead one must use:
> some_type *bPointer = [ data bytes ];
>The only problem: NSValue has no method "bytes".
Note that the docs say that value:withObjCType: and objCType "may be
deprecated in a future release". Also, I suspect objCType would be
problematic in GC apps (see archive discussion of NSData's btyes method).
What is your ultimate goal? Could you use NSData instead of NSValue?
Sean
_______________________________________________
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