Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
07/31/14 02:50 AM (9 years ago)

Button API Call

Hey guys, I need help. I have an app I'm creating and I have a button on a menu that opens the sidebar for Scringo. I found the code on Scringo's site. The problem is I'm using the blank screen plugin for that call. So every time I tap the button that opens the sidebar it loads the blank white screen. I want to know how not to have the screen "actually" load. I want the button to be tap and open the sidebar, but stay on the screen I was on before. Hopefully this made sense. Thanks, Adam
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 05:48 AM (9 years ago)
Hi adam it looks like you have done the nitty gritty. It makes perfect sense I'm guessing you have added the line [Scringo opensideBar]; (rough guess not infont of scringo) In the blank screen plugin somewhere i.e. view did appear. What you want to do is is actually alter the button did tap method in the menu plugin you are using with an if statement to open the side bar. There is a tutorial by absentia "How to make a button do anything" it's a bit dated but the gist is there. If you are still struggling I can post something
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 07:33 AM (9 years ago)
I'm using the ultimate screen creator plugin. I have no idea what type of code I'm removing or adding. Thanks, Adam
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 07:54 AM (9 years ago)
Okay I don't have this plugin but we can go on an adventure together. Like blind mans bluff. OK so as far as I am aware with this excellent plugin, you can add a button or a table. Is this a button or a table? To find the logic we are looking for this line that starts like this [self handleTapToLoadScreen: there will be a few but loo for one that kind of corresponds to what you have created
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 07:56 AM (9 years ago)
also in the mean time name your blank screen plugin "scringo" This screen will never show once we are finished just a place holder to fire the side menu
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 08:04 AM (9 years ago)
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:09 AM (9 years ago)
cool good idea with the screen shot. That may be the line could you take the screen shot so I could see the whole of that method from the -(void) part
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 08:12 AM (9 years ago)
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:14 AM (9 years ago)
That's fantastic are you sure you are tapping an image and not a button
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:14 AM (9 years ago)
There may be upto 4 of these [self handleTapToLoadScreen:
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 08:18 AM (9 years ago)
I'm tapping a button. Sorry about the confusion.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:19 AM (9 years ago)
right find where it links to a button and screen shot that possibly something like -(void)buttonClicked:(UIButton*)sender
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:20 AM (9 years ago)
then screenshot above [self handleTapToLoadScreen:
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 08:23 AM (9 years ago)
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:25 AM (9 years ago)
your going to kill me is it definitely in the table view not a stand alone button
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:27 AM (9 years ago)
no sign of this or something similar search for UIButton -(void)buttonClicked:(UIButton*)sender If we do it on the wrong type we will be scratching our heads
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 08:31 AM (9 years ago)
It is a button
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:31 AM (9 years ago)
well that is a tableview code you have screen shotted
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:33 AM (9 years ago)
there must be something like button clicked in the log Chris1 is very good with his log and variable names
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 08:44 AM (9 years ago)
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:46 AM (9 years ago)
ha ha thats more like it let us begin. Have you changed the the blank screen plugin nickname to scringo. Make sure you refresh the app. This will be the foundation of out if statement. also now is the time to import scringo to the top of this .m like you did with the blank screen plugin
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 08:48 AM (9 years ago)
Yes I did all that. By the way, I was on the wrong Chris1 plugin before so that's why nothing was found before. Sorry about that.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:53 AM (9 years ago)
ha ha great stuff. So it's all added to chris1 now the scringo import. Okay let's do it Underneath NSString *elementButtonScreenId = [self getJsonPropertyValue:thisElement.jsonVars nameOfProperty:@"elementButtonScreenId" defaultValue:@""]; add this if ([elementButtonScreenNickname isEqualToString:@"scringo"]) { [Scringo openSidebar]; }else{ then put the closing curly brace "}" below this [self handleTapToLoadScreen:screenToLoad theMenuItemData:thisElement];
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 08:54 AM (9 years ago)
remember this will only work if the blank screen plugins nickname is "scringo"
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 09:05 AM (9 years ago)
Getting the same result as before
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 09:06 AM (9 years ago)
can you secret shot with the updated code
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 09:06 AM (9 years ago)
screen shot
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 09:08 AM (9 years ago)
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 09:12 AM (9 years ago)
That code is right. add this under [scringo openSidebar]; make sure the app is refreshed the only reason it would by pass would be if the screen nickname wan't scringo.
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 09:12 AM (9 years ago)
Figure out the issue. So the screen name was sidebar before and I changed it to scringo, but in the ultimate screen creator it keep it as sidebar. I updated it and it works perfectly. Thank you Kittsy! Thanks for taking the time to figure this out. Sorry about the few mistakes I made lol. Thanks, Adam
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 09:13 AM (9 years ago)
That code is right. add this under [scringo openSidebar]; NSLog(@"Yippee"); you should see it pop up in the log if it does
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 09:13 AM (9 years ago)
Yippee not bad without Xcode not being in front of me.
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 09:14 AM (9 years ago)
That's impressive
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 09:15 AM (9 years ago)
It's rather sad really :-(
 
Adam
Aspiring developer
Profile
Posts: 247
Reg: Oct 23, 2010
Southern Califo...
4,470
like
07/31/14 09:18 AM (9 years ago)
It is sad for me because I had xcode and couldn't figure it out. Haha. This function is going to help me out a lot. Thanks, Adam
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
07/31/14 09:20 AM (9 years ago)
If you use my mosaic plugin you will find 3 custom options. In the Xcode project you just add the line of code such as [scringo openSideBar]; in between the corresponding brackets
 
nadthevlad
Code is Art
Profile
Posts: 1025
Reg: Jun 07, 2012
Denver
21,850
like
07/31/14 09:14 PM (9 years ago)
Thats pretty slick with the mosaic kittsy. Would that be considered 'code injection'?
 

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.