• 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: Interface Builder Plugin Dependency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interface Builder Plugin Dependency


  • Subject: Re: Interface Builder Plugin Dependency
  • From: Joey Hagedorn <email@hidden>
  • Date: Thu, 29 Jan 2009 16:25:33 -0800

Bridger,
Because ibtool runs from the command line, it is executed without a connection to the window server so it can be run remotely in non- graphical login sessions. This environment might exist, for example, on a build server with nobody logged in at the console.


You'll need to find another way to crop your image. This post by Ken Ferry might help:
http://www.cocoabuilder.com/archive/message/cocoa/2008/8/5/214909


-Joey


On Jan 29, 2009, at 3:54 PM, Bridger Maxwell wrote:

It turns out the error is completely different from what I thought it was
(isn't it always?). It turns out Xcode was omitting part of the output from
IBTool. When I tried to compile my xib from Terminal, I got this error:


Description: ibtool encountered an error while loading the ibplugin from
/Users/bridger/Development/Mercury/MercuryStation/build/Debug/ SCMercury.framework/Versions/A/Resources/SCThemes.ibplugin.
Error: Error Domain=com.apple.InterfaceBuilder Code=-1 UserInfo=0x6e9e90
"Interface Builder could not load the 'Themes' plug-in because an exception
was raised.


Exception name: NSInternalInconsistencyException
Reason: Error (1002) creating CGSWindow"

I Googled around a bit, and I know it has something to do with drawing. In
fact, I have narrowed it down to these lines of code:


   NSImage * canvas = [[NSImage alloc] initWithSize: canvas_size];

   [canvas lockFocus];

...

   [canvas unlockFocus];


This is a vital part of my plugin though. I use this in an NSImage category
which crops an NSImage. Why does lockFocus cause IB compilation errors, and
can how can I fix it?



Also, here is the NSImage category in its entirety. I actually took it from
someone else on this list a while back.



- (NSImage *) imageFromRect: (NSRect) rect

{

   NSAffineTransform * xform = [NSAffineTransform transform];

    // translate reference frame to map rectangle 'rect' into first
quadrant

   [xform translateXBy: -rect.origin.x

                   yBy: -rect.origin.y];



   NSSize canvas_size = [xform transformSize: rect.size];

    NSImage * canvas = [[NSImage alloc] initWithSize: canvas_size];

   [canvas lockFocus];

    [xform concat];



   // Get NSImageRep of image

   NSImageRep * rep = [self bestRepresentationForDevice: nil];


[rep drawAtPoint: NSZeroPoint];



   [canvas unlockFocus];

   return [canvas autorelease];

return nil;

}


Thank You,

Bridger Maxwell
_______________________________________________

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

_______________________________________________

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: 
 >Interface Builder Plugin Dependency (From: Bridger Maxwell <email@hidden>)
 >Re: Interface Builder Plugin Dependency (From: Bridger Maxwell <email@hidden>)

  • Prev by Date: Re: Interface Builder Plugin Dependency
  • Next by Date: Re: NSTask Leaking...
  • Previous by thread: Re: Interface Builder Plugin Dependency
  • Next by thread: NSTask Leaking...
  • Index(es):
    • Date
    • Thread