I have an app that worked perfectly fine w/ ios 4.x
the app works like this
launch app
click button that launches camera
take pic
click use
this takes you to another screen where you can tag the photo
etc...
Now when i click use button the app just freezes, there is no crash, no debug message nothing. I have tried setting break points etc.. and I just dont know what else to try. Any help is greatly appreciated.
--thx
I post another answer to make the answer clearer.
I just found the ( simple ) solution to this problem:
I replaced:
[[[UIApplication sharedApplication] keyWindow] setRootViewController:self];
[[self parentViewController] dismissModalViewControllerAnimated:YES];
by:
[self dismissModalViewControllerAnimated:YES];
It worked on iOS 5 as it was working on iOS 4. I didn't test in iOS 4 yet but I think it's working similarily.
Please confirm me it's also working for you.
If it is freezing, without a crash, then you might be stuck in an infinite loop somewhere. As long as you are attached to the debugger when it is running, you can just pause the application while it is stuck, and it should give you some indication where it is getting held up.
Related
I'm building a testing app to see if I can get my app to work with remote control.
I followed the apple documentation for remote control event handling shown at:
https://developer.apple.com/library/IOS/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/Remote-ControlEvents/Remote-ControlEvents.html#//apple_ref/doc/uid/TP40009541-CH7-SW3
Right now I have a dummy app that has nothing but the function calls/implementations shown in that article.
I've put some print statements, and found out that
remoteControlReceivedWithEvent is never being called.
I've done some research, and I'm sure I didn't forget to implement
canBecomeFirstResponder
I even put a print statement in it.
When I press the play button on my apple earpod, it just plays a music from the music app and does nothing else.
Can anyone tell me what the problem is?
I'm using the latest version of iOS7
=============== Edit 1 ====================
I tested motion and touch event and they seem to be working fine.
It's just the remote controller.
I am testing backward compatibility of an app before submitting it to the app store.
iOS 5 devices run the app great, but now I'm testing on an old iPod touch with iOS 4.2.1.
What Goes Wrong:
At one point (always the same point), the app just hangs - it doesn't crash, just freezes so I'm thinking it's not a lack of memory causing it.
No errors are displayed, however following the code by setting breakpoints results in this line:
myWebView = [[UIWebView alloc] initWithFrame:webFrame];
running but never finishing.
So:
What might be going wrong, what can I do to further get more info/logs about what may be happening? Any ideas are much appreciated, thanks!
Make sure that you don't have duplicate entries like instance variable and property for "_myWebView" and "myWebView". Try to use _myWebView.
Try to remove assignment statement and see if it works then problem is duplicating ivar and property.
I ran into a problem lately. The UITapgesture working on simulator perfect and even while debugging directly on the device (iPhone 4, iOS 5.0.1) but when I package the app (Dep_Target iOS4.0m Base_SDK iOS5.1(latest)) for adhoc distribution and send it to client the gestures doesn't work. I then installed the build via test flight on the same device which I am using for debugging, the gesture doesn't work on it. I rechecked everything, I am using same build for distribution.
Any help will be much appreciated. Thanks
EDIT:
after doing a bit debugging it turns out that UITapgesture is not the culprit. The gesture method is getting fired but I've used a UIMenuController inside the gesture. The menu controller gets instantiated and all but not gets displayed on view. Besides the method:
- (BOOL) canPerformAction:(SEL)selector withSender:(id) sender
is not getting fired too. Do remember this all is happening in the build which is distributed via test flight, otherwise everything runs perfect.
I was getting this issue in one of my application and writing [self becomeFirstResponder] at the very first line in the function (i.e. before the line [[UIMenuController alloc] init]) solved my problem.
I have the following problem. When making this call inside a view controller :
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:#"http://www.youtube.com/user/mc1975mc1/videos?sort=dd&view=0&page=1"]]];
I am getting it correct in the simulator. see the following screen capture:
But when running on the device, I am getting to separated overlays. See the following pics:
The first one is the left part, the seond one is when starting scrolling while the last one is the second part.
Is it a bug? or there is a way to work around?
Thank you
OK.
This is defineitly Apple's bug.
I tested the code with an old 3gs phone and it works perfectly (line the pic of the simulator above).
I will report it to apple.
I downloaded the new iOS 6 and the problem solved.
Nobody talked to mee, not any help from apple. But at last it has been solved.
When I run this code in the Simulator in the debugger or standalone
[UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]
it tells me the camera is not available (returns NO), as expected.
However, if I run the same code in the simulator in Performance Tool, it returns YES! My code (which works fine on device) then continues to display the camera view in the simulator. If I attempt to capture an image though, I get a console message
photos can only be captured on HW
Which means that if I want to profile my application on the simulator (wouldn't it be nice if it worked on the device!!) I need to go change the code so that it displays the correct view (i.e. not the camera one!).
This does not, from googling, appear to be a well-known issue. Has anyone else experienced it and/or got a workaround?
The obvious workaround is to add an
#if TARGET_IPHONE_SIMULATOR
But that's just icky. The whole point of doing the isSourceTypeAvailable in the first place is to avoid that sort of thing.