NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
01/10/15 09:35 PM (9 years ago)

How to drag a connection between the referencing outlet and the ‘files owner’?

Trying to bring some code I wrote outside of BT into my app. Using a Blank Plugin, and wanted to add an XIB for the front-end. Found this thread that was similar... http://www.buzztouch.com/forum/thread.php?tid=95EDA420B5195FE0D665882&currentPage=296 There was a reference to a tutorial from Smug on how to add an XIB... https://dl.dropboxusercontent.com/u/115208762/EZXibConnect.pdf ================ I can not get step 5 to work. I am using Xcode v6.2 and hoping I am either pressing the wrong key combinations when drawing the blue line to connect???? Has anyone else done the same in newer Xcode? Thanks!
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/10/15 09:46 PM (9 years ago)
It's worked pretty much the same for me in all versions, so you're probably just missing a point that I might not have pushed enough. 1) Make sure that your xib is 'tied' to your class (step 4) This is important, because if it's not tied to the class, or the correct class, none of this will work. When you click your cursor in the text box, it 'should' pop up a little list of existing classes, and you can scroll and select the correct class. 2) Make sure your property is referenced within the header file class interface: @interface SW_yourPlugin : BT_viewController { IBOutlet UITableView *swYourTable; <-- Here IBOutlet UIImageView *swYourImage; NSString *swNotA_XibObject; <-- No 'IBOutlet' because it's not on the xib. } @property (nonatomic, retain) IBOutlet UITableView * swYourTable; <-- And Here too. @property (nonatomic, retain) IBOutlet UIImageView * swYourImage; @property (nonatomic, retain) NSString * swNotA_XibObject; @end 3) Make sure they're used as 'IBOutlet'. That'll be a biggie Let me know if that helps. Cheers! -- Smug
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
01/11/15 07:30 AM (9 years ago)
Thanks Smug- that helped get me past that point! It was step 4 that was the issue. I had started with the Blank Plugin and forgot to change @interface and @implementation from BT_screen_blank to NC_myplugin --------- I have been expanding several XIBs in my current project, but this is the first from scratch.
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
01/11/15 08:52 AM (9 years ago)
Well that leads to a new issue- that hopefully I can describe in a short post... I already have a screen that was based upon the BT_screen_blank which had several .h and .m with no xib that worked fine in the App. After adding a second BT_Blank_Screen with my new files is where I was adding the XIB. However selecting either in the menu screen (using carousel) it loaded the original ColorPicker. Verified with breakpoints and NSLog that it had the right ScreenItemId. Since I am not making a plugin, can I only have one BT_screen_blank in an app? JSON Data: {"itemId":"NUMBERS...9634A", "itemType":"BT_screen_blank", "itemNickname":"ImageComposer", "navBarTitleText":"ImageComposer"}, {"itemId":"NUMBERS...A00AF", "itemType":"BT_screen_blank", "itemNickname":"ColorPicker", "navBarTitleText":"Colors", "navBarRightButtonTapTransitionType":"fade", ========= Thought it would be easier integrating the new code I had outside of BT into an existing project, but looking like I need to step back and try implementing it into an empty BT to see what is wrong.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/11/15 06:57 PM (9 years ago)
Look at it this way. You can only have 'one instance of one class' per app. So, you can have a class called BT_screen_blank in your project, but you can't have TWO. You'll need to rename one of them, but then, that also provides another issue; how to call it from the control panel; it's only aware of the classes that are already there. If you need two plugins that do two different things, you'll need another blank class. The 'best' solution is to create a new plugin with the plugin creator tool, and add it to your control panel. Then the class is unique and ready to go. Just add code. Cheers! -- Smug Expanding a bit more... If you have a plugin, for instance the BT_screen_map. The 'class name' is the same as the 'itemType'. It's a Location Map. But the 'itemId' will be the identifier for the 'configuration' of 'that particular screen'. This is so you can have several maps, each with a different location. If you need two different functions (not configurations; functions), you need two different plugins, because the code in each will be tailored to the 'duties' of that class. And the itemId will be the 'particular config' for 'that instance' of a class. You can't call the same plugin, and expect different behavior. :)
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
01/11/15 07:31 PM (9 years ago)
Thanks for the clear explanation! Now I know the rest of the story... Since I am BT-Hosted I assume that the plugin creator tool is a no-go. So for now I will remove the previous BT_screen_blank and get back moving with the new one. By the way, the previous BT_screen_blank class I had was a colorPicker screen https://www.dropbox.com/s/7gbp55cxjwhjakl/ColorPicker.jpg?dl=0 If you or anyone else wants the code to turn into a plugin, just pm me and I will send you the code. (I made it prior to working with XIBs, but it would be an easy change to have an XIB rather than the code.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
01/11/15 07:42 PM (9 years ago)
The Plugin Creator should be available regardless of BT/Self Hosting... "If" you've been in touch with Susan Metoxen, she would have created a 'developer prefix' and turned on the creator. If not, do so at your earliest convenience. It'll make life much easier. Look in your 'installed plugins' page, and if you have a link (next to list/grid view links) called 'create a custom plugin' then you're already set. If not, an email to Susan will clear it up within a day or so... If you have any Smug Plugs, you'll notice all the class names are 'SW_xxxx', 'SW' is my developer prefix. If 'NC' is not already taken, it very well could be yours :) Cheers! -- Smug If you have Stobes 'snippet keeper' you could probably 'fake' a few new plugins without the system freaking out about it.
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
01/11/15 08:53 PM (9 years ago)
Wow. Have the link, I must just need the Dev code. I just emailed Susan. Will start back up tomorrow night. Thanks!
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
01/14/15 07:37 PM (9 years ago)
Smug, Thanks again for the tip for the Plugin Creator!!! I didn't realize the capability it gave you when you needed to incorporate custom code without producing a plugin for sale. Susan set up my Id, and I have the code for both plugins working :) (not ready for prime time) - but it feels great to have the added flexibility now.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.