On 1/25/10 4:49 PM, Robert Clair said:
>The garbage collection docs section on the interior pointer issue shows
>this example:
>
>NSData *myData = [someObject getMyData];
>[myData retain];
>const uint8_t *bytes = [myData bytes];
>NSUInteger offset = 0, length = [myData length];
>
>while (offset < length) {
> // bytes remains valid until next message sent to myData
>}
>[myData release];
My favourite solution is this one:
<http://lists.apple.com/archives/Objc-language/2009/Mar/msg00060.html>
It's been working well for me.
--
____________________________________________________________
Sean McBride, B. Eng [email protected]
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]