2012-04-26 4 views
0

私はiPhoneの開発とObjective-Cの新機能ですので、これは既に質問されています。 NSIntegerが期待される前に「(」私に期待される識別子を伝えるポップアップか。あなただけのダッシュと星が欠けているようNSIntegerの前に識別子または '('を付けてください。

#import "tableTutViewController.h" 


@implementation tableTutViewController; 

(NSInteger)tableView:(UITableView)tableView numberOfRowsInSection:(NSInteger)section{ 
    return tutorials.count; 
} 

- (void)viewDidLoad { 
    NSString * theFile = [[NSBundle mainBundle] 
          pathForResource:@"TPL" ofType:@"plist"]; 
    tutorials = [[NSArray alloc] initWithContentsOfFile:theFile]; 
    [super viewDidLoad]; 
} 

- (void)didReceiveMemoryWarning { 
    // Releases the view if it doesn't have a superview. 
    [super didReceiveMemoryWarning]; 

    // Release any cached data, images, etc that aren't in use. 
} 

- (void)viewDidUnload { 
    // Release any retained subviews of the main view. 
    // e.g. self.myOutlet = nil; 
} 

- (void)dealloc { 
    [super dealloc]; 
} 

@end 

答えて

2

が見える。

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 
    return tutorials.count; 
} 
+0

これは、私がメソッドのパラメータとしてオブジェクトを使用することができないということを私に伝える別のエラーを与えます。 – user1359673

+0

心配しないで、素早い返事をいただきありがとうございました。 – user1359673

+1

答えを正解とマークする – Mario

4

を使用すると、エラーが表示されている意味場合このメソッド定義の場合:

(NSInteger)tableView:(UITableView)tableView numberOfRowsInSection:(NSInteger)section 
{ 
    return tutorials.count; 
} 

最初に(NSInteger)の前に-が見つからないのが理由です。

すべてのObjective-Cメソッドは、メソッドが「インスタンスメソッド」か「クラスメソッド」かを示す-または+のいずれかでそれぞれ前に付ける必要があります。

関連する問題