iPhone TableView Data Into 2 Sections
- by MrPink
Hello,
I am trying to get a tableview to split data i have in an array into sections...
I'm pretty new to this but below is my code snippet
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if(section == 0) {
contentArray = [[NSArray arrayWithObjects:@"Send SMS", @"Reports", nil] retain];
}
if(section == 1) {
contentArray = [[NSArray arrayWithObjects:@"Accounts", nil] retain];
}
return [contentArray count];
}
I have split the data successfully into the 2 sections but when populating the rows It just repeats the first content array in both sections.
Can any one help...
Thanks