NSDecimalNumber leaks memory if not used with AutoRelease pool?

Posted by bioffe on Stack Overflow See other posts from Stack Overflow or by bioffe
Published on 2010-06-13T20:11:39Z Indexed on 2010/06/13 20:22 UTC
Read the original article Hit count: 151

Filed under:
|
NSString* str = [[NSString alloc] initWithString:@"0.05"];
NSDecimalNumber* num = [[NSDecimalNumber alloc] initWithString:str];
NSLog(@" %@", num);
[str release];
[num release];

leaks memory

*** __NSAutoreleaseNoPool(): Object 0x707990 of class NSCFString autoreleased with no pool in place - just leaking

Can someone suggest a workaround ?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c