Beginning Storyboards in iOS 5 Part 1
Re: Beginning Storyboards in iOS 5 Part 1
That was exactly what the problem was related to. I had typed "Player Cell" instead of "PlayerCell". I am extremely impressed with the amount of support you offer for your tutorials and to blog readers. Because of this, I'm definitely going to buy your book because it's obvious the authors care about their readers. I have the Cocos2D book, looks like it's time to add iOS5 to the collection as well. 
- gfresh
- Baby Hacker
- Posts: 8
- Joined: Sun Oct 16, 2011 12:29 pm
- Has thanked: 0 time
- Been thanked: 0 time
Re: Beginning Storyboards in iOS 5 Part 1
Cool, gfresh. We're here to help. 
-

Hollance - iOS Tutorial Team Member
- Posts: 3302
- Joined: Wed Mar 09, 2011 8:33 pm
- Location: The Netherlands
- Has thanked: 0 time
- Been thanked: 255 times
Re: Beginning Storyboards in iOS 5 Part 1
Great tutorial. Thank you very much.
- Cal
- Hacker
- Posts: 16
- Joined: Thu Jul 14, 2011 12:06 am
- Has thanked: 0 time
- Been thanked: 0 time
Re: Beginning Storyboards in iOS 5 Part 1
In the following code why did you use delegates when you could simply dimiss the controller from right within the controller.
Another question is that why do you add the new player at a particular index instead of just reloading the tableView data:
Instead of the following:
We can do this:
Maybe reloadData is not good for performance!
- Code: Select all
-(IBAction)cancelButtonAction:(id)sender
{
NSLog(@"cancelButtonAction");
[self dismissViewControllerAnimated:YES completion:nil]; // this also works
//[self.delegate playerDetailsViewControllerDidCancel:self]; // why use delegates
}
-(IBAction)doneButtonAction:(id)sender
{
[self dismissViewControllerAnimated:YES completion:nil];
//[self.delegate playerDetailsViewControllerDidSave:self];
}
Another question is that why do you add the new player at a particular index instead of just reloading the tableView data:
Instead of the following:
- Code: Select all
- (void)playerDetailsViewController: (PlayerDetailsViewController *)controller
didAddPlayer:(Player *)player
{
[self.players addObject:player]; NSIndexPath *indexPath =
[NSIndexPath indexPathForRow:[self.players count] - 1 inSection:0];
[self.tableView insertRowsAtIndexPaths: [NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationAutomatic]; [self dismissViewControllerAnimated:YES completion:nil];
}
We can do this:
- Code: Select all
-(void) playerDetailsViewController:(PlayerDetailsViewController *)controller didAddPlayer:(Player *)player
{
[self.players addObject:player];
[self.tableView reloadData];
[self dismissViewControllerAnimated:YES completion:nil];
}
Maybe reloadData is not good for performance!
- azamsharp
- n00b
- Posts: 4
- Joined: Thu May 12, 2011 2:23 pm
- Has thanked: 0 time
- Been thanked: 0 time
Re: Beginning Storyboards in iOS 5 Part 1
azamsharp wrote:In the following code why did you use delegates when you could simply dimiss the controller from right within the controller.
You are correct that in this case using a delegate isn't strictly necessary. Most of the time, however, you have data to send back to the presenting view controller and I wanted to drive home the point that delegates are the way to do that.
-

Hollance - iOS Tutorial Team Member
- Posts: 3302
- Joined: Wed Mar 09, 2011 8:33 pm
- Location: The Netherlands
- Has thanked: 0 time
- Been thanked: 255 times
Re: Beginning Storyboards in iOS 5 Part 1
azamsharp wrote:Another question is that why do you add the new player at a particular index instead of just reloading the tableView data:
Because it gives us a nice animation.
-

Hollance - iOS Tutorial Team Member
- Posts: 3302
- Joined: Wed Mar 09, 2011 8:33 pm
- Location: The Netherlands
- Has thanked: 0 time
- Been thanked: 255 times
Re: Beginning Storyboards in iOS 5 Part 1
This is very sweet! I'd love to adapt my current app-in-progress to use Storyboards rather than continuing on with the iOS 4 way of doing it... any tips on doing so? Can one suck the .xib file contents into views in the Storyboard?
Janene
Janene
- jpappas
- Baby Hacker
- Posts: 6
- Joined: Thu Oct 13, 2011 12:52 am
- Has thanked: 0 time
- Been thanked: 0 time
Re: Beginning Storyboards in iOS 5 Part 1
jpappas wrote:Can one suck the .xib file contents into views in the Storyboard?
There are some tips in the second chapter that is only in the ebook, but you can create a new view controller in the storyboard, remove its view, and copy-paste the contents of your xib into the view controller. You may need to re-connect things, though.
-

Hollance - iOS Tutorial Team Member
- Posts: 3302
- Joined: Wed Mar 09, 2011 8:33 pm
- Location: The Netherlands
- Has thanked: 0 time
- Been thanked: 255 times
Re: Beginning Storyboards in iOS 5 Part 1
Hollance wrote:There are some tips in the second chapter that is only in the ebook, but you can create a new view controller in the storyboard, remove its view, and copy-paste the contents of your xib into the view controller. You may need to re-connect things, though.
I had my mouse hovering over the Buy Now button... guess I'll press it
- jpappas
- Baby Hacker
- Posts: 6
- Joined: Thu Oct 13, 2011 12:52 am
- Has thanked: 0 time
- Been thanked: 0 time
Re: Beginning Storyboards in iOS 5 Part 1
I know this doesn't relate to Storyboards per se, but, following the tutorial, I realised that in the Player class there are no ivars.
I tried a bit of debugging but found out that I cannot see the contents of the Player object using the inspector.
Any ideas on how I can view them?
A tip on what to search for or pointers to docs would be great too, given that I exhausted my google-fu and couldn't produce a good search query
I tried a bit of debugging but found out that I cannot see the contents of the Player object using the inspector.
Any ideas on how I can view them?
A tip on what to search for or pointers to docs would be great too, given that I exhausted my google-fu and couldn't produce a good search query
- nameghino
- n00b
- Posts: 3
- Joined: Mon Oct 17, 2011 11:50 pm
- Has thanked: 0 time
- Been thanked: 0 time
Who is online
Users browsing this forum: funkyboy, Google Adsense [Bot], rwenderlich and 5 guests