I'm writing a program that, in one table view, has the following code:

id receivedName = [theDatabase itemAtIndex:editedRow] ;
editedRowName = [receivedName mutableCopy] ;
[receivedName release];

where "editedRowName" is defined as an NSMutableString.



[theDatabase itemAtIndex:editedRow]

Asks my database to return item "editedRow." The object at that index is an NSString. For this function, the database would return

[theStringHere retain]



My code needs a mutable version of this string, so I make a mutableCopy of it and release the old one, as to prevent a memory leak.



However, when I do a "Run with performance tool: Leaks", it tells me that, ever time this part of the code runs, it leaks a "GeneralBlock-32" with the following information:

Category: CFString (store)
Event Type: Malloc
Responsible Library: Foundation
Responsible Caller: -[NSCFString mutableCopyWithZone:]




Does anybody know where this leak is coming from?



This is an Objective-C/Cocoa based application, compiling for the iPhone Simulator with the i386 architecture. (Before anybody yells at me saying that the iPhone SDK cannot be discussed here, read this: http://developer.apple.com/iphone/program/ )



-Christopher Kemsley
Sent from my Beautiful 17" MacBook Pro

_______________________________________________

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]

Reply via email to