-(id)init
{
if (self = [super init])
{
self.dmrPlaylists = [[[NSMutableArray alloc] initWithCapacity:0] autorelease];
}
}
-(void)dealloc
{
[self.dmrPlaylists release];
}
-(DMRPlaylist *)getDMRPlaylistByUUID:(NSString *)deviceUUID
{
if (deviceUUID == nil)
return nil;
for(int i = 0; i < self.dmrPlaylists.count; i++)
{
DMRPlaylist * dmrPlaylist = [self.dmrPlaylists objectAtIndex:i];
if([dmrPlaylist.deviceUUID isEqualToString:deviceUUID])
{
return dmrPlaylist;
}
}
return nil;
}
Memory(Core Foundation/Object-C) Incorrect decrement of the reference count of an object that is not owned at this point by the caller.
Thanks in advance.
1) Do not use
self.dmrPlaylistsin yourinitanddeallocmethods. Instead, interact with the underlying variable.2) Call
[super dealloc]Without knowing which line the warning is on, can’t be sure, but these are problems.