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