Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 6    Views: 50

NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
11/02/14 07:02 PM (9 years ago)

Motivational Posters - from another screen

Angry Ninja- Rather than use the built-in start screen defined in AN_Posters.xib, I have built a another screen that will be easier for me to add additional controls and modify(USC Screen). There is a button on that screen that loads AN_Posters. However after the initial setup, I would like to go right to the storyboard rather than showing the AN_Poster screen that I replaced. I thought that I would just need to put in a line in AN_Posters.m that calls -(void)pushToStoryManually Adding "[self pushToStoryManually];" in: viewDidLoad - loops endlessly viewWillAppear - no effect Pretty sure it is a really basic code flow question, but I have not tried something like this before) Thanks
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
11/03/14 05:30 AM (9 years ago)
For some reason, I always have the same issue with the pushtostorymanually code from mrdavid and kittsy. It works if you put an afterDelay of 0.01 code in there, but then you see a glimpse of another screen before it pushes the new storyboard screen. That's why I do a small "landing page" that requires the user to tap something to load whatever is in the storyboard in any plugins that utilize storyboards. It's kind of a crappy work around, but the only way I've been able to get it to work. :(
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
11/03/14 10:26 AM (9 years ago)
Willing to try the delay and then minimize what is on the current landing page. I am trying to avoid the user hitting two buttons to get there. Where in relation to the pushtostorymanually line would I add the delay? I am not in front of Mac so could you also please show what the line of code would be? Thanks!
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/03/14 08:00 PM (9 years ago)
You guys could try calling the method on the main thread. [self performSelectorOnMainThread:@Selector(pushToStoryManually) withObject:nil]; If your project has no idea what performSelectorOnMainThread is, (which it probably doesn't, for a few reasons), go ahead and try this: dispatch_async(dispatch_get_main_queue(), ^{ [self pushToStoryManually]; }); You can read about the differences here if interested: http://blackpixel.com/blog/2013/11/performselectoronmainthread-vs-dispatch-async.html Haven't looked at my code for a while, but it's probably something noobish that I missed at the time of writing it, I did a lot of work arounds instead of fixing the problem with porting. Hope this helps. Cheers, David Van Beveren http://btmods.com/chat ^ Chat with other BT members live! http://btmods.com/hire ^ Hire MrDavid for one of his services!
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
11/04/14 06:37 AM (9 years ago)
Thanks! Will give it a go tonight.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
11/04/14 09:25 AM (9 years ago)
Cheers :-) David Van Beveren http://btmods.com/chat ^ Chat with other BT members live! http://btmods.com/hire ^ Hire MrDavid for one of his services!
 
NCbuzz
Code is Art
Profile
Posts: 575
Reg: Sep 11, 2013
Lillington, NC
11,100
like
11/04/14 11:03 AM (9 years ago)
snuck some time at lunch... When I replaced the initial line: [self pushToStoryManually]; with: [self performSelectorOnMainThread:@Selector(pushToStoryManually) withObject:nil]; Thought App was aware of performSelectorOnMainThread. However build fails with unexpected "@" in program for the new line? ============= Tried alternate: dispatch_async(dispatch_get_main_queue(), ^{ [self pushToStoryManually]; }); and it worked same as : [self pushToStoryManually]; Back to square one...
 

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.