[NEWB] Filling a rect with an Image
[NEWB] Filling a rect with an Image
- Subject: [NEWB] Filling a rect with an Image
- From: Brad Gibbs <email@hidden>
- Date: Wed, 06 Aug 2008 08:50:12 -0700
I'm trying to create a view with a background image, but getting error
after error...
- (void)drawRect:(NSRect)rect {
NSRect bounds = [self bounds];
NSImage *background = [[NSImage alloc] init];
[background setImage:@"ScrollBackground"];
[[NSColor colorWithPatternImage:background] set];
[NSBezierPath fillRect:bounds];
}
I've added a .png named ScrollBackground to my Resources folder.
The code compiles but I get a warning: "NSImage may not respond to '-
setImage'.
How can I make this right?
Thanks.
Brad
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden