• Advertisement
Sign in to follow this  

applicationDidBecomeActive (Xcode) Better way?

This topic is 1137 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement

applicationDidBecomeActive is the place to put your code.

 


This works, but only after the user have first entered the app, then left to the homescreen and then re-enter it.

 

That sounds strange... applicationDidBecomeActive  should be called also when the application is first launched.

Share this post


Link to post
Share on other sites

applicationDidBecomeActive is the place to put your code.

 

 

 


This works, but only after the user have first entered the app, then left to the homescreen and then re-enter it.

 

That sounds strange... applicationDidBecomeActive  should be called also when the application is first launched.

 

I also thought this, but it does not. I have tried to use it with other things and it only triggers when going back to the app, not when it is first launched..

Share this post


Link to post
Share on other sites

I also thought this, but it does not. I have tried to use it with other things and it only triggers when going back to the app, not when it is first launched..

 

I would guess your code in applicationDidBecomeActive relies on something being set up that isn't set up yet on first launch. Put a breakpoint there on launch or log the values/contents of relevant variables.

Edited by Erik Rufelt

Share this post


Link to post
Share on other sites

Click the left column in the source-window in Xcode, at the line-numbers, on a line of code in applicationDidBecomeActive. It will create a blue mark there.

Then click the Run button to run your app, and when execution reaches applicationDidBecomeActive, your app will pause and you can check variable-values etc. in Xcode.

 

This is perhaps the one most important thing to learn in programming, so if you haven't done this before I would recommend spending some time with it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement