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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to