I'm having the most bizarre problem which I'm not even close to figuring out. I have a button which fires a delegate method. Once upon a time it was working fine, but after making some changes to my code, now the delegate method only fires after I push the button x amount of times (the changes I made to the code had nothing to do with the infrastructure that connects the delegate together). It varies, it can be 5 times to 10 times. I used the analyzer to check for memory leaks and there aren't any.
There is too much code for me to paste here (I don't even know where to start or where the problem could be), but I'm wondering if anyone has experienced this problem before, or what could be causing it? This is very odd and have no clue what could be causing it.
sounds like some other view is getting the touch events over the button. I've also seen this type of behavior when the touch area is too small (either because the button is too small or because it's getting clipped by another view)
Related
Hello I have a problem with UITableView freeze,
"downloadItem" below gets called when someone clicks on a button on the iPad. Its supposed to download a file and then return.
During the download, while stuck in that function, I want the UI to still be responsive, so I installed a runloop like below.
The actual downloadItem function is WAY more complicated than shown below, but what is shown is the basic idea of it. I know this isn't the best way, but for other reasons, I can't change it at this time, especially due to the existing complexity of the actual function.
The problem is that I also have a UITableView on the screen (as well as the button), if the UITableView is clicked or scrolled while in this function, in the runloop, the UITableView sometimes freezes up, and remains frozen even after exiting this function. This doesn't happen every time for some reason, maybe 40% of the time.
Does anyone know how to fix, is the RunLoop call below done right? Why when I click on the UITableView while in the runloop below, the table sometimes freezes up?
-(IBAction) downloadItem
{
BOOL downloading=TRUE;
callFunctionsToStartdownload(...);
while (downloading) {
downloading=DownloadSomeBytes(...);
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, YES);
}
}
thanks
In general, this seems unnecessary. You want the processing of downloaded bytes to be in a thread (which this does not address), but the actual asynchronous NSURLConnection should do its work in a thread (and then calls back to the thread that started it).
I came across the scenario where in if after moving the map immediately if I tap on back icon while the map has not fully loaded
The application crashes.
What I can understand is Since the loading is still in progress and I tap back the the application releases the controller but the google map loads asynchronously in NSRUNloop (not sure). So that might be the problem not sure though.
So does anybody know what can be the issue and is there any way to solve this issue?
Please comment if more description required.
It sounds like that when you close the view, the object that is the delegate for the completed map load has been deallocated, causing the crash with a bad access.
A good way to get to the bottom of these types of crashes is to use Instruments (part of the Xcode suite to tools) and go zombie hunting.
For anyone who is still searching for the answer
What exactly happening was that map view events were getting fired even if the controller was released causing a crash in the app.
So the solution is Before setting the value of objMKMapView to nil you need to set value of objMKMapView.delegate to nil.
This is so weird. I have been working on a series of iterations of the same application for almost 2 months, have not touched the code related to the view management in weeks, and this bug just appeared.
Basically I am at the root level view, i go to the last view in the stack by way of a "skip" type button. This page is used for settings. I then change some things (not related to the view hierarchy) and save, which takes me back to root. Then i try going to the first view in the stack.
Initially all of the textfields for the view are visible, but their uilabels are not. The view then slowly drifts to the right, revealing the same view with labels intact directly under it. I have never seen a bug like this before in over 2 years of iOS dev, so here I am.
The only code I have changed in the last week is related to web services and threading, nothing having to do with the view hierarchy.
If anyone has seen this bug before please help! Probably important as well, I have not seen this happen on the simulator, only on the actual device (iPad running 4.3.3)
Thanks!
Threading is the most likely culprit: making UI calls anywhere other than the main thread can cause any number of strange problems. Make sure anything you do to the UI, even a -popViewControllerAnimated:, is wrapped in a -performSelectorOnMainThread:withObject:waitUntilDone: or an appropriate dispatch_async(dispatch_get_main_queue(), ^{...}) call.
I'm programming an application for iPhone. My application has a login system. In the login system (and somewhere around my app) I have some placeholder in the UITextFields.
After a couple of months working on this app, I noticed a sudden problem that arose once. If I don't write in the text fields that have placeholders nothing happens, if I write something in them, the blue bar that blinks showing where you are in the text becomes very slow. Moreover the ScrollViews that I have become EXTREMELY slow. Some other strange behavior happens when I have a wheel that lets the user pick some choice: the options of the wheel "fall" from the sky while the user rolls it.
All of this happens only if I write something in a UITextField that has some placeholder. If not, nothing of this happens.
I know this sounds REALLY strange, I used a MacOSX program to create a video of the text field becoming slow.
It's .swf.
try to do one thing.. delete this textfiled and create a new one with different name and see is this problem occurring again? also try to set breakpoints in your code and debug your code.
Are you sure you aren't leaking any memory or running an endless loop on the cpu? Try monitoring your app with Instruments and check your cpu activity and memory allocations.
I have a 3 component dependent picker and I had it working fine until I noticed a strange behavior. If I spin component 1 and then click down with mounse on Conmponent 2, then wait for Component 1 to stop spinning then let the mouse button up, all without moving the mouse or picker wheel at all... didSelectRow does not get called at all!!! Has anyone else seen this behavior and found a work around???
Thanks
Users will use fingers and not mouse :)
You should prefer testing these kinda things on device..
Have you already seen What happens on the device?
It looks like
pickerView:didSelectRow:inComponent:
only gets called once regardless of how many components there are. Seems missleading to me but if you're spinning more than one component, you'll have to cycle through them, calling
pickerView selectedRowInComponent:
for each, regardless of which component gets passed to the method.