On Aug 21, 2010, at 2:26 AM, Jaime Magiera wrote:

> I've got a OSX command line tool that I wish to run in a shell and via a 
> WebObjects application. The binary tool is linked to a framework I wrote 
> which contains NSImage manipulations. It seems the [NSApplication 
> sharedApplication] trick isn't working. I'm still getting... 
> 
> Aug 21 02:56:45 node2 MyApp[28773]: An uncaught exception was raised
> Aug 21 02:56:45 node2 MyApp[28773]: Error (1002) creating CGSWindow
> Aug 21 02:56:45 node2 MyApp[28773]: *** Terminating app due to uncaught 
> exception 'NSInternalInconsistencyException', reason: 'Error (1002) creating 
> CGSWindow'
> 
> The binary is running on Leopard. Are there any ways to run NSImage methods 
> in a command line app run remotely? Did I perhaps miss a step?

A web server is a form of daemon.  A remote shell has some of the same 
restrictions as a daemon or agent.  In either case, the Execution Contexts 
section of TN2083 will probably be helpful:

http://developer.apple.com/mac/library/technotes/tn2005/tn2083.html#SECEXECUTIONCONTEXTS

In short, you can't reliably use AppKit (including NSImage) from a daemon or 
remote shell.

Regards,
Ken

_______________________________________________

Cocoa-dev mailing list ([email protected])

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