Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 41    Views: 178

Fingers Crossed
Veteran developer
Profile
Posts: 234
Reg: Jan 16, 2012
Simcoe, ON
6,390
05/09/13 10:40 AM (12 years ago)

Alertview compile errors

I just downloaded new source since purchasing the alertview plugin. When I try to compile it I received a number of errors. It seems its an issue with case on this statement. @implementation JC_AlertView This is the fixed version, by default it was @implementation Jc_alertview Once I updated it, it compiled fine. All the errors in XCode are in this screenshot. https://dl.dropboxusercontent.com/u/25547044/General/alertviewss.png
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/09/13 10:46 AM (12 years ago)
How does plugin work as I have purchased but I can't get it to work. How does it attach it self to a screen? Do I have to re-download the source code and rebuild my project again or can I just add the plugin to my project? Confused how it works as I have no options to attach to a menu screen.
 
Fingers Crossed
Veteran developer
Profile
Posts: 234
Reg: Jan 16, 2012
Simcoe, ON
6,390
like
05/09/13 10:49 AM (12 years ago)
Once you have bought the plugin, you go to 'screens', and add new (then choose alert menu) If it was an existing project, you will have to repackage and download the source. Once you've done it once, you can just add new screens via the Control Panel (CP)
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/09/13 10:50 AM (12 years ago)
It doesn't look like it's fixed yet. Follow the original thread with more info here: https://www.buzztouch.com/forum/thread.php?tid=BEC2DF6F355A5EBBA01570A
 
Fingers Crossed
Veteran developer
Profile
Posts: 234
Reg: Jan 16, 2012
Simcoe, ON
6,390
like
05/09/13 10:51 AM (12 years ago)
Ah, didn't see that thread, but at least you can use the fix above if you want to try it :) Thanks WallE
 
Fingers Crossed
Veteran developer
Profile
Posts: 234
Reg: Jan 16, 2012
Simcoe, ON
6,390
like
05/09/13 10:57 AM (12 years ago)
OK, I take that back, it allows you to compile it, doesn't necessarily mean it works :)
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/09/13 11:07 AM (12 years ago)
Correct, it compiles but there is no real guts in the 'Jc_alertview.m' file. So therefore all you get is a blank screen and a navbar. Still waiting for the source files to be replaced on the BT online control panel.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/09/13 11:16 AM (12 years ago)
OK Guys. I've checked and re-updated the source files on the download server. The Class file name for this plugin is JC_AlertView (case sensitive). The means if you're iOS .m or .h files use anything other than that, such as Jc_alertView (see the lower case) you'll have compiler issues. All should be fine if you fetch the files as they stand now. If not, we'll re-visit this as needed.
 
