Re: [NEWB] Filling a rect with an Image
Re: [NEWB] Filling a rect with an Image
- Subject: Re: [NEWB] Filling a rect with an Image
- From: "Kyle Sluder" <email@hidden>
- Date: Wed, 6 Aug 2008 11:58:20 -0400
On Wed, Aug 6, 2008 at 11:50 AM, Brad Gibbs <email@hidden> wrote:
> 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'.
That would be because, indeed, NSImage does not respond to -setImage.
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSImage_Class/Reference/Reference.html
> How can I make this right?
Use the +[NSImage imageNamed:] convenience constructor. You're best
off doing this once and stuffing it in an ivar; just remember to
retain it.
--Kyle Sluder
_______________________________________________
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