• 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
How to use alloc/init... to create an object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to use alloc/init... to create an object


  • Subject: How to use alloc/init... to create an object
  • From: David Hoerl <email@hidden>
  • Date: Thu, 29 Sep 2011 14:00:05 -0400

All the example scripts I've seen use a class method to return some kind of object.

I'm trying to use applescriptobjc in a pure script to create an NSImage object. Conceptually this is what I want to do:

  property NSImage : class "NSImage"

set theImage to NSImage's alloc()
set theImage to theImage's initByReferencingFile_("/tmp/wine.jpg" as POSIX file) )



NSImage offers no factory method to return an image. The above fails on the alloc() line.


How does one do this?

Thanks,

David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Looking for Help on some ASOC code
  • Next by Date: Re: How to use alloc/init... to create an object
  • Previous by thread: Looking for Help on some ASOC code
  • Next by thread: Re: How to use alloc/init... to create an object
  • Index(es):
    • Date
    • Thread