Yes you are right, we work with limited memory and I should be release
minded and watch my variables. But didn't I read somewhere an advice against
oneliners to skip the releases?
Pierre

2009/5/26 Ken Thomases <k...@codeweavers.com>

> On May 26, 2009, at 11:13 AM, Pierre Berloquin wrote:
>
>  Finally, thanks to Alexander, my pure Objective C solution is
>> NSString *S = [[NSString alloc] initWithFormat:@"%i", i];
>> const char *text = [S UTF8String];
>>
>
> Don't forget, after you're through with S:
>
>         [S release];
>
> Or, you could use [NSString stringWithFormat:@"%i", i] to create the
> string without taking on the responsibility for later releasing it.
>
> (Also, 'S' as the name for a local variable doesn't follow typical Cocoa
> naming conventions.)
>
> Cheers,
> Ken
>
>


-- 
Blogs : http://bibliobs.nouvelobs.com/blog/jeux-litteraires
           http://pierre-berloquin.blogspot.com/

Développement durable des neurones par le jeu de réflexion
www.crealude.net

Sustainable development of neurones through mind games
www.crealude.net/us

Que fait-on pour les mal-codants ?
_______________________________________________

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

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

Reply via email to