問(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