Note that there are some explanatory texts on larger screens.

plurals
  1. POcrash on touching the status bar
    primarykey
    data
    text
    <p>My app is Navigation based. UIBarButtonItem on it.</p> <pre><code>refreshstopButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshTapped)]; </code></pre> <p>I found when I tap on the status bar, "refreshTapped" gets triggered (not caused by my big finger, also reproducible by using simulator and mouse click). Stacktrace shows it comes from</p> <pre><code>-[UIApplication sendAction:to:from:forEvent:]; </code></pre> <p>I don't understand why. Sometimes my app crashes with very similar stacktrace as <a href="https://stackoverflow.com/questions/6032187/crash-on-iphone">Crash on iPhone?</a></p> <p>NOTE: I also tried UICatalog sample, I saw the same thing: clicking on the status bar triggers the "Back" UIBarButtonItem action (using simulator). </p> <p>After playing with the simulator for a while, i realized the sensitive area is much bigger than the button border. I think maybe that is the way Cocoa Touch works.</p> <p>However the crash problem remain unsolved. According to the stacktrace, looks like it's triggered by a touch of the status bar.</p> <p>Here is the crash log:</p> <pre><code>0 libobjc.A.dylib 0x32da1cb2 objc_msgSend + 42 1 UIKit 0x324c3a30 -[UIControl(Deprecated) sendAction:toTarget:forEvent:] + 28 2 UIKit 0x324c3990 -[UIControl(Internal) _sendActionsForEventMask:withEvent:] + 352 3 UIKit 0x32563764 -[UIControl mouseUp:] + 376 4 UIKit 0x3254d314 -[UIView(Internal) _mouseUp:] + 32 5 UIKit 0x3254a480 -[UIWindow _handleMouseUp:] + 108 6 UIKit 0x3254a8da -[UIWindow _statusBarMouseUp:] + 122 7 UIKit 0x32680980 -[UIStatusBar touchesEnded:withEvent:] + 320 8 CoreFoundation 0x328d056a -[NSObject(NSObject) performSelector:withObject:withObject:] + 18 9 UIKit 0x32406094 forwardMethod2 + 60 10 UIKit 0x324a04ca -[UIResponder touchesEnded:withEvent:] + 2 11 UIKit 0x32404bee -[UIWindow _sendTouchesForEvent:] + 362 12 UIKit 0x32404568 -[UIWindow sendEvent:] + 256 13 UIKit 0x323ed30c -[UIApplication sendEvent:] + 292 14 UIKit 0x323ecc4c _UIApplicationHandleEvent + 5084 </code></pre> <p>I also tried to follow <a href="http://cocoawithlove.com/2009/05/intercepting-status-bar-touches-on.html" rel="nofollow noreferrer">http://cocoawithlove.com/2009/05/intercepting-status-bar-touches-on.html</a> to capture event on status bar. But as some other people pointed out, it no longer works in iOS 4.x</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload