So yesterday i began learning iOS programming, and i followed the tutorial for the to-do app.https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/SecondTutorial.html#//apple_ref/doc/uid/TP40011343-CH8-SW1
I have created my own tablelistviewcontroller as the guide tells me, and all my previous static data is gone when i boot, and the tutorial tells me this
you’ll notice that it implements three methods—numberOfSectionsInTableView:, tableView:numberOfRowsInSection:, and tableView:cellForRowAtIndexPath:. You can get your static data to display again by commenting out the implementations of these methods. Go ahead and try that out if you like.
So i commented out the cellForRowAtIndexPath, it was the only one commented out. And then i got an error at the "reuseIdentifier", so after a time of googling, i have managed to name my cells "Cells" and i ended up with this code,
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cells";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
return cell;
}
But everytime i build and start the app, i cant see my previous data, i can see it in my storyboard, but not in app.. And now i am out of ideas and since i am a newbie i believe the solution is pretty easy.
Please notify if you need any additional data.