Re: IB Plugin help
Hi Jon, I tried compiling the project you attached but I was still getting Assertion Failures so I built the project from scratch again and it loads into IB without Assertion Failures (I think there is definitely something not setup right in the project you attached!). O.k First off, just to check; you are adding the framework to your live app, i.e... in Groupes Files (in your live app!): Browse to Frameworks and select Other Frameworks. Right click (ctl click) and navigate to Add-Existing Frameworks. In the open panel, browse to and select /Library/ NameOfYourFramework.framework. Click Add. Other Frameworks should now look something like this: Other Frameworks/ NameOfYourFramework.framework AppKit.framework CoreData.framework Foundation.framework It Is important your live app has the framework added to it as your plugin is dependent on it and will crash if it's not there! Sorry if you are already doing this, I thought It's better to make sure as this is quite important! Secondly, I think the reason IB keeps opening the new document window when you try and reopen the .xib is because the encoder is failing to encode the @TextLength property as it is not KVC-Compliant, so the component crashes when you try to save the xib, hence it also crashes when you try to decode/open the doc. I noticed that the component's console was spewing out errors when I tried to save or reopen an .xib the the component in it (in a live app): 009-04-05 12:32:51.436 Interface Builder[26488:10b] An exception was thrown during execution of an NSScriptCommand... 2009-04-05 12:32:51.438 Interface Builder[26488:10b] [JTextLengthFormatterView 0xaa82730 valueForUndefinedKey:]: this class is not key value coding-compliant for the key TextLength. I changed: [[keyPaths objectForKey:IBAttributeKeyPaths] addObjectsFromArray: [NSArray arrayWithObjects:@TextLength, nil]]; to: [[keyPaths objectForKey:IBAttributeKeyPaths] addObjectsFromArray: [NSArray arrayWithObjects:@textLength, nil]]; and this seems to have stopped the crashing when reopening the .xib. I have the project working here and can send you a .zip if you like? Hope this helps. All the best, Josh On 5 Apr 2009, at 01:10, jmun...@his.com wrote: Sorry for going quiet like that! I got distracted! No problem! :) I think that the fact IB is asking you to create a new document is a good thing! Actually, not in this case. The plugin seems to work fine within its project, so I decided to try and install it so I could use it in my other (live) project. I created a new window xib (imaginatively called test), put a textfield on it and saved it. Then, I added the formatter to the textfield, gave it a value of 5 and saved that. On re-open, IB then asked me what sort of resource to create - test was corrupted I suppose. I believe that when the project builds, the compiler automatically launches the target/s (in this case an IB Plugin Component/bundle) which in turn loads the plugin into IB and asks for you to create a new document (to test it out)!? So I think so far things are looking good! In the case of the plug-in only, yes, it seems viable. However, live is not the case. However, when I compiled the project, the component crashed IB, warning about an Assertion Failure: Assertion Message: Two plug-ins (com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter and com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter) both integrate a class description for the class JTAENTLLCTextLengthLimiterFormatter. The primary definition for the class should only come from one plug- in; the other plug-in should be declaring a category. Declaring a category is accomplished by omitting the super class from classdescription file. I have no idea where any of this is coming from or how to fix it! I think I fixed that in the attached zip. Not sure what I did, other than to make sure all my names matched up in the appropriate places (I think the error was in the Limiter.m file). I did try replicating (more or less) the project from scratch and this seemed to get rid of the Assertion Failure and the plugin seemed to load o.k. Check out the attachment! I also tested your plugin re-deux in my live environment and got the same result. An xib wherein the plug-in is employed seems to get corrupted and IB then asks for a new resource to create. Give that a shot. Put your plug-in (or mine) in some frameworks directory, add it to IBs prefs-plug-ins, and add it to a project. Create a new window.xib, add a textfield, then use the formatter. Save and close the xib. Upon re-load it should crash (IB won't crash though - just the xib is corrupted). One thing I did notice about my plug-in is that the required framework seems to want the ibplugin file. I don't know how to revert that to the .framework file. Although, in yours, it is pointing to the .framework file
Re: IB Plugin help
Namaste! Thank you Kevin and Josh! Josh: To clear up the assertion error, Clean All Targets. There was some junk not getting dumped out of the project on successive builds. Also, you nailed it with the TextLength key. HomerDoh!/Homer I took Apple's file comment of MyFirstKey literally. While not terribly new with KVC, this is my first plugin and I thought Apple may be doing something different. So, I took the comment at face value. After changing TextLength to textLength, the plugin operates as expected. Kevin: [A] 1. Yes. 2. com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter, com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter Here's the output of the two terminal commands: 1st command (known): com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter = /Users/jcmii/JTAENTLLCTextLengthLimiter/JTAENTLLCTextLengthLimiter/build/Debug/JTAENTLLCTextLengthLimiter.ibplugin; com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiterFormatter = /Users/jcmii/StashWizG/StashWizG/JTAENTLLCTextLengthLimiter.framework/Resources/JTAENTLLCTextLengthLimiter.ibplugin; 2nd command (loaded): com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter I do have two remaining questions: 1. How do I change that blue cube (which displays when the textfield is selected) to my graphic (like NSNumberFormatter and NSDateFormatter)? 2. When I deploy my application do I need to deploy my plugin to the Library/Frameworks directory on the client machine, or is it enough to bundle it with my application? Many Thanks!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting josh hughes co...@brikbatrecords.net: Hi Jon, I tried compiling the project you attached but I was still getting Assertion Failures so I built the project from scratch again and it loads into IB without Assertion Failures (I think there is definitely something not setup right in the project you attached!). O.k First off, just to check; you are adding the framework to your live app, i.e... in Groupes Files (in your live app!): Browse to Frameworks and select Other Frameworks. Right click (ctl click) and navigate to Add-Existing Frameworks. In the open panel, browse to and select /Library/ NameOfYourFramework.framework. Click Add. Other Frameworks should now look something like this: Other Frameworks/ NameOfYourFramework.framework AppKit.framework CoreData.framework Foundation.framework It Is important your live app has the framework added to it as your plugin is dependent on it and will crash if it's not there! Sorry if you are already doing this, I thought It's better to make sure as this is quite important! Secondly, I think the reason IB keeps opening the new document window when you try and reopen the .xib is because the encoder is failing to encode the @TextLength property as it is not KVC-Compliant, so the component crashes when you try to save the xib, hence it also crashes when you try to decode/open the doc. I noticed that the component's console was spewing out errors when I tried to save or reopen an .xib the the component in it (in a live app): 009-04-05 12:32:51.436 Interface Builder[26488:10b] An exception was thrown during execution of an NSScriptCommand... 2009-04-05 12:32:51.438 Interface Builder[26488:10b] [JTextLengthFormatterView 0xaa82730 valueForUndefinedKey:]: this class is not key value coding-compliant for the key TextLength. I changed: [[keyPaths objectForKey:IBAttributeKeyPaths] addObjectsFromArray: [NSArray arrayWithObjects:@TextLength, nil]]; to: [[keyPaths objectForKey:IBAttributeKeyPaths] addObjectsFromArray: [NSArray arrayWithObjects:@textLength, nil]]; and this seems to have stopped the crashing when reopening the .xib. I have the project working here and can send you a .zip if you like? Hope this helps. All the best, Josh On 5 Apr 2009, at 01:10, jmun...@his.com wrote: Sorry for going quiet like that! I got distracted! No problem! :) I think that the fact IB is asking you to create a new document is a good thing! Actually, not in this case. The plugin seems to work fine within its project, so I decided to try and install it so I could use it in my other (live) project. I created a new window xib (imaginatively called test), put a textfield on it and saved it. Then, I added the formatter to the textfield, gave it a value of 5 and saved that. On re-open, IB then asked me what sort of resource to create - test was corrupted I suppose. I believe that when the project builds, the compiler automatically launches the target/s (in this case an IB Plugin Component/bundle) which in turn loads the plugin into IB and asks for you to create a new document (to test it out)!? So I think so far things are looking good! In the case of the plug-in only, yes, it seems viable. However, live is not the case. However, when I compiled the project, the component crashed IB, warning about an Assertion Failure:
Re: IB Plugin help
I haven't yet made an IB plugin with a custom formatter, but I'd assume you change that image the same way you change the image that appears in the document window. Return your own image in the - ibDefaultImage method in your integration category. On 5-Apr-09, at 9:31 AM, jmun...@his.com wrote: 1. How do I change that blue cube (which displays when the textfield is selected) to my graphic (like NSNumberFormatter and NSDateFormatter)? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
Namaste! Is this the proper way to do that: - (NSImage *)ibDefaultImage { NSBundle *myBundle = [NSBundle bundleWithIdentifier:@com.MyCompany.MyPluginName]; NSString *someString = [myBundle pathForResource:@SomePic ofType:@png]; NSImage *someImage = [[[NSImage alloc] initWithContentsOfFile:someString] autorelease]; return someImage; } When I ran it, I got the nifty little icon rep of plug-in. Many Thanks!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Brandon Walkin bwal...@gmail.com: I haven't yet made an IB plugin with a custom formatter, but I'd assume you change that image the same way you change the image that appears in the document window. Return your own image in the -ibDefaultImage method in your integration category. On 5-Apr-09, at 9:31 AM, jmun...@his.com wrote: 1. How do I change that blue cube (which displays when the textfield is selected) to my graphic (like NSNumberFormatter and NSDateFormatter)? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
Hi Jon, Here are my responses to your responses to my responses :): [1] INSTALLING THE PLUGIN There are obviously two modes for using an IB Plugin: developing it, and then actually using it as if it was just another plugin on the system. In the case you are developing the plugin, the best way to do this comes by default when you created the IB plugin project: just hit Build and Go and Xcode will pass along information to IB to load the development version of your plugin. Again, this works out of the box. But as you asked, how do we get a plugin from development into installation mode where I don't have to be debugging my plugin from Xcode to use it? There are a few ways of doing this of course. One way which I use to develop plugins is to build what is called a distribution root. A root is a built version of your project that, when the build is finished, is put in a folder (the Installation Build Products Location, or DSTROOT which is by default /tmp/ PROJECT_NAME.dst) that has a hierarchy of subfolders that mimics the layout on disk. The layout is determined by each Xcode target's Installation Directory (INSTALL_PATH). For example, let's say I have a MyPluginProject Xcode project that has the two standard IB plugin targets, MyPlugin for the plugin, and MyFramework for the framework. For the framework target, I set the Installation Directory to / Library/Frameworks (set by default). And for the plugin target, I set the Installation Directory to /Library/Frameworks/ MyFramework.framework/Resources (also set by default). Now, from the command line, I use the CLI to Xcode called xcodebuild. If I run the install command, then Xcode will build my project, create the folder specified by my DSTROOT, and then install each of the built targets into the appropriate subfolders based upon their Installation Directory. The install command might look like this: cd MYPROJECTDIRECTORY sudo xcodebuild install -configuration Release -target All This invokes xcodebuild to build the All target (added by default in IB plugin projects) of the project in the CWD using the Release configuration. If I then look in /tmp, I will see the following folder: MyPluginProject.dst. And inside of that folder, I get the following layout of folders: /tmp /MyPluginProject.dst /Library /Frameworks /MyFramework.framework ... other framework stuff /Resources /MyPlugin.ibplugin ... and it's contents Then, to install the distribution root on my system, all I need to do is the following command: sudo ditto /tmp/MyPluginProject.dst / And this will copy the contents of the distribution root folder in /, effectively placing each item exactly where it needs to go. At this point, the framework and plugin are installed, and if I open up IB, go to the Preferences, and add the plugin from /Library/ Frameworks, then I'm done. So, to review. To install a plugin, assuming I started with standard IB plugin template, I do the following: (1) Set the Installation Directory for the plugin and framework to where it should be installed. The framework, by default, will be / Library/Frameworks, which is good. The plugin, by default, will be / Library/Frameworks/MYFRAMEWORK.framework/Resources. That also is fine. If you change the name of your framework, however, be sure to reset the installation directory. (2) From the directory from plugin Xcode project lives in, build a distribution root by running the following: sudo xcodebuild install - configuration Release -target All (3) To install the built root, run: sudo ditto /tmp/ MYPROJECTNAME.dst / (4) In IB, under the Preferences, add your plugin by finding the framework in /Library/Frameworks. (5) Enjoy! But what if I want to change some things about your plugin later on? Do you have to build a root and install each time you want to check a change your are working on? No! If you change your plugin and want to test it quickly, you just hit Build and Go like you did when you first developed the plugin. Xcode will pass this information to IB, and IB will use your development version, NOT your installed version. How does it know the difference? When you run from Xcode, Xcode sets up the current working directory and then passes a flag that IB uses to open your plugin. Since the CWD is set to your build products folder, it uses the the plugin from there instead. This way, you can work on your plugin for awhile, making changes and testing in IB. Then, when you are satisfied, you can build a root, install it, and then go along your merry way using the new version
Re: IB Plugin help
On Apr 3, 2009, at 7:39 PM, jmun...@his.com wrote: I have one more question: How does one replace the blue cube object icon that tags on the text field with my formatter's graphic? That, I do not know how to do. I'll definitely update the my example though if I or someone else figures it out. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
On Apr 3, 2009, at 8:28 PM, jmun...@his.com wrote: OK, now I have one more question. I'd like to install and use my plug-in. However, when accessing IB's preferences-Plug-ins and attempting to add the plug-in I get: 1) when simply adding the ibplugin an error that states the file is missing necessary resources and to reinstall the bundle, or 2) when opening the framework folder no error but also nothing else either. What else did I miss This actually depends on what you'd like to do. For my own apps, I do what is documented in the ReadMe file from my sample plugin (see the 'Installation' section). In my case, I put the IBPlugin into the framework's resources folder: + MyIBPluginFramework.framework + Versions + A + Resources + MyIBPlugin.ibplugin NOTE: There are other files/folders too; above just shows specifically where the plugin resides. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
Namaste! sigh Still getting no action after attempting to add my plug-in to IB. No error either. I compared my target property settings with yours and BGHUD to be sure I hadn't goofed on something - everything seems well there (I reverted my settings which were retrieved from someone else's post to what I think are the default settings and that cleared up any previous errata). I cleaned my targets and recompiled. No errors of course. I moved the ibplugin file to the location you shared below. I copied the release framework folder to the ~/library/frameworks section of my disk. Attempting to add that to IB results in no-action (through Preferences-Plug-ins). No message, no action, nothing. Double-clicking the ibplugin results in the same thing. ARRRGGGHHH :/ does charlie brown head-banging-on-wall-thing What am I missing? I'd be happy to zip up and send the project to someone (nothing spectacular in it after all) who would like to take a look at it. Thanks for any further help!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ricky Sharp rsh...@mac.com: On Apr 3, 2009, at 8:28 PM, jmun...@his.com wrote: OK, now I have one more question. I'd like to install and use my plug-in. However, when accessing IB's preferences-Plug-ins and attempting to add the plug-in I get: 1) when simply adding the ibplugin an error that states the file is missing necessary resources and to reinstall the bundle, or 2) when opening the framework folder no error but also nothing else either. What else did I miss This actually depends on what you'd like to do. For my own apps, I do what is documented in the ReadMe file from my sample plugin (see the 'Installation' section). In my case, I put the IBPlugin into the framework's resources folder: + MyIBPluginFramework.framework + Versions + A + Resources + MyIBPlugin.ibplugin NOTE: There are other files/folders too; above just shows specifically where the plugin resides. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
Namaste! Well, I don't know that I did anything different as I haven't changed anything since the last email... But now the plugin is showing up in IB... ??? Oh well, hopefully that will be the end of the drama... Thanks everyone!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting josh hughes j...@brikbatrecords.net: Hi Jon, This might be a bit random as I've only just started reading this thread. I was wondering if you have a copy files build phase setup for your framework. When I'm building an IBPlugin I usually create a new copy files build phase for the framework target with /Library/Frameworks as the destination and drag in the framework from the Products group. This way the framework is automatically copies the framework to the right location at build time. b.t.w you said that: I copied the release framework folder to the ~/library/frameworks section of my disk. maybe try /Library/Frameworks rather than ~/Library/Frameworks. Also, make sure to add the framework to any project you wish to use it in! Sorry if this is irrelevant or you have already done so! Hope this helps, Josh p.s send a zip to my address if you like, no guaranties! On 4 Apr 2009, at 15:47, jmun...@his.com wrote: Namaste! sigh Still getting no action after attempting to add my plug-in to IB. No error either. I compared my target property settings with yours and BGHUD to be sure I hadn't goofed on something - everything seems well there (I reverted my settings which were retrieved from someone else's post to what I think are the default settings and that cleared up any previous errata). I cleaned my targets and recompiled. No errors of course. I moved the ibplugin file to the location you shared below. I copied the release framework folder to the ~/library/frameworks section of my disk. Attempting to add that to IB results in no-action (through Preferences-Plug-ins). No message, no action, nothing. Double-clicking the ibplugin results in the same thing. ARRRGGGHHH :/ does charlie brown head-banging-on-wall-thing What am I missing? I'd be happy to zip up and send the project to someone (nothing spectacular in it after all) who would like to take a look at it. Thanks for any further help!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ricky Sharp rsh...@mac.com: On Apr 3, 2009, at 8:28 PM, jmun...@his.com wrote: OK, now I have one more question. I'd like to install and use my plug-in. However, when accessing IB's preferences-Plug-ins and attempting to add the plug-in I get: 1) when simply adding the ibplugin an error that states the file is missing necessary resources and to reinstall the bundle, or 2) when opening the framework folder no error but also nothing else either. What else did I miss This actually depends on what you'd like to do. For my own apps, I do what is documented in the ReadMe file from my sample plugin (see the 'Installation' section). In my case, I put the IBPlugin into the framework's resources folder: + MyIBPluginFramework.framework + Versions + A + Resources + MyIBPlugin.ibplugin NOTE: There are other files/folders too; above just shows specifically where the plugin resides. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/cocoa%40brikbatrecords.net This email sent to co...@brikbatrecords.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
Namaste! So, not the end of the drama. The plugin shows in the list and is available in IB. However, when I use it, my xib gets toasted - on next open IB asks what file I'd like to create. I had to restore a prior backup to rescue my xib. Any thoughts anyone? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting jmun...@his.com: Namaste! Well, I don't know that I did anything different as I haven't changed anything since the last email... But now the plugin is showing up in IB... ??? Oh well, hopefully that will be the end of the drama... Thanks everyone!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting josh hughes j...@brikbatrecords.net: Hi Jon, This might be a bit random as I've only just started reading this thread. I was wondering if you have a copy files build phase setup for your framework. When I'm building an IBPlugin I usually create a new copy files build phase for the framework target with /Library/Frameworks as the destination and drag in the framework from the Products group. This way the framework is automatically copies the framework to the right location at build time. b.t.w you said that: I copied the release framework folder to the ~/library/frameworks section of my disk. maybe try /Library/Frameworks rather than ~/Library/Frameworks. Also, make sure to add the framework to any project you wish to use it in! Sorry if this is irrelevant or you have already done so! Hope this helps, Josh p.s send a zip to my address if you like, no guaranties! On 4 Apr 2009, at 15:47, jmun...@his.com wrote: Namaste! sigh Still getting no action after attempting to add my plug-in to IB. No error either. I compared my target property settings with yours and BGHUD to be sure I hadn't goofed on something - everything seems well there (I reverted my settings which were retrieved from someone else's post to what I think are the default settings and that cleared up any previous errata). I cleaned my targets and recompiled. No errors of course. I moved the ibplugin file to the location you shared below. I copied the release framework folder to the ~/library/frameworks section of my disk. Attempting to add that to IB results in no-action (through Preferences-Plug-ins). No message, no action, nothing. Double-clicking the ibplugin results in the same thing. ARRRGGGHHH :/ does charlie brown head-banging-on-wall-thing What am I missing? I'd be happy to zip up and send the project to someone (nothing spectacular in it after all) who would like to take a look at it. Thanks for any further help!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ricky Sharp rsh...@mac.com: On Apr 3, 2009, at 8:28 PM, jmun...@his.com wrote: OK, now I have one more question. I'd like to install and use my plug-in. However, when accessing IB's preferences-Plug-ins and attempting to add the plug-in I get: 1) when simply adding the ibplugin an error that states the file is missing necessary resources and to reinstall the bundle, or 2) when opening the framework folder no error but also nothing else either. What else did I miss This actually depends on what you'd like to do. For my own apps, I do what is documented in the ReadMe file from my sample plugin (see the 'Installation' section). In my case, I put the IBPlugin into the framework's resources folder: + MyIBPluginFramework.framework + Versions + A + Resources + MyIBPlugin.ibplugin NOTE: There are other files/folders too; above just shows specifically where the plugin resides. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/cocoa%40brikbatrecords.net This email sent to co...@brikbatrecords.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/jmunson%40his.com This email sent to jmun...@his.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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
Re: IB Plugin help
On Apr 4, 2009, at 1:48 PM, jmun...@his.com wrote: However, when I use it, my xib gets toasted - on next open IB asks what file I'd like to create. I had to restore a prior backup to rescue my xib. Hey Jon - Could you describe the failure in a little more detail? Are you running your plug-in and IB in the debugger? If so, is there an exception being raise? Jon Hess ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
Namaste! Thank you for your reply. If I run the plug-in in debug mode, I DO get an assertion failure: Assertion Message: Two plug-ins (com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter and com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter) both integrate a class description for the class JTAENTLLCTextLengthLimiterFormatter. The primary definition for the class should only come from one plug-in; the other plug-in should be declaring a category. Declaring a category is accomplished by omitting the super class from classdescription file. Backtrace: 0. Interface Builder0x4d29 [IBApplication handleAssertion:inFile:onLine:] 1. InterfaceBuilderKit 0x0038d242 [IBClassDescriber refactorWithActionChangeTypeRefactoringOperation:inDocument:error:] 2. InterfaceBuilderKit 0x002c4033 [IBPlugin didLoad] 3. InterfaceBuilderKit 0x002c389f [IBPluginController loadPluginAtPath:error:] 4. InterfaceBuilderKit 0x002ca5e3 [IBPluginController loadPluginWithIdentifier:error:] 5. InterfaceBuilderKit 0x002ca519 [IBPluginController restorePreviouslyLoadedPluginsFromIdentifiers:] 6. Interface Builder0x23db [IBApplication finishLaunching] 7. AppKit 0x950c73a3 [NSApplication run] 8. AppKit 0x950948a4 NSApplicationMain 9. Interface Builder0x4eca [IBApplication changeInspectorMode:] 10. ??? 0x3 I don't know how to fix that. I don't know why it thinks I have two plug-ins. If I run in release mode, it appears to load up and function EXCEPT upon re-loading a nib. I hadn't been running in debug mode once I got the plug-in actually working correctly, so there's got to be a change I made that caused this (that would be a Homer doh moment). What I mean is, if I put it in a live project by putting the framework in a more public place (like Library/Frameworks), then add it to a project, start IB, go into prefs-plugins and add it there, create a window nib, add a textfield to the window, then add the formatter, fill in the limit value, and save it, then close the nib, re-opening the nib results in IB asking what type of resource I'd like to create. I also noticed that under required frameworks the ibplugin file is displayed instead of the .framework file. I don't know how to fix that either. I'll be happy to forward the project to you if you'd like a gander, the file is 2.7mb in size. Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Jonathan Hess jh...@apple.com: On Apr 4, 2009, at 1:48 PM, jmun...@his.com wrote: However, when I use it, my xib gets toasted - on next open IB asks what file I'd like to create. I had to restore a prior backup to rescue my xib. Hey Jon - Could you describe the failure in a little more detail? Are you running your plug-in and IB in the debugger? If so, is there an exception being raise? Jon Hess ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
Namaste! Just want to pass on some further information. After that last post, the assertion error really bothered me. So, after a while of careful inspection (to the limits of what I know), I decided to and clean[ed] all targets of both the debug and release builds and re-compiled. In the plug-in project, runs of both debug and release went smoothly - IB loaded the plug-in, I was able to use it, close and re-open nibs successfully. No errors. Deploying the plug-in is proving difficult. I copied the release framework to Library/Frameworks. I also copied the framework into the frameworks section of a live project. I then created a test.xib in my live project, which I subsequently opened. In the Preferences-Plug-ins pane for IB, I attempted to add the plug-in. I got nothing - no error, nor plug-in. I then added the ibplugin file to the Resources folder of the version A of the framework. I then repeated the process of copying. This time, the plug-in appeared in IB. I added a textfield to test.xib, and applied the plug-in to it. I saved and closed the file. Upon re-open, IB didn't open the xib, but popped up the standard create a resource dialog - test had gotten kaboshed. I do notice that the Required Frameworks is displaying the .ibplugin file instead of the expected .framework file. I don't know if that is related or not. Again, I'll be happy to send up the project should you want to see it. Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Jonathan Hess jh...@apple.com: On Apr 4, 2009, at 1:48 PM, jmun...@his.com wrote: However, when I use it, my xib gets toasted - on next open IB asks what file I'd like to create. I had to restore a prior backup to rescue my xib. Hey Jon - Could you describe the failure in a little more detail? Are you running your plug-in and IB in the debugger? If so, is there an exception being raise? Jon Hess ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
Hi Jon, Let's see if we can't get this figured out. So the current problem you are having is that you cannot deploy an IBPlugin for use on your system, correct? If so, I have a few questions. (1) How are you installing the plugin and framework? Are you placing both them in /Library/Frameworks, with the plugin inside the framework's resources folder? (2) What is the bundle identifier for your framework (from the Properties tab in the target for your framework)? And what is the identifier for your plugin? (3) Do you mind sending the output of running the following commands in Terminal (assuming you are running IB 3.1.2; if you are running 3.1.1, then replace 3.1.2 with 3.1.1, and so forth): defaults read com.apple.InterfaceBuilder3 IBKnownPluginPaths.3.1.2 defaults read com.apple.InterfaceBuilder3 IBLoadedPluginIdentifiers. 3.1.2 Kevin -- Kevin Cathey Namaste! Just want to pass on some further information. After that last post, the assertion error really bothered me. So, after a while of careful inspection (to the limits of what I know), I decided to and clean[ed] all targets of both the debug and release builds and re-compiled. In the plug-in project, runs of both debug and release went smoothly - IB loaded the plug-in, I was able to use it, close and re-open nibs successfully. No errors. Deploying the plug-in is proving difficult. I copied the release framework to Library/Frameworks. I also copied the framework into the frameworks section of a live project. I then created a test.xib in my live project, which I subsequently opened. In the Preferences-Plug-ins pane for IB, I attempted to add the plug-in. I got nothing - no error, nor plug-in. I then added the ibplugin file to the Resources folder of the version A of the framework. I then repeated the process of copying. This time, the plug-in appeared in IB. I added a textfield to test.xib, and applied the plug-in to it. I saved and closed the file. Upon re-open, IB didn't open the xib, but popped up the standard create a resource dialog - test had gotten kaboshed. I do notice that the Required Frameworks is displaying the .ibplugin file instead of the expected .framework file. I don't know if that is related or not. Again, I'll be happy to send up the project should you want to see it. Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
IB Plugin help
Namaste! OK, I've read through the IB plug-in programming guide. That document essentially, as an example, discusses a highly simplistic NSButton derivative that doesn't have any code behind it. So, I'm a bit stuck. The object I'd like to make a plug-in of is an NSFormatter subclass. Is there an example of how to make a plug-in of this type? Is it possible to examine either NSDateFormatter or NSNumberFormatter to see how that was done? If so, where may I find them? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
RE: IB Plugin help
Namaste! I've muddled along as far as I can go and I need further assistance. Here's what I've done so far: 1. Created a plug-in project. 2. Edited the class description file to contain two entries, my plug-in class and the superclass of NSFormatter (I was able to find and looked at the same file for both NSDateFormatter and NSNumberFormatter). 3. changed the ...View default .h and .m files to ...Formatter .h and .m, and updated any other files pointing at same. Also set the base class to NSFormatter from NSView (which was the default template value). 4. Edited the library nib - removed the Example button, button view, label line for such, leaving the template view stuff up top. Dropped an ImageWell on the template view and pointed that to a custom icon. Added an object and set that to my ...Formatter class. Bound the representedObject of the view (containing the ImageWell) to that object. 5. Edited the inspector nib - removed everything but the first label and text field, changing the label to read Length. Set the Value binding of the text field to inspectedObjectsController.selection.length. 6. Edited the ...Integration file, replacing the comments with my length ( @Length ) property. Compiled and ran the plug-in. IB pops up and the library displays an entry for my plug-in. However, I get a disclosure triangle (no objects show below), that leads to My Company (a book), and then to Objects (another book). What am I missing??? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
On Apr 3, 2009, at 6:43 PM, jmun...@his.com wrote: I found one mistake where I didn't change the IBInspector class of File's Owner in the Inspector.xib to my Inspector subclass. Doing that gave me an entry in the bottom box of the library, but no object in the middle pane... How do I fix that? Also, the image isn't displaying either. I'm still getting the book entries under the Formatter name. That being said, I also notice that my Inspector subclass doesn't have any sort of reference to my Formatter object. Is it supposed to? I should think it may need one. The dox don't really go into that so I don't know for certain. So, do I code it into the .h? And also the .m? Boy, I wish there was an example to follow... See the following for an example: http://www.instantinteractive.com/private/samplecode/MyIBPlugin.zip ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
Namaste! Thank you, that was/is a big help. I also found BGHUDAppKit which was/is also invaluable help. Between those two good examples I think I got my plug-in working (using it live is what remains to be seen). I have one more question: How does one replace the blue cube object icon that tags on the text field with my formatter's graphic? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ricky Sharp rsh...@mac.com: On Apr 3, 2009, at 6:43 PM, jmun...@his.com wrote: I found one mistake where I didn't change the IBInspector class of File's Owner in the Inspector.xib to my Inspector subclass. Doing that gave me an entry in the bottom box of the library, but no object in the middle pane... How do I fix that? Also, the image isn't displaying either. I'm still getting the book entries under the Formatter name. That being said, I also notice that my Inspector subclass doesn't have any sort of reference to my Formatter object. Is it supposed to? I should think it may need one. The dox don't really go into that so I don't know for certain. So, do I code it into the .h? And also the .m? Boy, I wish there was an example to follow... See the following for an example: http://www.instantinteractive.com/private/samplecode/MyIBPlugin.zip ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: IB Plugin help
OK, now I have one more question. I'd like to install and use my plug-in. However, when accessing IB's preferences-Plug-ins and attempting to add the plug-in I get: 1) when simply adding the ibplugin an error that states the file is missing necessary resources and to reinstall the bundle, or 2) when opening the framework folder no error but also nothing else either. What else did I miss Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ricky Sharp rsh...@mac.com: On Apr 3, 2009, at 6:43 PM, jmun...@his.com wrote: I found one mistake where I didn't change the IBInspector class of File's Owner in the Inspector.xib to my Inspector subclass. Doing that gave me an entry in the bottom box of the library, but no object in the middle pane... How do I fix that? Also, the image isn't displaying either. I'm still getting the book entries under the Formatter name. That being said, I also notice that my Inspector subclass doesn't have any sort of reference to my Formatter object. Is it supposed to? I should think it may need one. The dox don't really go into that so I don't know for certain. So, do I code it into the .h? And also the .m? Boy, I wish there was an example to follow... See the following for an example: http://www.instantinteractive.com/private/samplecode/MyIBPlugin.zip ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com