Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 71

Nelson
Aspiring developer
Profile
Posts: 57
Reg: Jun 06, 2013
Viseu
2,220
02/03/15 04:17 PM (9 years ago)

Smugs Location Menu transitionType

Anyone know how to prepare the JSON so you can choose a different "transitionType" when they procure for you open a row. This is my JSON, can I do this? it is not working... { "childItems": [ { "itemId": "1", "itemType": "Sw_loc_detail", "itemNickname1": "rest_quintadamagarenha", "iconName": "rest_quintadamagarenha_540x138.png", "titleText": "quinta da magarenha", "descriptionText": " ", "latitude": "40.639165", "longitude": "-7.851045", "categoryText": " ", "subcategoryText": " ", "loadScreenWithItemId": "15221A8CB301BBAC0BE6326", "transitionType": "fade" }
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/03/15 07:50 PM (9 years ago)
Let me take a look. The json 'should' work; I see no obvious problems with your json. Cheers! -- Smug
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/03/15 09:21 PM (9 years ago)
Hmm... If you could do me a favor, around line 318 of your 'SW_locationmenu.m' file, look for this statment: [self handleTapToLoadScreen:screenObjectToLoad theMenuItemData:thisLocationItem]; and *just above it*, paste these statements: // NSError *error; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:thisLocationItem options:NSJSONWritingPrettyPrinted error:&error]; NSString *quikCheck = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"thisLocationItem: JsonValue: %@", quikCheck]]; // and visually check (in your debug output log) to make sure that your transition json is being carried through. It should be. But the problem would then be that, the location menu is passing your transition type, and 'handleTapToLoadScreen' may not be responding appropriately. That's out of my hands. But so far, I can't see where that would be a problem in my plugin. Sorry. :( Cheers! -- Smug Edit: Corrected with Niraj's eagle eye.
 
Niraj
buzztouch Evangelist
Profile
Posts: 2943
Reg: Jul 11, 2012
Cerritos
37,930
like
02/05/15 09:16 AM (9 years ago)
Correction on the very last word: NSError *error; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:thisLocationItem options:NSJSONWritingPrettyPrinted error:&error]; NSString *quikCheck = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; [BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"thisLocationItem: JsonValue: %@", quikCheck]];
 
Nelson
Aspiring developer
Profile
Posts: 57
Reg: Jun 06, 2013
Viseu
2,220
like
02/06/15 07:56 AM (9 years ago)
Sorry but not yet had time to try it. when I do I tell the result. thank you for responding so quickly. Much work this week... You know...
 
Nelson
Aspiring developer
Profile
Posts: 57
Reg: Jun 06, 2013
Viseu
2,220
like
02/06/15 03:55 PM (9 years ago)
I paste the statements. But its giving an error. Can i change the overall transitionType in the code, I just dont like the one that is assumed. This is my debug output log, it is geting the JSON but not the "transitionType" in the JSON. Selected Row: 4 2015-02-06 22:25:50.536 municipio[284:60b] SW_locationmenu: json: { categoryText = " "; descriptionText = " "; distance = "3.1"; iconName = "rest_quintadamagarenha_540x138.png"; itemId = 2; itemType = "Sw_loc_detail"; latitude = "40.639165"; loadScreenWithItemId = 15221A8CB301BBAC0BE6326; longitude = "-7.851045"; subcategoryText = " "; titleText = "quinta da magarenha"; } 2015-02-06 22:25:50.537 municipio[284:60b] BT_application: getScreenDataByItemId 15221A8CB301BBAC0BE6326 2015-02-06 22:25:50.538 municipio[284:60b] BT_application: screenType is CR_ultimatScreenCreator for screen with nickname: "restquintadamagarenha" and itemId: 15221A8CB301BBAC0BE6326 2015-02-06 22:25:50.539 municipio[284:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSJSONSerialization dataWithJSONObject:options:error:]: Invalid top-level type in JSON write' *** First throw call stack: (0x2f798ecb 0x39f33ce7 0x2f798e0d 0x301e0f0b 0x13a841 0x320e87d3 0x3219ac93 0x32049de9 0x31fc2b37 0x2f763ff9 0x2f761987 0x2f761cd3 0x2f6cc729 0x2f6cc50b 0x3463b6d3 0x3202d871 0x11d3c1 0x3a431ab7) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/06/15 06:14 PM (9 years ago)
No, you're not doing anything wrong. For some reason that code won't work in that method 'as it is'. I'll look into it in a bit. What we're trying to see here, is that the transitionType json info is getting to the 'handleTapToLoadScreen' method... Nothing in my plugin (or any plugin) really deals with transitions. All most menu 'style' plugins are doing is passing on json information to the system once a 'selection' has been made. Once the Json 'leaves' the plugin, there isn't much that can be done 'from the plugin'. But it doesn't mean I'm not going to help; I'll try my best to duplicate your issue and see if there is anything I can assist with. Would you be willing to provide me a copy of your childItem file? Or a database URL that I can obtain the information from? You may want to email me directly (smugwimp at smugwimp dot com) or private message me via BT message, so that no personal or proprietary information is released publicly. Cheers! -- Smug
 

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.