Interface Builder Plugin Question. Loading an image named from an IBPlugin when in Cocoa Simulator.
Interface Builder Plugin Question. Loading an image named from an IBPlugin when in Cocoa Simulator.
- Subject: Interface Builder Plugin Question. Loading an image named from an IBPlugin when in Cocoa Simulator.
- From: aaron smith <email@hidden>
- Date: Sat, 8 May 2010 17:15:57 -0700
Hello, I've got an interesting question regarding IB plugins. But
first, I don't see a specific interface builder mailing list. Is there
one?
I've written a plugin for scale nine views to use NSDrawNinePartImage.
I've got everything pretty much working. My question is regarding how
to correctly load an NSImage when running in Cocoa Simulator.
Take a look at a couple things:
http://i.imgur.com/WGgY0.png - screenshot of the inspector when a
scale nine view is selected.
http://i.imgur.com/hRZTA.png - screenshot of the library items and it
running in a window.
http://pastebin.com/yfFzMccs - source code for the scale 9 view.
(mostly interested in the drawRect: method.)
A couple things worth mentioning:
-When the plugin is running in interface builder, everything works as
expected. The code that executes in the drawRect: method while in IB
starts at line 67.
-When I build and run a normal mac application using one of these
scale 9 views, everything is archived, unarchived, and drawn fine.
-The code that executes while in a normal application, or Cocoa
Simulator starts at line 93.
Now the question:
-When I run the Cocoa Simulator for a xib/nib that contains one of my
scale 9 views. Images aren't loaded. This is because calling [NSImage
imageNamed:] can't find the image by it's name that was archived. How
do people normally handle this?
There's gotta be some simple solution, or something I overlooked.
Thanks!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden