书中问题 <寻找"编写邮件"的目标函数> MobileMail dump出headers中的UIBarButtonItem.h找不到[_sendAction:withEvent]

我参考第二版书中175页的进行操作时, 在我dump出的headers中, 有UIBarButtonItem-MobileMail.h文件, 但是打开它之后, 并没有找到[_sendAction:withEvent].

UIBarButtonItem-MobileMail.h 内容:
//
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//

#import “UIBarButtonItem.h”

@interface UIBarButtonItem (MobileMail)

  • (id)_mailBarButtonItemWithTitle:(id)arg1 style:(long long)arg2;
  • (id)mailBoldBarButtonItemFont;
  • (id)mailCancelBarButtonItem;
  • (id)mailDefaultBarButtonItemFont;
  • (id)mailDoneBarButtonItem;
  • (id)mailEditBarButtonItem;
  • (id)mailEditDoneButtonPossibleItemVariations;
    @end

你的iOS版本是多少?后续版本的iOS跟书上的细节很可能对不上了,你可以grep一下,看看_sendAction:withEvent在哪里

感谢你的回复.
我的手机是iPhone 6 Plus 系统是iOS9.3 , grep的结果如下

iPhone # sudo grep -r _sendAction:withEvent /
Binary file /System/Library/Caches/com.apple.dyld/dyld_shared_cache_arm64 matches
Binary file /System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv7s matches
Binary file /System/Library/Frameworks/UIKit.framework/UIKit matches

我是否要dump UIKit, 才能空中看到[Compose _sendAction:withEvent] ?

此外, 书中174页<寻找"编写邮件"的目标函数>所说的"在IDA找不到 [Compose _sendAction:withEvent] "后, 打开ComposeButtonItem.h 请问是从 MobileMail dump 出的 headers 中打开吗 ?

看样子是在UIKit里,你dump出来看看就知道了;
ComposeButtonItem.h在哪里我不记得了,你看看MobileMail中有没有不就知道了吗

MobileMail中dump出来有这个文件
UIBarButtonItem-MobileMail.h
和书中所说的
UIBarButtonItem.h
是同一个吗? 请问

这是class category啊

原来如此! 感谢回复! 是我没理解到位.

遇到了新的问题
Samsung-NoteBook-Pro:iPhone Dev chenchuxiong$ sudo class-dump -S -s -H /iPhone\ Dev/System/Library/Frameworks/UIKit.framework/UIKit -o /path/to/headers/UIKit
Password:
2017-07-06 17:44:24.200 class-dump[4047:851899] Warning: This file does not contain any Objective-C runtime information.

请问UIKit 要如何dump出来

runtime dump吧。
decache出来的我记得是有问题的

https://github.com/nst/RuntimeBrowser/