Dragon007
Lost but trying
Profile
Posts: 1509
Reg: Dec 17, 2011
London
20,590
like
05/09/13 11:42 AM (12 years ago)
Lost count the amount of times I have had to repackage and download source code. Can I download code and overwrite the necessary files as I have done lots of custom code additions?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/09/13 11:59 AM (12 years ago)
@Dragon007: Yup. When you download a package for an app you'll get the same project each time. This means you can replace source-code in your existing project with files from the download. It's common to make changes and modifications after downloading Xcode project. Folks use all sorts of methods to manage these changes. In most cases it's a matter of keeping two directories so you always have the "standard" project plus the one you've made changes too :-)
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/09/13 01:17 PM (12 years ago)
Hi David, Thx for the support on this issue. I've just re-downloaded the Alert Menu plugin (after seeing your post) and followed your instructions regarding re-naming the files and @implementation reference. My project will compile after the renaming process with no errors but when I run the plugin I just get a blank (white) screen with a navbar and a left button labelled 'Back'. Basically no menu content (I've definitely configured the plugin from the BT online control panel). Screenshot: https://www.sugarsync.com/pf/D1063566_77067440_07572 Also, I'm running/getting the plugin from the BT control panel, not a self-hosted server. Thx again for you support.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/09/13 02:47 PM (12 years ago)
Ah, OK. I misunderstood what you were meaning. Got it. This is strange for sure. This plugin is not designed to "show a new screen" but instead pop-up a list of options in an Alert View. It does this by forcing the UIViewController (it's own view controller) to remove itself as soon as it dispalys. You should never see what you're seeing :-) Have a look at the - (void)viewDidAppear:(BOOL)animated{ method on line 143 of the .m file. It should work like this... a) You connect this screen to a Button or Menu item. b) You tap the button in the app to "load" the JC_AlertView view controller. c) As soon as the view controller loads, it shows the UIAlert then dismisses itself. Your screenshot shows an empty, blank view controller like you describe. It does not show the Alert View. This is weird. LOL. Could it be that you've got this Plugin Connected to a tab-bar item as the home screen for a tab? It's occurring to me now that it won't work in that manner, it needs to be connected to a button tap. But, if that was the case, you should at least see the UIAlertView - right? Let me know this and I'll do some more digging... a) What type of device are you testing this on? b) Is this an actual device or a simulator? c) What type of button is this connected to. Menu? Right side nav? Menu list, etc. I'll get a look after learning this.
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/09/13 03:41 PM (12 years ago)
Hi David, I'm assuming you are referring to the 'JC_AlertView.m' for this plugin? There's simply no code contained in the .m file to generate the alert menu. This has been the case since the plugin's release. Just to answer your questions: - the plugin is not connected to a tab-bar - the plugin is connected to a menu based plugin (as recommended by the author [Jake]) - the plugin is fully configured via the BT online control panel - testing on the Xcode iOS simulator It's a plugin code issue... there is no line 143 in the 'JC_AlertView.m' file. Here is the actual code (less the copyright info at the top of the file) from the 'JC_AlertView.m' file: #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import "JSON.h" #import "BT_application.h" #import "BT_strings.h" #import "BT_viewUtilities.h" #import "ccptester_appDelegate.h" #import "BT_item.h" #import "BT_debugger.h" #import "BT_viewControllerManager.h" #import "JC_AlertView.h" @implementation JC_AlertView //viewDidLoad -(void)viewDidLoad{ [BT_debugger showIt:self theMessage:@"viewDidLoad"]; [super viewDidLoad]; //put code here that adds UI controls to the screen. } //view will appear -(void)viewWillAppear:(BOOL)animated{ [super viewWillAppear:animated]; [BT_debugger showIt:self theMessage:@"viewWillAppear"]; //flag this as the current screen ccptester_appDelegate *appDelegate = (ccptester_appDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData; //setup navigation bar and background [BT_viewUtilities configureBackgroundAndNavBar:self theScreenData:[self screenData]]; } //dealloc -(void)dealloc { [super dealloc]; } @end Based on the code that is present, the plugin can only open a view (blank), display the nav-bar and that's it. Thx for your assistance, Kirk
 
