Skip to main content
GameDev.net gamedev.net
🔒 Locked

memory leak when using NSString isEqualToString

Started by Vorel512 May 3, 2012 at 2:20 PM 0 replies 1.3k views
Original Post
Vorel512
Vorel512
Hello there experts!

So...
I have an array (NSMutableArray) of a class.
In the class I store Name and Address.
When I want to compare the contents to a string, which I've added by code, it eats more and more memory.

if ([[[cManager getAttributeAtIndex:index] getAttribName] isEqualToString:@"adam"])
{
NSLog(@"match!");
}


getAttribName is the name of the person in an NSString object.
When I run Instruments, it tells me, that the program eats more and more memory. If I comment out this if function, the growing stops.
For me it looks like I've allocate a variable and not deallocate it.
I am out of ideas what's gone wrong, so every help is appreciate!!!!!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.