My app is Navigation based. UIBarButtonItem on it.
refreshstopButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self
action:@selector(refreshTapped)];
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
-[UIApplication sendAction:to:from:forEvent:];
I don't understand why. Sometimes my app crashes with very similar stacktrace as Crash on iPhone?
NOTE: I also tried UICatalog sample, I saw the same thing: clicking on the status bar triggers the "Back" UIBarButtonItem action (using simulator).
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.
However the crash problem remain unsolved. According to the stacktrace, looks like it's triggered by a touch of the status bar.
Here is the crash log:
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
I also tried to follow http://cocoawithlove.com/2009/05/intercepting-status-bar-touches-on.html to capture event on status bar. But as some other people pointed out, it no longer works in iOS 4.x