• 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: NSData question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSData question


  • Subject: Re: NSData question
  • From: Chris Kane <email@hidden>
  • Date: Tue, 16 Apr 2002 11:43:57 -0700

On Monday, April 15, 2002, at 11:45 PM, Ondra Cada wrote:

On Tuesday, April 16, 2002, at 04:30 , Jonathan Wight wrote:

Anyone know if an NSData object created with:

+ (id)dataWithBytesNoCopy:(void *)bytes length:(unsigned)length;

will try to free 'bytes' when it gets dealloc-ed?

Yup, it will (as documented).

Alas there is no way to prevent that (as there is with the similar method of NSString). Perhaps we should fill a feature request to extend the API somewhat?

Already added in the OS release following the 10.1.x series, whatever that will be called:

+ (id)dataWithBytesNoCopy:(void *)bytes length:(unsigned)length freeWhenDone:(BOOL)b;
- (id)initWithBytesNoCopy:(void *)bytes length:(unsigned)length freeWhenDone:(BOOL)b;


Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: NSData question (From: Ondra Cada <email@hidden>)

  • Prev by Date: Re: [me needsHelpWith:prefPanes];
  • Next by Date: Re: NSHost cache; NSAutoreleasePool and rss
  • Previous by thread: Re: NSData question
  • Next by thread: Statically linking a lib ...
  • Index(es):
    • Date
    • Thread