2012-04-26 4 views
0

) iPhone 개발 및 Objective-C에 익숙하지 않으므로 이미 질문을 받으면 실례합니다. 일부 코드를 작업하고 있으며이 오류는 계속 발생합니다. NSInteger가. 예상 그냥 대시와 스타 누락있는 것처럼예상 식별자 또는 '(NSInteger before 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 메서드는 메서드가 "인스턴스 메서드"인지 "클래스 메서드"인지 각각 나타내는 - 또는 + 앞에 와야합니다.