• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Newbie: applescript "call method" to obj-c method (booleans & image data)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Newbie: applescript "call method" to obj-c method (booleans & image data) (From: Loren Ryter <email@hidden>)

  • Prev by Date: Re: looking for a crc code
  • Next by Date: Saving Bindings and Editing Font
  • Previous by thread: Re: Newbie: applescript "call method" to obj-c method (booleans & image data)
  • Next by thread: Saving Bindings and Editing Font
  • Index(es):
    • Date
    • Thread