Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 2    Views: 66

Veteran developer
Posts: 88
Reg: Oct 19, 2013
02/02/18 06:41 AM (3 months ago)

Live/Design Mode work-around?

There are some error reports on the Live/Design mode feature not working correctly. Smug had proposed a solution in


where you append the "&currentMode=live" snippet in the 'configuration data URL' field in your control panel (Core properties) and set your app to "Live" in XCode. Also, this discussion shows that the JSON data of your app is available in two versions (Design and Live), as expected.

When testing the Live mode with one of my apps I noticed that the first "refresh" leads to the correct app data (no unpublished data are shown). However, after the second "refresh" the current content of the control panel (with unpublished changes) is shown.

When looking closer into the source code and into the JSON data you see that the "Configuration Data URL" (as modified above with "&currentMode=live") does not make it to the Live JSON data... at least in my self hosted environment. So if I make a correction in my configuration file in Xcode it uses the correct live-URL for the first refresh, but after that update the configuration points back to the design-URL.

So... my work-around is
1) I leave the Core properties unchanged...
2) In BT_loading.m I add some code after

Line 158: useDataURL = [appCoreProperties.jsonVars objectForKey:@"dataURL"];

This is the code to add:

if ([appDelegate.currentMode isEqualToString:@"Live"]) {
if ([useDataURL rangeOfString:@"&currentMode=live"].location == NSNotFound) {
useDataURL = [useDataURL stringByAppendingString:@"&currentMode=live"];

What it does... is just corrects the configuration URL and adds the "&currentMode=live" part in code. And it does this only if this suffix is not present anyway (in case someone would correct the JSON data in the Buzztouch software...).

Best wishes – happy coding
Code is Art
Posts: 1025
Reg: Jun 07, 2012
02/02/18 07:57 AM (3 months ago)
Thanks for this. I’m updating an app soon and was wondering if I was going to need to mess with the code for live and design mode.
Calypso Kid
Aspiring developer
Posts: 775
Reg: Mar 09, 2012
Upstate New Yor...
02/03/18 09:47 AM (3 months ago)
Nice! Thank you Thomas.


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.