First of all: I already searched on google and SO for solutions - none worked. I've got an application which loads the artwork of the current iTunes track and displays it; this is stored in a NSImage instance, among some other variables, in a class:
@interface infoBundle : NSObject
@property (strong) NSImage *track_artwork;
@property (weak) NSString *track_title;
@property (weak) NSString *track_album;
@property (weak) NSString *track_artist;
@end
Then, an instance of this class is created:
-(infoBundle*)returnInfoBundle {
infoBundle* tmpBundle = [[infoBundle alloc]init];
tmpBundle.track_artwork = [[NSImage alloc]initWithData:[(iTunesArtwork *)[[[iTunes currentTrack] artworks] objectAtIndex:0] rawData]];
[...]
return tmpBundle;
}
And later used:
-(void)iTunesDidChange {
infoBundle* tmpBundle = [self returnInfoBundle];
[...]
[imageView setImage:tmpBundle.track_artwork];
}
That's eating up ~2MB (Cover size, I'd guess) per call of iTunesDidChange.
I already tried:
- [tmpBundle autorelease];
- [tmpBundle release];
- [tmpBundle dealloc];
- tmpBundle = nil;
and, after that didn't help: - Enabling ARC.
=> Why is this eating up memory, although the object (tmpbundle) should get removed? => How may I achieve leak-less NSImage usage?
Thanks for any tips/suggestions/solutions :)