我是新的Objective-C编程。我来自C#背景。我遇到以下代码的问题,我正在撰写iPhone App的概念证明:UIViewerTableViewController.m:15:错误:'*'令牌之前的预期标识符
我收到了一些编译错误,但我认为它们都是由于第一个错误(可能是错误的) - 错误:'*'标记之前的预期标识符(@synthesize *列表;在.m文件中)
我不确定为什么我的代码显示它在编辑器下方的视图中显示的方式..任何方式,任何帮助将不胜感激。
.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