Susan Metoxen
buzztouch Evangelist
Profile
Posts: 1706
Reg: May 01, 2011
Hopkins, Minnes...
26,260
like
05/09/13 05:02 PM (12 years ago)
We attempted to fix the problem today, but the fix did not work. We hope to get this fixed in a few hours. The problem only affects BT on-line and not self-hosted. In the meantime, if you are in a hurry to get this new plugin in your app, you can download the self-hosted version of the plugin. (Go to Installed Plugins, select the Alert Menu plugin, and you will see "download self-hosted version.") In the iOS files you will find a file called, JC_Alertview.m. Delete the Jc_alertView.m file in your Xcode project, and drag this one in its place. You then have one more step--you need to go in the new JC_AlertView.m file and find all the places it says "BT_appDelegate", and change the "BT" to your project name.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/09/13 05:36 PM (12 years ago)
Hope you get it working. In the future, you should probably not paste the code for the entire plugin in the forums ... kind of defeats the purpose of a market.
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
05/09/13 05:56 PM (12 years ago)
Hi Everyone, Here is a user manual for the plugin: http://jworldhosting.com/Uploads/Apps/HowToGuides/AlertMenu_HowTo.pdf Buzztouch will try to resolve the issue of the download coming from Buzztouch.com very soon. If you are downloading this on your self-hosted server, I believe no one is having any issues. Thanks, Jake
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/09/13 09:04 PM (12 years ago)
@chris1: Understood regarding pasting code, however in this case there was only the standard '//viewDidLoad' & '//view will appear' code snippets in the file and nothing to give any special secret code away. In an effort to help to explain the issue this step was taken. @Jake: Thx for the plugin manual and you're correct that if you use the self-hosted server version of the plugin that it works as expected. Thx again for a very handy plugin. @BT: Thx for all your combined efforts to resolve this issue.
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/09/13 09:43 PM (12 years ago)
@WallE - sorry, guess I didn't pay close enough attention to what you had there!
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
05/09/13 10:17 PM (12 years ago)
Wowza, FINALLY got this figured out. The explanation: The download server does all sorts of file system operations when you download the source for an app. One of the most important is the manipulation of each .h and .m file for each plugin (and .java for Android). In order to do this, the automated system opens and reads each file in the plugin package. These files are in source-ios and source-android in the plugin package. Two files are needed for this plugin for iOS. JC_alertView.h and JC_alertView.m. The files names are case sensitive. As it turns out, this plugin had 4 files in it's source-ios folder. JC_alertView.h, JC_alertView.m, Jc_alertView.h and Jc_alertView.m. These are DIFFERENT files because the second two files use a lower case "c" in the file name. The proper files use the upper case "C" in the file name. The download server was including the wrong files - the ones that should not exist - yikes! The lesson: For us...we need to make sure the download server does not contain any EXTRA files when updating plugins. This has never happened before so we were not expecting to find this. For Developers: When you use the Plugin Creator Tool it creates files for you with a specific file name. If you change these all sorts of other things will also need changed. This is the reason it's best to stick with the names the plugin tool generates for you. A few reasons we need to re-think how that generator tool works to begin with :-) Lesson learned. The proper files will be included when you download projects. For @Dragon007 it will be the 500th time today. LOL.
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/10/13 05:18 AM (12 years ago)
@chris1: No problem sir. @David: Thx for the update and explanation. I've now done the standard download of a project's source code (with the new Alert Plugin's files) and all looks great and works as expected with no errors. Thx to all involved in working through this unusual situation. BT rules!
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/10/13 08:19 AM (12 years ago)
Boy, I really feel like the bad guy this week and the bearer of bad news (and good too). Good news: The plugin code and source download from the BT console is as noted before... now working fine in principle Bad news: I added a fresh copy of the plugin to an app via the BT console and did an initial configuration including 3 buttons/screens. This worked fine and in my app I was able to use the Alert plugin UI screen to open any of the 3 screens. However, when I went to edit the button/screen config via the BT console and save the config details the changes I made did not get saved even though the JSON note output by the Save button looked correct. When I refreshed the screen my config reverted back to the initial config details. In addition I notice that the 'Load Screen 1' text gets copied to 'Load Screen 4' that I intentionally left NULL. Possible database read/write issue? Not a show stopper but definitely and issue to investigate. Workaround For Now: 1) Make sure on the initial create of your 'Alert Menu' config that you get it the way you want it and avoid edits. 2) Manually edit the 'config.txt' file in your project (although this only helps while in development). I'm going for a large coffee now.
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
05/10/13 09:55 AM (12 years ago)
@WallE: I am sorry you are having problems with my new plugin. Are you Self-Hosted? When you set a button to "NULL" did you leave the space blank or type the word NULL into the box? Thanks, Jake
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/10/13 11:10 AM (12 years ago)
Hi Jake, Not self-hosted, using the regular BT online control panel. By 'NULL' I mean blank. I can blank 'Load Screen 4' and hit Save, then close the plugin config page and then open that page again and 'Load Screen 4' is populated again. I'm assuming it's an issue with the BT system db(s) and not the plugin. The plugin itself works fine given the required JSON info from the 'config.txt' file. It seems like the initial plugin JSON info is being written to the db, but any edits (at lease for the 'Button Properties' as that's what I edited) do not get written to the db. Still a great plugin. What a week eh!
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/10/13 11:34 AM (12 years ago)
@WallE - just to confirm, when you make a change to the plugin's control panel, it does not show up when you go to the "Configuration Data" screen on the control panel for your app? If so, this is likely an issue with the index.php file Jake made when creating the plugin. I won't be back home in front of my computer for a few more hours to take a look at it to see if this is the case or not. If it is, I'll send a correction to Jake to make in his next update. However, if it shows the correct data in the snippet that appears when you hit save, then chances are it is correctly saving the data. It may be your dataURL for your app is messed up? That's why I say first check the "configuration data" screen to see if the full bt_config.txt file online has the correct JSON for this screen.
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
05/10/13 02:33 PM (12 years ago)
@Chris1: Thank you very much. @WallE: I am sorry you are having so many problems with my plugin. I have tested this on a BT.com control panel and mine saves to the database successfully. Are you using Live/Design Mode? Jake
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/11/13 09:03 AM (12 years ago)
Hi Jake, I'm working in 'Design' mode. I've generated a 'config.txt' file both at an 'Alert Menu' create (initial create of plugin settings) and after editing the 'Alert Menu' and tested both in Xcode and the edits do not make it to the config.txt file and therefore are not reflected in the app. I have no idea what happens between these points from the BT side as I'm not privy to the BT inner workings (I can only guess from my server/developer experience). Here are the steps I've taken in testing: 1) Add 'Alert Menu' plugin to my app within the BT online control panel 2) Configure the 'Alert Menu' for 3 buttons/screens (4th button left blank) 3) Save the 'Alert Menu' settings (this is my initial create) 4) Download source code from BT and copy the 'config.txt' file into my Xcode project 5) Test app from Xcode ('Alert Menu' buttons work as expected) 6) Go back to BT control panel and edit the 'Alert Menu' button properties 7) Save 'Alert Menu' edits 8) Download source code from BT and copy the new 'config.txt' (should contain the button property changes) file into my Xcode project 9) Test app from Xcode ('Alert Menu' buttons work exactly as before - actions should have changed because of 'Alert Menu' property edits on the BT control panel) I've taken screenshots at each step and you can see the basic order here: https://www.sugarsync.com/pf/D1063566_77067440_09577 Try the same scenario to see if you can replicate. This may be an issue with only the BT online control panel and not the self-hosted version? But what ever, I'm sure I'm not the only one to see the issue. All of my other plugin edits still work fine. We'll get to the bottom of it one step at a time! Thx, Kirk
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
05/11/13 09:28 AM (12 years ago)
@WallE: Can you change the nickname of the alert? (I think it is possible it is somehow invalid, if it is invalid sometimes changes can't save correctly.) Does this work? Jake
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
05/11/13 09:53 AM (12 years ago)
@WallE: I think I figured it out. Have you tried a different browser? (Firefox and Chrome?) Jake
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/11/13 03:53 PM (12 years ago)
Hi Jake, Thx for the suggestions. 1) Tried changing nicknames so there were no special characters like hyphens (-) but no luck there [I know you can't use, say an apostrophe (')] 2) Tried a different browser with no difference... HOWEVER, in trying a different browser I discovered that ALL 4 'Load Screen' fields MUST be populated and changed in order for the changes to be processed. So maybe that's why 'Load Screen #4' always gets populated with 'Load Screen #1' content IF you leave it blank. I also noticed that you need to use the 'Select' link to choose the screen nickname instead of just typing the name in (most of the time I know the name so it's faster to just type it in rather than do the 'select' db call). So, it looks like to me that somewhere in the BT db world there must be logic to require the above noted conditions in order for changes/edit to be processed for the 'Alert Menu' plugin as it stands now. I can consistently now get the changes to work if I follow these rules. Definitely some inconsistencies associated with this plugin for some reason. This is my work-a-round for now. I've spent the last 20 years doing programming in various languages and Oracle db front ends but this was a strange one as I'm used to having direct access to the underlying db. Let me know you discover anything else in your testing. Thx for the assistance. Kirk
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
05/11/13 04:12 PM (12 years ago)
@WallE: What screen are you trying to connect the AlertView Plugin from (Menu List, Right Nav Bar, Menu Button...)? Jake
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/11/13 04:22 PM (12 years ago)
Jake and WallE - I'll try to take a look at the index.php file when I get home - sounds like that's where the issue is.
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/11/13 04:56 PM (12 years ago)
@Jake: The 'Alert Menu' is called from a menu list ('BTA Design Menu' plugin) @chris1: Thx for the help
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/11/13 05:21 PM (12 years ago)
Just got home, installed the plugin, and verified the problem on a buzztouch.com control panel. Looking into it now.
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
05/11/13 05:24 PM (12 years ago)
Hi Guys: I think I have found the error in the plugin. It was saving, but not displaying the text again. I added: value="<?php echo fnFormOutput(fnGetJsonProperyValue("button1Nickname", $jsonVars)); to auto fill the box from the database. Chris and Kirk: I have PM'd you the new code to test. Thanks, Jake
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/11/13 05:26 PM (12 years ago)
Jake - it's not saving the data. Here's what I did to produce the error. I added a new screen of the Alert Menu plugin, and added in the word "test" for "Button 1 Title". Then I hit save. It showed in the snippet, but didn't show in the configuration data (aka config.txt).
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
05/11/13 05:28 PM (12 years ago)
@Chris: I just tested BT.com and Self Hosted, and could not re-produce the issue with my new code. If you have time —Is it possible to test it with the code I PM'd you? Thanks for your help, Jake
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/11/13 05:33 PM (12 years ago)
Not sure how you tested BT.com with your new code, but I can not reproduce the error on self-hosted - even with your original code. So, we're going to need David to take a look at this one.
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
05/11/13 05:34 PM (12 years ago)
Ok Chris. Thank you very much for your help tonight. Jake
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/11/13 05:38 PM (12 years ago)
scratch that - I was apparently looking at the wrong screen in the JSON data. It seems to be working fine - even on Buzztouch.com
 
Jake Chasan
Veteran developer
Profile
Posts: 1685
Reg: May 13, 2011
location unknow...
29,650
like
05/11/13 05:40 PM (12 years ago)
Ok, I still found a few errors: the plugin was not pulling the screen name from the database. I have fixed this issue and sent an update into BT. Thanks for all you help. Jake
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/11/13 05:47 PM (12 years ago)
Okay - yeah, the configuration data should still be saving - but I see what you mean about the nickname not displaying on the control panel after coming back to the page. If you were to then save, it would save the empty fields, erasing the data. I'm guessing this is what WallE was doing? WallE - I never saw a screenshot of your configuration data from the Buzztouch.com control panel. Did you check whether the change showed up there?
 
WallE
Aspiring developer
Profile
Posts: 73
Reg: Jan 29, 2012
Burlington, Can...
2,880
like
05/12/13 06:27 AM (12 years ago)
@chris1: I did see some changes in the config file, however they didn't produce the expected UI change in my app. So I figured that somehow the db linkages (item ID's?) didn't match up. I'm not familiar with the linkage in the BT config.txt file yet so I'll try to investigate that next. Thx for your help.
 

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.