Instruments is not running my iOS application properly? - ios

I am working in Instruments and need to use the Allocations/Leaks profile, but for some reason my application won't run with those templates. I have a login screen, which is initially presented modally and once logged in will disappear modally as well. It opens the app and begins the login process, but once it logs in it begins to dismiss the page modally, but only makes it down as far as the bottom of the nav bar. It then freezes at that point and I can't do anything, but it continues to profile the running operation. I have reset everything and cleared all data in the iOS simulator. I also tried it on all of the different versions of the simulator including a physical device.
The problem is that this does not occur when I run the app regularly or when I use the Time Profiler template.
Why is Instruments not working with my app when using Allocations/Leaks/Zombies?

Related

libGDX iOS home button kills the game

I'm developing a libGDX game for Android and iOS (MobiDevelop's RoboVM fork). Android works perfectly, but I have a issue on iOS. When the iPhone home button is pressed to leave the game, and I launch the game again by tapping on icon, the game does not resume from where it was paused, but instead restarts, which means the loading screen is displayed, all assets are reloaded, and the main menu appears. Like a fresh/new start of the app. I do not have any specific configuration for the iOS module in my libgdx project and am using what was pregenerated.
Is it possible to tell iOS that I do not want to kill the process? I want to switch to pause/sleeping mode only.
I found a reason of this problem. I tested it on the real device, therefore I was unable to see a logs. When I switch to simulator and look at the logs, I found a NullPointerException. This was a cause of application crash. When I fix this bug, everything works as I expected. After iPhone home button is pressed, pause() method of com.badlogic.gdx.Screen is called and after rerun the game, it continues from exactly where it stops / pauses.
I learned a lesson: make a tests on simulator at first :-)
While I am entirely unfamiliar with libGDX, I can tell you that except for a few very specific cases (VOIP etc.), you cannot control what iOS does with your app when the home button gets pressed.
Furthermore, it is the responsibility of the developer to save the app's state when the app leaves the foreground since this is not something that is or can be handled automatically in a performant way.

Prevent iOS Springboard from Caching previous versions of screens

We have an iOS app for which we've updated the UI and branding.
If we produce a test build of the new app, and run it over the existing app (i.e. upgrading it), it runs fine.
However, if we quickly press the home button to exit the app, and quickly go back in again, it shows a cached old copy of that screen while it's loading. This is jarring in our case, as the colours are completely changed in the new app.
Is there any way to prevent this?

iOS UIViewcontroller remains visible

I have an app that segues between different viewcontrollers. Recently, I noticed the following issues:
In Xcode 6.4, running in the debugger on a device (not a simulator), clicking stop does not close the first UIViewcontroller, even when the app exits.
Launching a built copy of the app on a device generates multiple identical views on the device. This is only noticeable if you double click the home button to see which apps are running.
I didn't think either of these were possible. How can you check to block multiple launches of the app and make sure all views/view controllers close on exiting?

iOS Safari, when running our web-app in stand alone mode, crashes iOS in background

We're developing a web app that extensively uses Cavas 2D for some demos, and is successfully running on both iOS and Android devices. Recently we've added stand-alone mode for iOS devices, so user has to "Add-To-Home-Screen" and run it using screen icon, just like regular app.
What happens recently is that after 10-12 times we start the web app on iPhone4:
Status bar (initially set to 'black') suddenly turns white and we cannot exit Safari (by pressing home button).
If we try to make screen shot (home + power button), shutter sound is played as if screen shot was taken and saved.
If we try to lock the device (power button), screen turns black, but no action after that can bring unlock-screen or any screen for that matter - display remains black.
We can only do reset by pressing home + power for 10 seconds after this point.
If we do not lock the device, web app continuously work with no issues at all, it does not crash, but cannot exit it (double click on home button also has no result).
Has anyone experienced this with their web apps?
Any guidance in how to debug this would be highly appreciated. We've tried using Safari on OSX, connect iPhone to it and use Develop -> iPhone menu but no luck so far.
Thanks in advance!
I would start trying to debug by running XCode with the iPhone connected to the computer.
In XCode open "Organizer" and go to the tab "Devices".
You should see your device there, from which you can view the iOS console. That might be able to tell you what is going wrong with the phone stops responding.
I don't think you have to put the phone in development mode (or be a paid developer) to see the iOS console.

Application run different in debugger

Currently working on an application and when run on the simulator or device behaves normally. When you close and reopen the application is behaving strangely.
For example I want to upload the application on the device (iPad), the first run everything is proceeding normally, then I close the application and it is open in the background and behaves strangely, cells no longer have same order.
If you delete the application and run it again after the device from Xcode everything returns to normal.
I tried both ways: Release and Debug.
I checked the code and did deallocate.
  Can someone help me with more advice? Thanks in advance!
I suppose you mean pressing the Home button when saying "close". iOS transforms your app in a special suspended state and it seems you don't restore from it correctly. iOS sends a applicationWillEnterForeground notification when your app is being restored from the suspended state and you may need to behave differently than app being launched the first time.
Here you can find more info about this method.

Resources