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: Brad Gibbs <email@hidden>
- Date: Wed, 06 Aug 2008 09:11:03 -0700
Thanks. I was looking at NSImageView (which does have a setImage:
method).
On Aug 6, 2008, at 8:58 AM, Kyle Sluder wrote:
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