2010-04-21 3 views
0

objective-C 프로그래밍을 처음 접했습니다. C# 배경에서 왔습니다. 나는 아이폰 앱에 대한 개념 증명을 위해 글을 쓰고있는 다음 코드에 문제가있다.UIViewerTableViewController.m : 15 : 오류 : '*'토큰 앞에 식별자가 필요합니다.

많은 컴파일 오류가 발생하지만 처음 오류가 발생했다고 생각한다. 오류 : '*'토큰 앞의 예상 식별자 (.m 파일의 @synthesize * lists)

내 코드가 편집기 아래의보기에 나타나는 이유는 확실하지 않습니다. 방법, 어떤 도움을 주시면 감사하겠습니다.

하는 .m 파일

// 
// Created by Aaron Levin on 4/19/10. 
// Copyright 2010 RonStan. All rights reserved. 
// 

#import "UIViewerTableViewController.h" 

@implementation UIViewerTableViewController 

@synthesize *lists; 
@synthesize *icon; 

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

#pragma mark Table View Methods 

//Customize number of rows in table view 

- (NSInteger)tableView:(UITableView *) tableView numberOfRowsInSection: (NSInteger) section{ 

return self.Lists.Count; 
} 

//Customize the appearence of table view cells 

- (UITableViewCell *) tableView(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *) indexPath{ 

static NSString *CellIdentifier = @"Cell"; 

UITableView *Cell = [tablevView dequeueReusableCellWithIdentifier:CellIdentifier]; 

if(cell == nil){ 

    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 
} 

cell.textLabel.text = [[self.Lists objectAtIndex:indexPath.row] retain]; 

cell.imageView = self.Icon; 

cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 

} 

@end 

.H 파일

// 
// UIMyCardsTableViewController.h 
// MCS ProtoType v0.1 
// 
// Created by Aaron Levin on 4/19/10. 
// Copyright 2010 RonStan. All rights reserved. 
// 

#import <UIKit/UIKit.h> 

@interface UIViewerTableViewController : UITableViewController { 

NSArray *lists; 
UIImage *icon; 

} 

@property (nonatomic,retain) NSArray *lists; 
@property (nonatomic,retain) UIImage *icon; 

@end 

답변

4

@synthesize *lists;이는 것 같다 lists라고에 대한 액세스를 제공하고있는 개인 회원을 가정 @synthesize lists;

해야한다 위의 코드에서 true입니다.

PS - 편집기 툴바에서 '1010'버튼을 사용하거나 백틱으로 묶어 코드를 포맷 할 수 있습니다. 같은

0

당신은 @synthesize icon;

로 변경해야 @synthesize *icon; 마찬가지입니다
관련 문제