I need help, I need to populate a tableview with objects from my array... I may be using some methods from mac code (lol). I just need some help. Here is my header and implementation files, thanks.
#import <UIKit/UIKit.h>
@interface Chuck_FactsViewController : UIViewController {
IBOutlet UITableView *tableView;
NSMutableArray *chuckJokes;
}
- (IBAction)newView:(id)sender;
@end
@implementation Chuck_FactsViewController
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Release anything that's not essential, such as cached data
}
- (void)dealloc {
[super dealloc];
chuckJokes = [[NSMutableArray alloc] init];
}
- (id)init {
[super init];
return self;
}
-(void)awakeFromNib {
chuckJokes = @"joke 1", @"joke 2", nil;
}
- (IBAction)newView:(id)sender {
}
- (NSInteger)numberOfSections:(NSInteger)row {
return [chuckJokes count];
}
- (id)tableView:(UITableView *)tv row:(int)row {
NSString *v = [chuckJokes objectAtIndex:row];
return v;
}
@end
Sorry, I'm an idiot. Some of this may not make sense
Thanks