iOS UIViewcontroller remains visible - ios

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?

Related

Strange bug - Some elements are visible when I run app from Xcode, but not if I start running the app from device

Context: Native iOS app developed with Swift which manages external control units via bluetooth. I use Xcode Version 14.2, but it used to happen with older versions as well. Tested on devices with iOS 15 and 16.
In a specific section what the app has to do is:
take the data through the Bluetooth input and output
go to the outputs screen and present the outputs
from the outputs screen go to the inputs screen and show them
The problem is as follows.
If I take a physical iPhone and connect it to the Mac, then start the app from Xcode, everything works fine.
If, with the same iPhone, I start the app not from Xcode but with a tap from the iPhone screen, the app starts correctly, connects via Bluetooth, shows all the outputs correct, while for the inputs they are all correct except the last. The last one is never displayed, all the others are.
The main problem is that I don't know how to debug since it only happens when the app starts unlinked from Xcode. Does anyone know of other ways to troubleshoot the problem or have had similar problems and know of possible solutions?

How to have no Xamarin.ios spash and no display

This Xamarin.ios app on iPhone must have no splash and no display whatsoever and must leave previous app displayed.
Is is launched by an Objective-C app and it only runs for a short time and then ends itself, leaving screen of the ObjC app always displayed
I need the app that launched it to remain in focus.
USAGE STEPS...
I open the ObjC app, which has command buttons
I press button that starts my Xamarin.ios app which should have no display at all
ObjC app button menu remains displayed
Xamarin.ios app runs and then ends itself
ObjC app button menu remains
Please help -- am under the "time gun" .
This is not possible on iOS - if it makes it easier for you you could have whole the time in this world (and not being under the "time gun") and could not solve it unless Apple changes something in future iOS releases which is unlikely.
The closest you could get to it is to record the screenshot of ObjC app before it launches Xamarin.iOS app, send it some way to Xamarin app (the best way would be if they could be the same App Group), put empty splash screen and ensure that it displays just a split of the second and then display your screenshot in the Xamarin app and do whatever you want to do.

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.

Instruments is not running my iOS application properly?

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?

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