Le 14 juin 08 à 18:40, Loren Ryter a écrit :




On 06/14/08 12:17 PM, "Graham Cox" <[EMAIL PROTECTED]> wrote:


BOOL* means "pointer to BOOL" not BOOL itself. So you need to remove
the *.

This worked brilliantly thanks a lot! I literally spent 3 hours on that ;-)



iconData:[NSImage initWithContentsOfFile:aPath]

should be iconData:[[[NSImage alloc] initWithContentsOfFile:path]
autorelease]

This did not work so well... Somehow I think iconData needs the NSData of
the NSImage rather than the NSImage?

Here are results:

#1

iconData:[[[NSImage alloc] initWithContentsOfFile:aPath] autorelease]
-->

No system log messages, and Growl notification given without the image icon (just blank where icon should be). Instead, the icon was drawn rotated and
upside down at the bottom left corner of my GUI.  Weird??

#2

iconData:[[[NSImage alloc] imageNamed:anApp] autorelease]
--> System.log:

*** -[NSImage imageNamed:]: unrecognized selector sent to instance 0x60b0390

You should really read some book about OOP and Cocoa. It will really help you to better understand both what you do and the answers of people of this list.

Here the method "imageNamed:" is declare using a '+' sign, that mean it is a class method, not an instance method.

NSImage *image = [NSImage imageNamed:@"aName"];





Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to