Basic NSImage drawing help please!

Apprentice
Posts: 5
Joined: 2009.01
Post: #1
Hi, I am trying to figure out how to to draw an image to a view.
On Apple's doucmentation I found "drawAtPoint:fromRect:operation:fraction:", and and it says this is declared in NSImage.h. I added "AppKit.framework" to my project classes, but whenever I

Code:
#import <AppKit.NSImage.h>

in Game1.m, I get a build error: "file not found :/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE" and beneath that: "Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ggc-4.0 failed with exit code 1"

What am I doing wrong?
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #2
Your first period needs to be a slash. <AppKit/NSImage.h>
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.01
Post: #3
Doh. Thanks, I'll try that!
Quote this message in a reply
Apprentice
Posts: 5
Joined: 2009.01
Post: #4
I added AppKit.framework to my Classes folder and stilll got that error. I tried draggind NSImage.h out of the AppKit.framework/Headers sub-folder and into my Classes folder, then used "#import "NSImage.h" and still get the error. Any ideas? Thanks
Quote this message in a reply
Member
Posts: 35
Joined: 2009.01
Post: #5
As far as I know, NSImage is automatically included with Cocoa.h (forcefully imported at the top of all Cocoa source files) and need not be imported. I suppose you have already tried omitting the include, though.
Quote this message in a reply
Sage
Posts: 1,199
Joined: 2004.10
Post: #6
You should get a book on Cocoa programming; it looks like you're missing out on some fundamentals here...

Aaron Hillegass' book is excellent.

http://www.amazon.com/s/ref=nb_ss_gw_1_9...=aaron+hil
Quote this message in a reply
Moderator
Posts: 623
Joined: 2007.09
Post: #7
+1 for Aaron Hillegass' book.

- Lincoln Green
http://www.binkworks.com/
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  NSImage and PNG's bmantzey 3 5,067 Nov 29, 2008 07:01 PM
Last Post: arekkusu
  NSImage PDF -&gt; JPG unknown 3 3,918 Oct 23, 2005 08:36 PM
Last Post: PowerMacX
  How to get resolution of an NSImage or NSBitmapImageRep? aegidian 4 5,685 Oct 18, 2005 02:39 AM
Last Post: aegidian
  Help with NSImage and NSString... Joseph Duchesne 2 4,863 Sep 30, 2005 02:21 PM
Last Post: unknown
  NSImage -&gt; Jigsaw peices unknown 5 3,703 Sep 29, 2005 07:00 AM
Last Post: unknown