allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
08/05/13 07:01 PM (12 years ago)

JSON snipper keeper

I need some help with someone who is familiar with the json snipppet keeper tool. I'm trying to create a custom class inside my xcode project. After downloading the source code from buzztouch, I created the custom class, and I'm trying too use the json snippet keeper to point to my .xib that i created. My file names are paymentCalculator.h, paymentCalculator.m, and paymentCalculator.xib. It is a loan amortization and loan calculator I created that works by itself. I'm just trying to included it in my app. I need help configuring the snippet keeper and my BT_config files so that it will pull up in my app?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/05/13 07:54 PM (12 years ago)
That sounds pretty cool :) I used something like that in my first app, but it was basically a webpage with a java script, because I wasn't very good with xcode/java at the time. Come to think of it, I'm not that good with Xcode/java 'now', lol! In any event... What you're trying to do is make the project think your plugin is a 'regular' plugin like all the rest, so in the JSON Snippet keeper, you're going to have to emulate all of the plugin parameters, so that it's included in the BT_Config.txt file. If you don't do that, the project won't know it's there, and no amount of coaxing will help. Take a look at your project JSON (BT_Config.txt) and cut/paste some plugin data that you're familiar with... and then replace it with your own custom data. You're going to need *at least* something like this: { "itemId": "AllanDriggers", <-- needs to be unique and different within the project "itemType": "paymentCalculator", <-- Important. Needs to be your class. "itemNickname": "PaymentCalculator", "navBarTitleText": "Allan Driggers Payment Calc" } itemId, itemType, and I think itemNickname are required. Everything else is 'nice', but not essential. And of course, if there are other 'control panel enabled default' variables (interest rate, default loan value, whatever) you'll also need to add those too. Hope this helps! Cheers! -- Smug You could also just create a custom plugin inside your BT control panel... It will add the plugin to your control panel. Add it to your screens, add it to your menu, and it can be downloaded with the rest of your project. Then all you'll have to do is cut/paste your code into the new downloaded plugin... the rest should be already wired.
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/05/13 08:22 PM (12 years ago)
Hey Smug If i put everything in a .xip folder, would you mind taking a look at it an tell me what you might think I'm missing? Allan
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
08/05/13 08:39 PM (12 years ago)
Smug's example is a little different than how I do it. Doesn't mean it's wrong and mine's right - just different. Here's my example that I use my apps... You'll see that as long as you have sub-classed the BT view controller for your class (I do this by duplicating an existing plugin and gut all the code out), you'll be able to use some simple formatting JSON like bg color, etc. Just replace my class name with your's, and use the itemId from your snippet when you paste it in (that's why it's in bold in the snippet screen). {"itemId":"4F47F3A590EA9DDEC478585","itemType":"BT_screen_plugIn", "itemNickname":"Heart Rate Zones", "navBarTitleText":"Heart Rate Zones", "classFileName":"JV_hrzones", "backgroundColor":"#FFFFFF"} Hope this helps. -Chris
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/05/13 08:39 PM (12 years ago)
Sure. Drop box it and either send me a pm or send the link to smugwimp at smugwimp dot com. Cheers! -- Smug
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/06/13 01:26 PM (12 years ago)
This is the code in the BT_config.txt file: {"itemId":"C1B4C63415EC3E3EF864CCA", "itemType":"BT_menuItem", "loadScreenWithItemId":"1AA7AA9B5F8A25EFB9693C8","titleText":"Payment Calculator"}, This is what's in the snippet keeper: {"itemId":"1AA7AA9B5F8A25EFB9693C8", "itemType":"paymentCalculator"} Is this right?
 
Stobe
buzztouch Evangelist
Profile
Posts: 1528
Reg: Mar 04, 2011
Fredericksburg,...
24,680
like
08/06/13 03:01 PM (12 years ago)
the first itemId that you're seeing is just the menuItem (the actual row item from the list menu). The second itemId (from the snippet), is what you need to edit. If your's isn't working, you can try pasting this in your snippet keeper: {"itemId":"1AA7AA9B5F8A25EFB9693C8","itemType":"BT_screen_plugIn", "itemNickname":"Payment Calculator", "navBarTitleText":"Payment Calculator", "classFileName":"paymentCalculator"} -Chris
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/06/13 03:48 PM (12 years ago)
Chris, If I could ask for a little clarification... I've 'surmised' that the 'itemType' needs to be the class file, yet in your above example you have an additional item "classFileName" that I am not acquainted with. Does this mean that 'classFileName' supersedes the 'itemType' with respect to the class that the project will seek? And if so, it would apply to both Xcode and Android/Java as well? 'classFileName' is a new one for me; haven't seen it before... :) Cheers! -- Smug
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/06/13 04:03 PM (12 years ago)
Ok I'll try that. Thanks Chris
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/06/13 06:32 PM (12 years ago)
Hey Chris I tried your idea and there is no change. I copied and pasted your text and it just brings up a blank screen just like before. Allan
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/06/13 06:38 PM (12 years ago)
I have been watching the outputs when i go through the menu items. Everything is working fine till I click on the link for the custom plugin. The output says this: 2013-08-06 21:32:33.840 vehiclebuyingcoach[1879:c07] BT_viewController: viewDidAppear in BT_viewController BASE CLASS What does BASE CLASS mean?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
08/06/13 09:35 PM (12 years ago)
Stobe's method works on iOS. It looks to see if that itemType is present before looking to see if that class is present. Since I'm not on my computer, in not sure off the top of my head what BaseClass means. But what did debugger show before the change to Stobe's method?
 

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.