Reputation: 1245
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'
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
Upvotes: 0
Views: 277
Reputation: 2374
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
. The same think happens on the other error, but with the method 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.
Upvotes: 1
Reputation: 8947
do you have a selector loadChapter without parameters?
aslo check if their declaration is included in interface file or not
Upvotes: 1