iPhone up no longer loads into device or emulater, just does nothing when i run it - iphone

When I try to run my app, it builds with no errors, but will not run.
At the top of the Xcode window it says “Attaching to golfflixlight” with a little animation underneath.
I let it run for 20 minutes and gave up, I'm stuck

This is a recurring scourge of Xcode. It is there to make our lives miserable. The solution is very elusive, and I have yet to read a single, coherent explanation what's happening.
Take a look at this SO question, it might give you some idea how to solve your conundrum. Personally, nothing works for me other than going to Edit Scheme, and setting the debugger to GDB. Good luck.

Related

iOS - App is using a lot of CPU while seemingly not doing anything

When I run my app in Xcode, xcode tells me it is constantly 35% of the CPU, even though it appears that nothing is happening. Nothing is suppose to be happening, so I am surprised by the CPU usage. There is obviously a loop in the code, but I need to figure out how to locate it.
I'm trying to figure out how to locate the loop, perhaps using instruments, but I don't really know where to begin.
Does anyone have any advice on how to attack this problem? I have hit the "pause" button in Xcode, but it of course pauses on the compiled stack (or whatever that screen with a bunch of Hex values is called).
Thanks!

Crash upon iPhone Simulator 5.0 startup

I'm making an iPhone RPG application, I was working on programming a CGPoint array to some sprites I wanted to add, but I didn't make any progress and thus deleted the code.
After this, an exception was thrown each time I ran the app' on the iPhone Simulator, it said it was to do with OpenAL, so I took all of the sound code out.
The project then ran fine on the iPhone Simulator, without sound though of course.
Now, upon taking all of my newly added code out, the iPhone Simulator crashes (freezes) when it's still on the Cocos2d load up screen and points to the following line of code in Xcode:
int retVal = UIApplicationMain(argc, argv, nil, #"AppDelegate");
I've been looking over my code with a fine-tooth comb for an hour now, checking in case I left any code in or changed anything, and I haven't.
Has anyone had any experience with this problem? Or can anyone give me an idea what might have happened?
Some light to shine on the OpenAL problem would be nice too (second time it's happened to me).
The best thing to do in situations such as these is put break points all over the place and look for the point at which the applications crashes from.
If you haven't yet check out the stack for any clues. Unfortunately if there is nothing on the stack or printed from the debugger this is really all you can do.
So I checked some other questions AGAIN, and found someone saying to restart the computer... This worked. It's annoying, so so annoying. But that's what worked.
Also, for any weird errors, just make sure you Product > Clean after adding/changing any resources you use.

Step by step iphone debugging on xcode shows nothing on screen

I realize it doesn't work because it needs to print on the screen, but...
Is there anyway and/or a good simple way to actually just press "step over" or "step into" and see the command output on the device/simulator screen?
I want to keep pressing it and be able to see what every step do on the screen as quick as possible, if that's even a possibility for iphone debugging.
I hope while short this question still is pretty clear and not a duplicate! :P
Sometimes the iPhone simulator UI is not refreshed immediately. The UI framework don't update the screen at each instruction. You can try a manual [myView setNeedDisplay:YES] (or something like that) after each step.
You could also look at CFRunLoop to try and force UI updates in different runloops, although that is about the extent of my understanding of the API.

iphone app only works first time on simulator

I've got an issue with my iphone App and i'm not sure if its an xcode project issue or a code issue (I'm leaning towards xcode project issue at the moment).
If I reset the iphone simulator and build and run my app it works fine. If I then do a build and debug again the app will crash straight away with no meaningful callstack. The app will continue to crash until I remove it and start again. I didn't previously have this issue which makes me think i've just changed some project setting recently by mistake.
Has anyone had this before or can anyone think or a reason for this issue?
Are you saving/retrieving state? Without any other details, that's the first area I'd look into. Also try setting breakpoints and debug to pinpoint the problem.
paul_sns is correct, try setting breakpoint on your AppDelegate class and step-over. Probably you're retreaving a state that is incorrect. You could also activate the debugging console (run the application in debug mode) to see where it crashes (the callstack).
OK I've finally got to the bottom of it. I had quite a lot of memory overwriting going on (a sizing issue with a 2d array) and this was why it wasn't giving me any useful information when it crashed. Thanks for all the help - am glad I stumbled upon the problem before I pulled all my hair out!

iPhone Bug App bug Question and challenge

Ok so I've got a really annoying bug in my app. It's driving me crazy and I'm sure it's beyond my skill level as I am learning as I go.
Here is the initial rundown of the bug: A shot in the dark - Application bug
However I have found a way to consistently reproduce the bug (only on the device not in the simulator)
First you create a new Pool and save it. Then add 20 blank time entires into one day. Save it and this is where the problems begin. (when you go back to the main detail view the tableview has put itself out of editing mode with being told to do so). Now if you go back to the day to see the time entries you just added they are still there.
If you go back to the main overall tableview listing all pools and now go back to the day you added the times they have dissapeared.
Add one time and it all saves fine. Add twenty and it doesn't save. WTF!!
Main Menu listing Pools:
Detail view:
Edit View:
Time Edit View:
Add a time:
I'd appreciate any more guesses. But as well as this question I'm offering a bounty of £25 (Sorry I'm a poor student) to whoever is good enough to fix this bug first!
if your interested my email is danmorgz[at]gmail.com
Thanks,
Dan
If you haven't already done so, I'd recommend turning on NSZombie support and seeing if you're using any of your objects after they've been freed. As far as I know this can be turned on in the simulator and on the device.
Most likely, you're failing to retain some object somewhere along the way. When an object gets released and then the memory is re-used for something else, you'll get all sorts of bad behavior, including crashes, or mysterious "disappearance" of other objects.
One thing you can try is putting breakpoints into the -dealloc method of your custom classes. Then you can see where they're getting deallocated from. Most likely though, this will end up being when the AutoreleasePool gets drained, which won't tell you much.
Alternatively, look into using some of the memory debugging tools built into Cocoa.
That document is for Mac OS X, but I think most all of this will work in the iPhone simulator, at least. I know that your bug "doesn't happen" in the simulator, but that really only means that the symptoms are different, and you're not noticing them.
Thanks for all your answers. It's now fixed.
For those interested I'd forgotten to add a cellidentifer in the XIB of my cell subclass.
cellForRow: method was therefore creating a new cell every time. The memory got filled up very quick. It then seemed as though my app was automatically trying to cut the fat by forcing another tableView out of editing mode and not managing my instances properly.
Again it's a memory problem. Isn't this always the case!?!
The clue was a one off 101 error in the console indicating my app was using too much memory. Oh and a slow scrolling tableView.