ios逆向-theos编译问题

2020-07-16  本文已影响0人  Simple_Code

问题一:

在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
上一篇 下一篇

猜你喜欢

热点阅读