I am working on an iOS app in Xcode using Swift, and when I go to run the app in the simulator, it does not display as a normal simulation of the app that I am trying to run. The entire window is less than one inch by one inch, and shows what should be in the middle of the app. I ran it on my phone, and everything worked normally. Any insight into what may be going on? I'm developing the app using SpriteKit, if that provides and clues.
I have a bit of experience with iOS development, but I've never run into something like this before.
Edit: It only happens some of the time. I'm not sure, but I have a hunch that it is the result of some sort of race condition between GameScene and GameViewController
Cmd + 1 or Cmd + 2 should fix the size of the simulator (or Window -> Physical Size or Window -> Point Accurate).
Related
I've some issues with the Xcode 4 debugger. While it was working fine before, now I can't run more than 1 build before restarting my xcode. When I run a second build for example after changing some codes the debugger could take like 30 mins and more before showing "build succeeded!" with iphone simulator launch. And in such cases, pressing "stop" button does not stop debugger. So, I've to close xcode and start it again. Now, after many xcode restarts I'm fed up especially as I don't know why it happens. Any idea to help ?
the simulator could still be running, chewing up a large chunk of your CPU, interfering with the compile, and the app restart inside it. Stop your app in the simulator before re-compiling. There must be a way to configure that, but i dont know it. Hope that is your issue (i have had it).
ps. state your config next time (Dev box specifics, XCode version, simulated iOS version).
Trying to finish up an app I've been developing and have hit an odd bug that I'm not sure if it's on my end? a bug on apple's end? or perhaps the underpinnings of multitasking showing themselves.
My current app is doing this weird thing when you press the home button to quit the app, and then immediately relaunch the app. You see the Default.png image as the app starts up, but when it goes to display the window/view it briefly shows the screen as it was just before you quit the app, then goes to black for about 2 seconds and then displays the correct screen as if you were starting up fresh. I'm see this on all devices, iPods, iPhones, and iPad.
This is not just me, however, I've been trying other apps to see if they do it, and have found that the Air Hockey ( http://itunes.apple.com/us/app/air-hockey/id286106725?mt=8 ) is an example of an app that does this same thing. My instinct is that there are many apps that do. But the bulk of apps dont seem to have this issue.
I've done everything I can do make sure all views and view controllers are properly released, but it's almost like the device is taking a while to truly shut down even though the app has visually disappeared, and if you restart the app within probably 3 seconds or less then it still has something in the window buffer, or tht the full on view controller hasn't truly been released yet.
Anybody seen something like this and been able to solve it?
I'm the dev of that Air Hockey - It looks like it's probably Flurry that's causing it. I have a version without Flurry & it doesn't do it.
I solved this problem by updating my Flurry files to the latest version. http://dev.flurry.com/iphone_uploadNewVersion.do
Is there a way to programmatically set the iPad to run the iPhone app at 2x as it is launched (yet keep the iPhone app native). I understand I can create NIB files for each hardware platform, but for ease, I just would rather the app launch as if the user had tapped the 2x on the iPad. Thanks...R.J.
No. The pixel-doubling malarkey is not under your app's control, and is pretty much a crutch for apps that weren't designed for the iPad. If you didn't go nuts with specific pixel measurements in the original code, it shouldn't be difficult to move to the larger screen.
It's not quite program control, but you can get an app to start up in 2x mode on iOS 4.2.
I've had a couple of apps that have always started up in 2x mode, and very nice it was too, but I only worked out why this was today!
Steps:
Run iPhone app (e.g., from Xcode)
Use '1x' and '2x' buttons to select desired zoom level
Press home button to get back to launcher
Double tap home button to bring up task manager
Kill your app (hold finger down until icons start to dance, then press the '-' button on your app's icon)
(If you ran under the debugger in step 1, Xcode will tell you the program got a SIGKILL, and might stop somewhere random in the call stack; you can ignore this.)
Now next time you run the program, it will start up with the zoom level you selected in step 2!
I didn't test absolutely every method of closing the program, but this preference doesn't get saved if you stop it from Xcode (e.g., using Run|Stop menu item), and it doesn't get saved if your program terminates using exit. Closing it using the launcher is the only way I've found so far...
So I'm developing and iPhone game right now and everything has been working just fine when I test it on my first gen iPod touch. Last night, I added in some NSUserDefaults stuff to save a few variables for it. I ran it on the simulator a few times and it worked perfectly, but when I built the app and put it on my iPod, all I got when I launched it was a black screen. Anyone have any ideas? They would be much appreciated, thank you.
I recommend deleting the application from your iPod Touch first then trying to install it again. When are you trying to read from NSUserDefaults? In your applicationWillFinishLaunching call? If so, try to comment that out to ensure that it really is the source of your problem.
You need to run it on the iPod touch with the debugger switched on - you should be able to track this down.
Do you know about setting a breakpoint for exceptions - if you tell the debugger to break on objc_exception_throw it is extreemly useful in these cases.
Do you have a custom Default.png file? If no, then you will see a black screen while your application loads. Depending what type of (possibly unending) operations you are doing on load this might be the reason you are seeing a black screen. Remember the simulator runs on top of the processor in your mac which is significantly faster than the processor in your iPod Touch.
iPhone simulator is running on my Mac but it's not showing the simulator. Two days back I had installed the Mac OS X 10.5.6 update. Xcode is launching the aplication in simulator, and it's running, as I can see the outputs on the gdb console window. But the simulator is not shown.
Try to remove ~/Library/Preferences/com.apple.iphonesimulator.plist
Had the same issue. The simulator was running somewhere way off screen. Could see it using expose, but couldn't move it.
Rather than using "Detect Displays", which didn't work for me, I changed the screen resolution and that popped it back into place.
Have you previously had an external monitor connected? Perhaps Mac OS X saved the simulator window off-screen the last time it was run?
In the System Preferences, select Displays and click the "Detect Displays" button while the simulator is running. That should force the simulator window to appear on-screen.
Nothing worked except the good old IT joke, Turn it off & on again! (Completely restarting the whole machine worked for me).