This question already has an answer here:
ios - why does my UITableView not get populated with comments
(1 answer)
Closed 9 years ago.
I am getting a list of some ShoppingLists through a WCF call.
My code:
#import "ListTableViewController.h"
#import "ListServiceSvc.h"
#interface ListTableViewController (){
// NSMutableArray *shoppingLists;
}
#property (nonatomic, retain) NSMutableArray *shoppingList;
#end
#implementation ListTableViewController
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
_shoppingList = [NSMutableArray array];
[self loadListsFromRemoteServer];
[super viewDidLoad];
}
-(void) loadListsFromRemoteServer
{
NSString *uname = #"Test4";
NemListBinding *binding = [[ListServiceSvc NemListBinding]initWithAddress:#"http://balder.ucn.dk/dm76_gr5/WCF.ListService.svc/custom?singleWsdl"];
binding.logXMLInOut=YES;
ListServiceSvc_GetShoppingListsWithUname *parms = [[ListServiceSvc_GetShoppingListsWithUname alloc]init];
parms.uname = uname;
[binding GetShoppingListsWithUnameAsyncUsingParameters:parms delegate:self];
}
- (void) operation:(NemListBindingOperation *)operation completedWithResponse:(NemListBindingResponse *)response
{
NSArray *responseHeaders = response.headers;
NSArray *responseBodyParts = response.bodyParts;
//[NSThread sleepForTimeInterval:5.0];
NSMutableArray *shoppingListFromWebserver = [[NSMutableArray alloc] init];
// step 1 fill in the blanks.
for(id header in responseHeaders) {
// here do what you want with the headers, if there's anything of value in them
}
for (id mine in responseBodyParts)
{
if ([mine isKindOfClass:[ListServiceSvc_GetShoppingListsWithUnameResponse class]])
{
for (id slist in [[mine GetShoppingListsWithUnameResult] ShoppingList])
{
[shoppingListFromWebserver addObject:slist];
NSLog(#"new list :: RESPONSE FROM SERVER :: nList %#", [slist ShoppingListName]);
//self.result.text = [self.result.text stringByAppendingString:[slist shoppingListName]];
}
}
}
[self performSelectorOnMainThread:#selector(updateNewView:) withObject:shoppingListFromWebserver waitUntilDone:NO];
}
-(void) updateNewView:(NSMutableArray*) result
{
_shoppingList = result;
NSLog( #"new list - number of news :: %u", [_shoppingList count]);
[self.tableView reloadData];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
//{
// return _shoppingList.count;
//}
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
//{
// // Return the number of rows in the section.
// return 10;
//}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(#"cellforrow");
static NSString *CellIdentifier = #"ListCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
//cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
// Configure the cell...
id shopList = [_shoppingList objectAtIndex:indexPath.row];
cell.textLabel.text = [shopList ShoppingListName];
return cell;
}
Nothing happens when i run the app in Xcode. I can see in the log window that the log
NSLog( #"new list - number of news :: %u", [_shoppingList count]);
does return a value (4), but the NSLog i have made in the CellForRowAtIndexPath method does not get printed. I also have a breakpoint in there, that isn't reached. Why is it not getting to the method?
These methods, numberOfSectionsInTableView and numberOfRowsInSection are important to determine what number of data the TableView should show.. it should look something like this:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1; // the number of different sections in your table view
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [_shoppingList count]; // the number of data in your shopping list
}
You should not comment out these methods: numberOfSectionsInTableView and numberOfRowsInSection.
At least numberOfRowsInSection is required and must return the number of rows you want/need.
As far as I got it, this should be _shoppingList.count in your case.
because you commented out these methods: numberOfSectionsInTableView and numberOfRowsInSection, your tableView would be 0 section and 0 row,so the method
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
did not be accessed.
Related
Hi when I do for loop to get all documents from a collection. I add the car object to the NSMutablearray and when I debug i can see that the objects are being added to the array but when i want it to display in the table and get the count of the array I call the [self.mycars count] to get the count but the count is nil and i cant get information from the cell.textLabel.text = vehicle.name; so what am i doing wrong.
#import "TableViewController.h"
#import "Car.h"
#import "Vehicle.h"
#interface TableViewController ()
#end
#implementation TableViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
self.db = [FIRFirestore firestore];
self.myCars = [[NSMutableArray alloc] init];
[[[[self.db collectionWithPath:#"users"] documentWithPath:[FIRAuth auth].currentUser.uid]
collectionWithPath:#"cars"] getDocumentsWithCompletion:^(FIRQuerySnapshot *snapshot, NSError *error) {
if (error != nil) {
NSLog(#"Error getting documents: %#", error);
} else {
for (FIRDocumentSnapshot *document in snapshot.documents) {
NSLog(#"%# => %#", document.documentID, document.data);
Car *car = [[Car alloc] initWithCarName:[document valueForField:#"carname"] andCarStyle:[document valueForField:#"carstyle"]
andCarColour:[document valueForField:#"colour"] andCarYear:[document valueForField:#"caryear"]
andCarDoors:[document valueForField:#"doors"] andCarSeat:[document valueForField:#"seat"] andCarWheels:[document valueForField:#"wheels"]
andCarTankCapacity:[document valueForField:#"tankcapacity"] andCarHorsePower:[document valueForField:#"horsepower"] andCarModelName:[document valueForField:#"modelname"]];
NSLog(#"Car name:%#", car.name);
[self.myCars addObject:car];
}
}
}];
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [self.myCars count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"cellidentifier" forIndexPath:indexPath];
// Configure the cell...'
Vehicle *vehicle = [self.myCars objectAtIndex:indexPath.row];
cell.textLabel.text = vehicle.name;
return cell;
}
#end
You need to reload data manually after changing/updating your datasource (self.myCars in this case) which mean you need to add [self.tableView reloadData]; after for loop. If it still is not working, you might want to check if self.myCars is initialized yet.
I've hardcoded all of the titles of my cells, and am looking to link each individual cell to a different blog post. The section titles are my keys, and the values are an array of the information pertaining to the title. How would I go about this? I'm a bit confused because due to the fact I have sections, the row selected number restarts as I begin the next section. There's some code involving a search bar so disregard that. An example would be so helpful!
#interface InfoTableViewController () {
NSDictionary *names;
NSArray *sectionTitles;
}
#end
#implementation InfoTableViewController {
NSArray *items;
NSArray *searchResults;
}
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
names = #{#"Green Manual" : #[#"Basic Rules", #"Pledge Mom Interview", #"Pledge Class Song", #"Code of Conduct", #"History of XXX", #"Founding Sisters of XX", #"Inter-Chapter Council", #"General Facts", #"Crest of XXX", #"Sister of Mine", #"Greek Alphabet", #"Delta Chapter History",#"Actives", #"Associates, Recessives, Retired Actives, Inactives", #"Alumnae", #"Family Tree"],
#"Interviews" : #[#"Alyson Au", #"Jazzmin Boo", #"Shuki Chan", #"Ivy Cheng", #"Julie Ha", #"Jenny Hong", #"Linde Huang", #"Erica Jon", #"Jenny Lau", #"Jean Lin", #"Vivian Lo", #"Jackie Nguyen", #"Nhi Nguyen", #"Sarah Pham", #"Jasmine Ta", #"Diane Tran", #"Joyce Wong", #"Kathie Wong", #"Jennifer Xu"]};
sectionTitles = [[names allKeys] sortedArrayUsingSelector:#selector(localizedCaseInsensitiveCompare:)];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return [sectionTitles count];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSString *sectionTitle = [sectionTitles objectAtIndex:section];
NSArray *sectionNames = [names objectForKey:sectionTitle];
return [sectionNames count];
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
return [sectionTitles objectAtIndex:section];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath*)indexPath
{
//static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"Cell" forIndexPath:indexPath];
NSString *sectionTitle = [sectionTitles objectAtIndex:indexPath.section];
NSArray *sectionNames = [names objectForKey:sectionTitle];
NSString *name = [sectionNames objectAtIndex:indexPath.row];
cell.textLabel.text = name;
NSLog(#"Row selected: %d", indexPath.row);
return cell;
}
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:#"name BEGINSWITH[cd] %#", searchText];
searchResults = [items filteredArrayUsingPredicate:resultPredicate];
}
-(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
{
[self filterContentForSearchText:searchString
scope:[[self.searchDisplayController.searchBar scopeButtonTitles]
objectAtIndex:[self.searchDisplayController.searchBar
selectedScopeButtonIndex]]];
return YES;
}
I assume you are trying to select a cell and detect that in order to move to a different controller, which then would display some of your content.
Even though you have
NSLog(#"Row selected: %d", indexPath.row);
in your method
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath*)indexPath
That's not the method that actually detects a cell selection. You should use:
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
which is a method from TableViewDelegate, and not TableViewDataSource. Your controller needs to implement both. You also need to connect your tableView to your delegate, in this case, your own controller.
Try NSLogging inside didSelectRowAtIndexPath method to track your selection and further push a new controller, or perform a Storyboard Segue.
I am using MapKit and I'm trying to retrieve a list of nearby places based on the users current location and after that, I am trying to display them in a TableView. However, when using the iOS simulator, no places show up. I went to simulator->debug->location->Apple so shouldn't results pertaining to THAT location show up? I'm confused. Here is my code:
- (void)viewDidLoad
{
[super viewDidLoad];
//[self CurrentLocationIdentifier];
[self performSearch];
_m= [MKMapItem mapItemForCurrentLocation];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Table view data source
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return _places.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"placeCell";
PlaceTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
long row = [indexPath row];
cell.placeLabel.text = _places[row];
return cell;
}
-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
[super tableView:tableView didDeselectRowAtIndexPath:indexPath];
int rowNo = indexPath.row;
_place = [_places objectAtIndex:rowNo];
}
- (void) performSearch {
MKLocalSearchRequest *request =
[[MKLocalSearchRequest alloc] init];
request.naturalLanguageQuery = _m.name;
_places = [[NSMutableArray alloc] init];
MKLocalSearch *search =
[[MKLocalSearch alloc]initWithRequest:request];
[search startWithCompletionHandler:^(MKLocalSearchResponse
*response, NSError *error) {
if (response.mapItems.count == 0)
NSLog(#"No Matches");
else
for (MKMapItem *item in response.mapItems)
{
NSString *n = item.name;
[_places addObject:n];
}
}];
}
#end
You need to add a bunch of log statements and look at what is displayed in the console (or add breakpoints and use the debugger, but I'm guessing you don't know how to do that.
Add a log statement at the beginning of your performSearch that displays the _m.name that you are using as your search string. Add a log to the top of your completion handler so you know that it's called.
Okay so for some reason the results started appearing after I changed the type of "row" in cellForRowAtIndexPath from long to int and instead of [indexPath row], I changed it to indexPath.row
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
Hey guys I am using Hpple to get some data from the web and display it in a table view. I am using the code from ray wenderlich. The source code is available at the bottom of this page http://www.raywenderlich.com/14172/how-to-parse-html-on-ios. Then this is the website I am using to get the data http://ueat.site88.net/output.xml. And here is my xPathQuery
//day[#name='monday']/meal[#name='LUNCH']/counter[#name='Entrée']/dish/name.
It gets the info if I NSLog what should go in the table view
Tutorial *thisTutorial = [_objects objectAtIndex:indexPath.row];
NSLog(#"%#", thisTutorial.title);
cell.textLabel.text = thisTutorial.title;
but then it doesn't appear in the table view, I know the nodes are not nil.
Heres the code for where it display the data
#import "MasterViewController.h"
#import "DetailViewController.h"
#import "TFHpple.h"
#import "Tutorial.h"
#import "Contributor.h"
#interface MasterViewController () {
NSMutableArray *_objects;
NSMutableArray *_contributors;
}
#end
#implementation MasterViewController
#synthesize detailViewController = _detailViewController;
- (void)loadTutorials {
// 1
NSURL *tutorialsUrl = [NSURL URLWithString:#"http://ueat.site88.net/output.xml"];
NSData *tutorialsHtmlData = [NSData dataWithContentsOfURL:tutorialsUrl];
// 2
TFHpple *tutorialsParser = [TFHpple hppleWithHTMLData:tutorialsHtmlData];
// 3
NSString *tutorialsXpathQueryString = #"//day[#name='monday']/meal[#name='LUNCH']/counter[#name='Entrée']/dish/name";
NSArray *tutorialsNodes = [tutorialsParser searchWithXPathQuery:tutorialsXpathQueryString];
// 4
NSMutableArray *newTutorials = [[NSMutableArray alloc] initWithCapacity:0];
for (TFHppleElement *element in tutorialsNodes) {
// 5
Tutorial *tutorial = [[Tutorial alloc] init];
[newTutorials addObject:tutorial];
// 6
tutorial.title = [[element firstChild] content];
NSLog(#"%#", tutorial.title);
// 7
tutorial.url = [element objectForKey:#"href"];
}
// 8
_objects = newTutorials;
[self.tableView reloadData];
}
/*
- (void)loadContributors {
// 1
NSURL *contributorsUrl = [NSURL URLWithString:#"http://www.raywenderlich.com/about"];
NSData *contributorsHtmlData = [NSData dataWithContentsOfURL:contributorsUrl];
// 2
TFHpple *contributorsParser = [TFHpple hppleWithHTMLData:contributorsHtmlData];
// 3
NSString *contributorsXpathQueryString = #"//ul[#class='team-members']/li";
NSArray *contributorsNodes = [contributorsParser searchWithXPathQuery:contributorsXpathQueryString];
// 4
NSMutableArray *newContributors = [[NSMutableArray alloc] initWithCapacity:0];
for (TFHppleElement *element in contributorsNodes) {
// 5
Contributor *contributor = [[Contributor alloc] init];
[newContributors addObject:contributor];
// 6
for (TFHppleElement *child in element.children) {
if ([child.tagName isEqualToString:#"img"]) {
// 7
#try {
contributor.imageUrl = [#"http://www.raywenderlich.com" stringByAppendingString:[child objectForKey:#"src"]];
}
#catch (NSException *e) {}
} else if ([child.tagName isEqualToString:#"h3"]) {
// 8
contributor.name = [[child firstChild] content];
}
}
}
// 9
_contributors = newContributors;
[self.tableView reloadData];
}
*/
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
self.title = NSLocalizedString(#"Master", #"Master");
}
return self;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self loadTutorials];
// [self loadContributors];
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
#pragma mark - Table View
- (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
switch (section) {
case 0:
return #"Tutorials";
break;
case 1:
return #"Contributors";
break;
}
return nil;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
switch (section) {
case 0:
return _objects.count;
break;
case 1:
return _contributors.count;
break;
}
return 0;
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
if (indexPath.section == 0) {
Tutorial *thisTutorial = [_objects objectAtIndex:indexPath.row];
NSLog(#"%#", thisTutorial.title);
cell.textLabel.text = thisTutorial.title;
cell.detailTextLabel.text = thisTutorial.url;
} else if (indexPath.section == 1) {
Contributor *thisContributor = [_contributors objectAtIndex:indexPath.row];
cell.textLabel.text = thisContributor.name;
}
return cell;
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
[_objects removeObjectAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
}
}
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (!self.detailViewController) {
self.detailViewController = [[DetailViewController alloc] initWithNibName:#"DetailViewController" bundle:nil];
}
NSDate *object = [_objects objectAtIndex:indexPath.row];
self.detailViewController.detailItem = object;
[self.navigationController pushViewController:self.detailViewController animated:YES];
}
Thanks for your help in advance
Your problem is simply that your first element contains new line characters. If you strip these out -
tutorial.title = [[[element firstChild] content]stringByReplacingOccurrencesOfString:#"\n" withString:#""];
then the table rows display correctly.
i am working on a Xcode 5.0.2 . i am following these lynda tutorials. the problem is i am not able to create section or groups of tableView as in one of the video.. i have changed table view to grouped too,but it is displaying only one section.
here is my code
#implementation ViewController {
NSDictionary *courseDetails;
NSArray *justCourseNames;
NSDictionary *webCourseDetails;
NSArray *webCourseNames;
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
}
-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
if(section==0) {
return #"iOS Courses";
} else {
return #"Web Courses";
}
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if(section==0) {
return courseDetails.count;
} else {
return webCourseDetails.count;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"cell"]; /
if(indexPath.section==0) {
cell.textLabel.text = justCourseNames[indexPath.row];
} else {
cell.textLabel.text = webCourseNames[indexPath.row];
}
return cell;
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSURL *url = [[NSBundle mainBundle] URLForResource:#"courses" withExtension:#"plist"];
courseDetails = [NSDictionary dictionaryWithContentsOfURL:url];
justCourseNames = courseDetails.allKeys;
NSURL *urlWeb = [[NSBundle mainBundle] URLForResource:#"courses_web" withExtension:#"plist"];
webCourseDetails = [NSDictionary dictionaryWithContentsOfURL:urlWeb];
webCourseNames = webCourseDetails.allKeys;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#end
I don't see anything wrong in the code provided. Just make sure you set the dataSource to your tableView. In storyboard the easiest way is to control-drag from the tableView to the ViewController in the object outline and select dataSource from the menu on release.
The issue was the simulator which wasn't populating all rows.
I have restarted the simulator and now it works fine.