Hi all,
I am new here, I have one question:
If I have created table view and on the top I have navigation controller (and here is button for add row). But my class is uiviewcontroller (because I have tab bar too) and I have no class UITableViewController. So, I dont know, how to write code for the add action.
Here is my code:
@interface SettingsController : UIViewController {
NSMutableArray* clickerList;
IBOutlet UITableView *settingsTableView;
UINavigationController *navController;
}
@property (nonatomic,retain) NSMutableArray* clickerList;
@end
@implementation SettingsController
@synthesize clickerList;
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"Settings";
self.navigationItem.leftBarButtonItem = self.editButtonItem;
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle
"Add" style:UIBarButtonItemStyleBordered target:self action
selector (add];
self.navigationItem.rightBarButtonItem = addButton;
[addButton release];
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
}
- (IBAction)addid)sender
{
//Some code here
}
And then I have created normal tableView (specified its property and so on)
So, please, anyone know, how to do it?
Thank you a lot of
I am new here, I have one question:
If I have created table view and on the top I have navigation controller (and here is button for add row). But my class is uiviewcontroller (because I have tab bar too) and I have no class UITableViewController. So, I dont know, how to write code for the add action.
Here is my code:
@interface SettingsController : UIViewController {
NSMutableArray* clickerList;
IBOutlet UITableView *settingsTableView;
UINavigationController *navController;
}
@property (nonatomic,retain) NSMutableArray* clickerList;
@end
@implementation SettingsController
@synthesize clickerList;
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationItem.title = @"Settings";
self.navigationItem.leftBarButtonItem = self.editButtonItem;
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle
self.navigationItem.rightBarButtonItem = addButton;
[addButton release];
self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
}
- (IBAction)addid)sender
{
//Some code here
}
And then I have created normal tableView (specified its property and so on)
So, please, anyone know, how to do it?
Thank you a lot of