Re: Newbie: applescript "call method" to obj-c method (booleans & image data)
Re: Newbie: applescript "call method" to obj-c method (booleans & image data)
- Subject: Re: Newbie: applescript "call method" to obj-c method (booleans & image data)
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sat, 14 Jun 2008 18:59:54 +0200
Le 14 juin 08 à 18:40, Loren Ryter a écrit :
On 06/14/08 12:17 PM, "Graham Cox" <email@hidden> 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 (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