On 02/02/2010, at 11:39 PM, Hado Hein wrote: > eturnvalue = [[NSString stringWithFormat:@"%d", rowIndex] > autorelease];
> That works fine. No it doesn't, because: > For convinience I wanted to provide the users with a numbering column in > the front. > The problem is that, at this point of code, I see no way to get the > actual value to release it. > The shown way with autorelease bails at the first attempt to scroll. That's because you've made a silly mistake. [NSString stringWithFormat] returns an already autoreleased object, or one you don't own, at any rate. So you should not autorelease it again. The object will be sent a -release message twice, and on the second one, will fail with EXC_BAD_ACCESS as the object has already been dealloced. --Graham _______________________________________________ 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]
