• 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: How to debug a corrupted stack
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: How to debug a corrupted stack
      • From: "Gerriet M. Denkmann" <email@hidden>
References: 
 >Re: How to debug a corrupted stack (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: How to debug a corrupted stack
  • Next by Date: Re: autorelease CGImageRef?
  • Previous by thread: Re: How to debug a corrupted stack
  • Next by thread: Re: How to debug a corrupted stack
  • Index(es):
    • Date
    • Thread