+(id)composeButtonItem;
@end
Then open LongPressableButtonItem.h, and see whether it implements
_sendAction:withEvent:.
@interface LongPressableButtonItem : UIBarButtonItem
{
id _longPressTarget;
SEL _longPressAction;
}
- (void)_attachGestureRecognizerToView:(id)arg1;
- (id)createViewForNavigationItem:(id)arg1;
- (id)createViewForToolbar:(id)arg1;
- (void)longPressGestureRecognized:(id)arg1;
- (void)setLongPressTarget:(id)arg1 action:(SEL)arg2;
@end
It doesn’t implement this method either, so let’s proceed to its super class. Open
UIBarButtonItem.h:
@interface UIBarButtonItem : UIBarItem <NSCoding>
......
- (void)_sendAction:(id)arg1 withEvent:(id)arg2;
......
@end
UIBarButtonItem does implement this method, so it’s UIKit that we should analyze. Drag
and drop the binary into IDA, since UIKit is big in size, it takes a rather long time to be analyzed.
During waiting time, how about dropping in http://bbs.iosre.com for a chat?
After the initial analysis of UIKit, let’s go to the implementation of [UIBarButtonItem
_sendAction:withEvent:], as shown in figure 6-19.
Figure 6-19 [UIBarButtonItem _sendAction:withEvent:]
The first function to be called is objc_msgSend. Its official documentation is:
“When it encounters a method call, the compiler generates a call to one of the functions
objc_msgSend, objc_msgSend_stret, objc_msgSendSuper, or objc_msgSendSuper_stret.
Messages sent to an object’s superclass (using the super keyword) are sent using