[OT] Re: background image in cocoa view AU
[OT] Re: background image in cocoa view AU
- Subject: [OT] Re: background image in cocoa view AU
- From: daniel <email@hidden>
- Date: Wed, 19 Jan 2005 09:42:29 -0800
You're leaking the NSImage in this example. You probably want to add "[background release]" to the end of that method.
*Always* release anything you alloc, copy, or retain. You should be releasing the "mBackgroundColor" object in your class's dealloc method, as well.
Daniel
On Jan 19, 2005, at 3:37 AM, Nicolas Dangy-Caye wrote:
I've modified the code inside awakeFromNib into :
- (void)awakeFromNib {
NSBundle *resource = [NSBundle bundleForClass:[self class]];
NSString *backgroundPath = [resource pathForResource: @"background" ofType: @"png"];
NSImage *background = [[NSImage alloc] initWithContentsOfFile:backgroundPath];
mBackgroundColor = [NSColor colorWithPatternImage:background];
[mBackgroundColor retain];
}
It now works fine.
Thank you Mark for your time.
Nicolas.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden