2012-05-06 10 views
0

私はgithubからサンプルプロジェクトをチェックしています。このエラーがクラスの1つにありますが、そこにはたくさんのクラスがありますが、このクラスでのみドアがあります。エラーです例えばメッセージの」受信機タイプ・ビュー・コントローラは、セレクタとメソッドを宣言しない 『loadChapter:forBook』iPhoneのARCの問題

エラーは、この方法で来て、

- (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; 
      ); 
} 

また、この方法は、このエラーにも

- (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; 
    } 
を有します

whaこのエラーが発生した理由は、エラーが表示されています。自動応答の問題です。

答えて

1

パラメータのないloadChapterがありますか?

その宣言はインターフェイスファイルか

+0

@このSaadにはインターフェイス宣言はありませんが、これはメソッドです - これはメソッドです - (void)loadChapter:(int)theChapter forBook:(int)theBook {...なぜインターフェイスで宣言する必要がありますか? – stackiphone

+0

あなたがこのメソッドにアクセスしているので、コンパイラは宣言していないのでこのメソッドについて知らないので、定義する必要がない場合は、変数のように後で使用するすべてのものをあらかじめ定義しておく必要があります。エラーを生成する、同じことがここにあります、ARCで、あなたはどちらかをインターフェイスで宣言するか、実装上で実装上で定義します。それはそのメソッドの上にあり、アクセスされています。 – Saad

+0

解決策があれば教えてください – Saad

1

エラーreceiver type view controller for instance message does not declare a method with selector 'loadChapter:forBook'に含まれているかどうかを確認asloは、コンパイラがselfのインタフェース宣言にメソッドloadChapter:forBook:を発見できないことを意味します。他のエラーでも同じ考えが発生しますが、方法はloadChapterです。したがって、おそらく問題はおそらくあなたがインターフェイス上でメソッドを宣言するのを忘れたか、あるいは同じ名前の2つのメソッドを宣言したことでしょう。