Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 2    Views: 46

GraciousWolf_PE
Aspiring developer
Profile
Posts: 372
Reg: Feb 15, 2012
Montreal
10,720
09/08/12 09:46 PM (13 years ago)

Final Stretch - Adding Search Function

Hey everyone, My app is almost complete! I've added the famous Notepad & Tweet Sheet plugins as well as incorporated a print function for all my PDF documents! :) I need the BuzzTouch community to lend a helping hand for one final feature - a search function. I have over 200 PDF documents in one tab organized alphabetically, A - Z. I have added BuzzTouch's Search icon on the top right of the navigation bar. Evidently, right now, it has no actual function, but I am hoping to add a legit search function to it. I am not self-hosted. I have downloaded the BuzzTouch Search Menu via BuzzTouch Mods here: http://www.buzztouchmods.com/downloads.php?cat_id=1&download_id=19. I have tried following MySkylla's guide to adding plugins directly to your source code and bypassing the control panel here: http://myskylla.wordpress.com/2012/04/06/adding-plugins-directly-to-your-source-code-bypassing-the-control-panel/. Needless to say, I need help/clarification to make this feature a reality. It is truly a feature that is needed to sort through the many documents that I have. I have another button tab in which they are separated by categories, but regardless, it would be nice to allow for searches to be done in the A-Z screen. Any help would be greatly appreciated, I'm hoping to submit the application to Apple by tomorrow evening! Thanks in advance! Nicholas Stratigopoulos
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
09/09/12 12:31 AM (13 years ago)
Hi in Montreal. A few things come to mind. If you're not self hosted, you'll either have to create this yourself, or install a plugin from the market. There is not a search screen in the market yet. I've heard of few folks working on one, but it's not here today. Creating: Because you have the search plugin from bt mods, you should be able to add this to your project without too much trouble. I don't know your skill level...but it would go something like this....(and I'll mention some gotcha's at the end)... a) Drag the .m and .h files for the search screen's class files (not sure what the files are called in your plugin) into your project. You will get errors. Replace the "app delegate" name in this plugin with your app's delegate name. This should be the only thing that needs changed in the plugin unless it more "funky" than I expect. I haven't seen it. Drag the files in, change the delegate name to your delegate name were you see it. b) Create a new JSON screen object in your app's config.txt file. Add it to the BT_screens list that already exists in your config.txt file. Look at one of the screens...they all look like this... {"itemId":"a unique id", "itemType":"BT_screen_menuList", "itemNickname":"My Menu", "navBarTitleText":"My Menu"} For your search screen, you'll be changing the itemId to something unique, like "search999" and you'll be changing the itemType to the class name in your plugin. Like "search_plugin" or whatever the class name is. So, your screen would look like... {"itemId":"search999", "itemType":"search_plugin", "itemNickname":"Search", "navBarTitleText":"Search"} Put that in your config.txt file. Recompile, make sure you didn't break the syntax :-) Next, you'll need to "connect" the right side button to the search screen. Still in the JSON data in config.txt file, find the screen object that's the screen with the right side button. You'll see something like: "navBarRightButtonType":"search" (because you added the search button on one of these screens. Next to that, you'll need to add the id of the screen you want to load when the search button is tapped, like... "navBarRightButtonType":"search", "navBarRightButtonTapLoadScreenItemId":"search999" See how that works? Tapping the right side button will load the screen with id search999 Try to get that far, I'll bet you can. Two gotcha's I can think of right away. 1) Because you altered the config.txt file AFTER downloading it from your control panel, it will no longer match the config data you SEE in your control panel. This means if you "refresh" using the home screen refresh button (in the app), you'll be overwriting your changes, all the effort will be lost. This means you'll need to REMOVE the dataURL and the reportToCloudURL from the config.txt file so it DOES NOT download a new copy from your control panel. OR, you could move this text file to a DropBox account or other web server and connect it to that. In that case, you would then update it manually when you made changes in your control panel. Not sure how much of this you understand. Of course you could wait for the plugin too ;-)
 
GraciousWolf_PE
Aspiring developer
Profile
Posts: 372
Reg: Feb 15, 2012
Montreal
10,720
like
09/09/12 11:57 AM (13 years ago)
Hey David! Thanks for the detailed and elaborate step-by-step explanation. Shockingly, I understood all of it, for the most part. ;) Judging the pros vs cons, I believe I'd be better suited waiting for a search plugin to be implemented. I've added plenty of new features thanks to a couple of the new plugins through the plugin market and can't wait to incorporate more in future updates to the App Store. First things first - let's hope 4th time is a charm in getting my app APPROVED by Apple to begin with. ;) Thanks again for all your help, Nicholas
 

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.