ios逆向-theos编译问题

问题一:

在make编译时可能会出现以下错误,原因是self在此处会被认为是id类型,而numberOfSectionsInTableView方法属于FindFriendEntryViewController的方法,如果不对FindFriendEntryViewController进行前向声明,是无法调用numberOfSectionsInTableView的。具体前向声明代码如上

Tweak.x:37:30: error: receiver type 'FindFriendEntryViewController' for instance
      message is a forward declaration
        if ([indexPath section] == [self numberOfSectionsInTableView:tab...
                                    ^~~~
Tweak.x:34:8: note: forward declaration of class here
@class FindFriendEntryViewController;

解决办法:

/* 对FindFriendEntryViewController及numberOfSectionsInTableView方法做前向声明。
 * 否则无法调用[self numberOfSectionsInTableView:]方法
 */
@interface FindFriendEntryViewController

- (long long)numberOfSectionsInTableView:(id)tableView;

@end
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。