开发者

UIViewerTableViewController.m:15: error: expected identifier before '*' token

I am new to objective-c programming. I come from a C# background. I am having problems with the following code I am writing for a proof of concept for an iPhone App:

I am getting a number of compile errors but I think they are all due to the first error (could be wrong) - error: expected identifier before '*' token (@synthesize *lists; in the .m file)

I'm not sure why my code is showing up the way it is in the view below the editor..hmm any way, any help would be appreciated.

.m file

//
//  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 cellForRowAt开发者_运维百科IndexPath:(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 file

//
//  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


@synthesize *lists; should be @synthesize lists;

This assumes the private member you're providing access to is called lists which seems to be true for your code above.

PS - you can format your code using the '1010' button in the editor toolbar, or by enclosing in backticks.


same holds true for @synthesize *icon; You need to change it to @synthesize icon;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