Re: Unclear on -initWithBytesNoCopy:
Re: Unclear on -initWithBytesNoCopy:
- Subject: Re: Unclear on -initWithBytesNoCopy:
- From: Wade Tregaskis <email@hidden>
- Date: Mon, 05 Mar 2012 16:40:45 -0800
Perhaps the only 'correct' solution to this problem is to fall back to the CFString level, where you can pass a custom CFAllocator to e.g. CFStringCreateWithBytesNoCopy(). That way the lifetime is effectively managed by the CFString, so it should behave correctly in all cases.
'course, the implementation is relatively awkard compared to what *should* be a single method call. Perhaps a variant of initWithBytesNoCopy:, one that takes a block with which to free the bytes, should be created.
_______________________________________________
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