I am moving my 3.x app to use iOS4 features like background processing, fast-app switching. I have been able to get the app running fine. But now whenever I launch the app on the simulator, it just shows a black screen. The app launches, status in XCode changes to running but nothing shows up other than the black screen.
The app runs fine on a device so I know there's nothing wrong with the code. Any idea what could be happening? I have tried reinstalling the SDK but it did not make a difference.
And yes, I have the [window makeKeyAndVisible]; line in the code. So that is not the issue. I am using application:didFinishLaunchingWithOptions: to handle the app launch.
Thanks.
I'm moving my app from 3.x to 4.x and have the same issue. Sound system is launched (music and sounds play well), but entire screen is black. It happens on 4.x simulator and device, but on 3.1.3 device everything seems well.
UPDATE: Recently i have added some window manipulations after application init:
[window center];
[window makeKeyAndVisible];
[window becomeFirstResponder];
and now it's alive =)
Some features do not work in the simulator, I know that when you try to access the iPod library in your app the simulator will just hang like this (it was this way back in 3.1 at least). Make sure you aren't using a feature that the simulator doesn't support.
Related
I have a tab based app that uses four tabs. The home tab is an MKMapView. When I load the app onto my iPhone and run from "Xcode" or "Instruments" there are no problems with crashing. However when I load the app onto my iPhone from iTunes or testflight.com it crashes whenever the MKMapView pans or zooms. Everything else in the app seems to work fine.
can you check the iOS version of simulator and device both? this might be happening due to some method or something else which might be not exist in the running version of iOS and your code might be calling that particular method.
You should debug your code while running on device and track the specific action as your were saying crashed happens when only the pan or zooming of mapview performed.
Hi I have an app that is working fine on iOS5, now running the app using iOS6 it freezes after it goes to the background and it goes back to the foreground, it no longer responds to touch events.
If I built it for 5.1 simulator works perfect, this only happend while running on iPhone 6.0 Simulator.
Any ideas?
EDIT WITH ANSWER:
It turns out the culprit was the TWTweetComposeViewController, which I use in my application.
I initialized TWTweetComposeViewController in my viewDidLoad function. Apparently, if you initialize but do not show the TWTweetComposeViewController, it will prevent your application from resuming. Check to see if you use this view controller and try removing it or not initializing it until you are going to show it.
Mario, I am having a similar, if not the same, problem. In my case, my app hits applicationWillEnterForeground correctly as it resumes from the background. However, the app seems to hang at this point and never reaches applicationDidBecomeActive. I am at a loss for why the app would never reach applicationDidBecomeActive. Like you, the app runs fine on iOS5 and below, but has this problem with iOS6.
Can you confirm that your app reaches applicationWillEnterForeground and doesn't hit applicationDidBecomeActive?
(I would write this as a comment to your question but I cannot seem to figure out how to do that.
When I run my app on the simulator, every time a white blank screen would be generated. but after I black iPhone button on the bottom to exit the app, the views will then be visible after you re-enter the app. then the app run as usual.
But the situation is different when I load it into my iPhone.
Only BLACK blank screen can be seen into the app. after I exit the app and re-enter it, still nothing can be seen, and the app would automatically exit, too.
I dunno why it would be like that as simulator just simulate the real iPhone.
Here is some information:
iOS version of my iPhone: iOS 5
XCode version: XCode 4.2
Hope someone can help me. Thanks a lot.
Make sure that your Base SDK is as high or higher than your current version. Change it in your target settings and your project settings. Also change your compiler to Apple LLVM and your debugger (under edit scheme) to LLDB.
I'm trying to get the following functionality in my iPhone app:
When backgrounded, stays running (doesn't have to do any background work)
When resumed, app picks up where it was left off
I'm mainly wanting the same screen on my app still up, as there are several UINavigationControllers within a UITabBarController.
I have done all of the following:
Made sure I'm compiling with 4.1 SDK
Set UIApplicationExitsOnSuspend to false
Handle DidEnterBackground and WillEnterForeground in my AppDelegate
Call BeginBackgroundTask in DidEnterBackground, to attempt to keep my app open
I'm using MonoTouch, but that it probably beside the point. I can take answers in Obj-C, for sure.
I've tested my app on a jailbroken phone with Backgrounder, and I see the "app in background" badge disappear immediately after pushing the home button. I also tried setting UIBackgroundModes in my Info.plist, but to no avail.
Is there anything I'm missing?
Or is this something I would have to implement on my own to resume the previous state of my app? Everywhere I've read talks like it should just work automatically.
If you don't want to be doing work in background, don't call beginBackgroundTask. That call is for situations where you want to do some kind of work in the background. And if you don't finish that work fast enough, iOS will terminate your app.
When I upgraded to iOS 4.x, my MT application started exhibiting this behavior without me having to do anything. iOS should take care of it for you.
I finally got in touch with someone on MonoTouch's irc.
In MonoDevelop there is an option to make a dual iPad/iPhone project, which I used. This is causing my app to behave as if it's running with the 3.2 SDK when deployed to the device.
I think my solution is to install the iOS 4.2 SDK that just came out, since this ads the new multi-tasking feature on iPad.
Not only do you need to support going into the background, you also need to support cases where your app has been terminated. In your app’s initialization code, you should resume the state that it was in. For instance, when you push a view controller, use NSUserDefaults to store a value for the currently-displayed screen, and then when you start read that value and display the associated screen.
I just upgraded my Mac to Snow Leopard, and installed Xcode 3.2.3.
The app I am working on ran perfectly before the upgrade.
Now, the default image appears briefly, then the screen goes black except for the status bar. Same behavior on my iPhone 4 and in the simulator, whether I target iOS 3.2 or 4.
The app is still running and I an see from traces and in the debugger that the app is running normally, and my root view controller has been loaded, but nothing but blackness on screen
Anyone seen this before?
Thanks
JK
Problem solved. I needed to add [window makeKeyAndVisible]; to my applicationDidLaunch method. Wonder why it worked before, with just the wired up XIB file???