[英]ARC issue in iPhone sdk
i am checking a sample project from github an i got this error,,in one of the class,,there are many classes in it,,but i got door in this class only.the error is "receiver type view controller for instance message does not declare a method with selector 'loadChapter:forBook' 我正在从github检查一个示例项目我得到了这个错误,在其中一个类中,它有很多类,但我只在这个类门。错误是“接收器类型视图控制器实例消息不会使用选择器'loadChapter:forBook'声明一个方法
the error came in this method, 错误来自于这种方法,
- (void)displayBook: (int)theBook andChapter: (int)theChapter andVerse: (int)theVerse
{
[((PKRootViewController *)self.parentViewController.parentViewController ) showWaitingIndicator];
PKWait(//here i got this error
[self loadChapter:theChapter forBook:theBook];
//[self.tableView reloadData];
[self reloadTableCache];
[(PKHistory *)[PKHistory instance] addPassagewithBook:theBook andChapter:theChapter andVerse:theVerse];
[self notifyChangedHistory];
((PKSettings *)[PKSettings instance]).topVerse = theVerse;
if (theVerse>1)
{
[self.tableView scrollToRowAtIndexPath: [NSIndexPath indexPathForRow:theVerse-1 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO];
}
else
{
[self.tableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO];
}
UITabBarController *tbc = (UITabBarController *)self.parentViewController.parentViewController;
tbc.selectedIndex = 0;
);
}
and also this method have also this error 而且这种方法也有这个错误
- (void)loadChapter: (int)theChapter forBook: (int)theBook
{
// clear selectedVerses
selectedVerses = [[NSMutableDictionary alloc] init];
PKSettings *theSettings = [PKSettings instance];
theSettings.currentBook = theBook;
theSettings.currentChapter = theChapter;
//[theSettings saveCurrentReference]; -- removed for speed
[self loadChapter];//here i got the error,,in this case after selector'loadChapter;
}
what is the reason for this error,,in error showing window it shows,automaticReferenceCounting Issue 这个错误的原因是什么,错误显示它显示的窗口,automaticReferenceCounting问题
do you have a selector loadChapter without parameters? 你有没有参数的选择器loadChapter吗?
aslo check if their declaration is included in interface file or not aslo检查他们的声明是否包含在接口文件中
The error receiver type view controller for instance message does not declare a method with selector 'loadChapter:forBook'
means that the compiler can't found the method loadChapter:forBook:
on the interface declaration of self
. 错误
receiver type view controller for instance message does not declare a method with selector 'loadChapter:forBook'
意味着,编译器不能发现该方法loadChapter:forBook:
上的接口声明self
。 The same think happens on the other error, but with the method loadChapter
. 同样的想法发生在另一个错误上,但使用
loadChapter
方法。 So the problem probably is that you have forgot to declare the methods on the interface, or maybe that you have declare two methods with the same name. 所以问题可能是你忘了在接口上声明方法,或者你已经声明了两个具有相同名称的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.