Discussion Forums  >  Uncategorized

Replies: 9    Views: 241

Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
12/29/11 07:36 PM (14 years ago)

what files to bring into custom plugins V1.5 IOS

Hello, I would like to know what files I need to bring into my project for a custom plugin. I understand that the most basic plugin would only need a name.h & a name.m file then in the JSON class filename you would enter that name, (that is correct right?) but in a bigger project I have no idea where to start. I have done some searching and have found examples of people saying to drag in all of the class files but no more detail. I my example I would have regular .h &.m, appdelegate .h & .m, viewcontroller .h & .m Then .xib files. I am guessing I drag all of these in the my_plugins folder? Then what do I enter into the BT control panel for the JSON class filename? Do I also need to keep the file structure from the project I am copying the files from?(if there is some) I have tried this with an open source project I found online. I added all of the files I listed then tried the appdelegate and the viewcontroller files for the class name and neither worked for me. When I tried to build and run using each I loaded that screen then the app froze and xcode paused. I am sure you can tell from my question I have very little (if any) coding skill, but if I can figure this out I can combine storyboarding in xcode with BT and it make my life a lot easier. Thanks, Jim
 
mitchellapps
Aspiring developer
Profile
Posts: 170
Reg: Aug 15, 2011
St. Louis
4,300
like
12/29/11 08:22 PM (14 years ago)
I am also trying to figure this out. When I learn something I'll let you know. Maybe some others have experience with this...
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
12/29/11 08:35 PM (14 years ago)
First things first, there are no plugins in BTv1.5. There's screens in 1.5 & plugins in 2.0 so perhaps part of the confusion is apple & oranges.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
12/29/11 08:38 PM (14 years ago)
Go to help in buzztouch some useful links are there, I'm Android, you know more about iOS than I so I say no more. Fred
 
mitchellapps
Aspiring developer
Profile
Posts: 170
Reg: Aug 15, 2011
St. Louis
4,300
like
12/29/11 08:41 PM (14 years ago)
He's talking about the custom plugin screen in 1.5. Not the difference betweent screens in 1.5 and plugins in 2.0.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
12/29/11 08:55 PM (14 years ago)
My bad, forgot about that screen.
 
Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
like
12/29/11 09:10 PM (14 years ago)
Correct, custom plugin screen in 1.5 This really can't be that hard, I am sure I am just missing something. I will keep looking into it.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
12/30/11 03:27 AM (14 years ago)
Hi gang. I'll try to make this a bit clearer. It should be easier than it may appear but for sure it can get complicated. The idea is that the app will load a class file with the same name as the class file you enter in the Custom Plugin configuration screen. Experiment by adding a custom plugin and entering a pretend class file name then have a look at the JSON data for the project. When looking at the JSON, first look at one of the standard screens. You'll see that the itemType is the name of a class file that already exists in your project. Example: If you create an Image Gallery, the itemType in the JSON for that screen will be BT_screen_images. This itemType tells that app to load the BT_screen_images class file for that screen. For Custom Plugin screens, you are telling the app which class file to load. If you create a class file called myCoolController then the JSON data will show myCoolController in the screen data for that item. So, what the heck is myCoolController then? The myCoolController needs to be a class file that is a sub-class of BT_viewController. Have a look at all the other screen class files (the .m files). You'll see near the top, in the class declaration, that they are all sub-classes of BT_viewController. Your new custom class should be this way to. It's usually best to just do this to start: a) Choose an existing class to copy, like BT_screen_images. Copy both the BT_screen_images.m and the BT_screen_images.h files. Rename these to myCoolController.m and myCoolController.h. In these files, replace all occurrences of BT_screen_images with myCoolController. This literally takes :3 minutes. b) At this point, you have two new files in your projects source code directory but they are not added in Xcode yet. Add them to Xcode like any other file. Add > Existing Files. c) Set the class file to load to the name of you new class when setting up the Custom Plugin screen. myCoolController in this case. Run the project: Your new custom plugin does what the BT_screen_images plugin did because you copied it. In this case, an empty gallery will load (you didn't supply any images). From here, you'll want to carve out all the unneeded code and change it to whatever you want it to do. In thinking, you could copy a ligher, less complicated screen (images are complicated!) to make it easier to understand? All the JSON configuration data does is tell the app which class file to load and it does this by looking at the NAME of the class file in the JSON configuration. Oh, and lastly, XIB files (interface builder) are not used in buzztouch apps. This means you'll need to do your layout in code like all the other screens.
 
Crown Solutions
Aspiring developer
Profile
Posts: 463
Reg: Nov 11, 2011
MN
13,480
like
12/30/11 08:14 AM (14 years ago)
Thanks David, I guess I need to understand code a little better. I was hoping to be able to drag in all the files from a functional standalone xcode project, point to a specific file in my control panel and presto, automagicly the other project would be running within my BT app. I will start small and try to work up with additional files. I have been writing strictly in xcode as well to try and understand code better as well. Love what you guys are doing here!
 
theMonster
Code is Art
Profile
Posts: 435
Reg: Oct 18, 2011
US
8,050
like
07/31/12 04:00 AM (13 years ago)
Actually, you could load a xib file given the appropriate code. If someone wants me to dig up that code just message me
 

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.