ios逆向-theos編譯問(wèn)題

問(wèn)題一:

在make編譯時(shí)可能會(huì)出現(xiàn)以下錯(cuò)誤,原因是self在此處會(huì)被認(rèn)為是id類型,而numberOfSectionsInTableView方法屬于FindFriendEntryViewController的方法,如果不對(duì)FindFriendEntryViewController進(jìn)行前向聲明,是無(wú)法調(diào)用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;

解決辦法:

/* 對(duì)FindFriendEntryViewController及numberOfSectionsInTableView方法做前向聲明。
 * 否則無(wú)法調(diào)用[self numberOfSectionsInTableView:]方法
 */
@interface FindFriendEntryViewController

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

@end
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。