I am making an app that has a view that show a table view.
PHP Code:
SampleTableDataSource = [[NSMutableArray alloc] init];
// Insert Section here
[SampleTableDataSource addObject:@"Cell 1"];
// Insert Section here
[SampleTableDataSource addObject:@"Cell 2"];
// Insert Section here
[SampleTableDataSource addObject:@"Cell 3"];
// Insert Section here
[SampleTableDataSource addObject:@"Cell 4"];
PHP Code:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 4;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [SampleTableDataSource count];
}
It is setup correctly because it shows the content but instead of showing 4 sections, it show everything 4 times. How do I do I add section because I heard it was different in iOS 5. Also I am using Automatic Reference Counting.