This section mainly introduces Segues,static table view cells and Add Player screen and a game picker screen.
Introducing segues
Open Main.storyboard Drag a bar Button item to the right of the players window navigation bar. Change the identifier to add in Attributes Inspector and A + button will appear.
When the user clicks, a modal window pops up to enter the details of the new player.
Drag a new navigation controller and then Ctrl+drag to connect the previous plus sign to the view controller. Select Modal.
This connection is known as Segue (Seg-way), which represents the transfer from one screen to another. By eating segue you do not need to write code for the display of the view room.
Run the code, click the plus sign, and a new page will appear.
Create a new Playerdetailsviewcontroller and set the class of the table view controller in the previous modal to Playerdetailsviewcontroller. Double-click Navigation bar to change the name to add Player. Add cacel and Done bar item.
The following modifications are made in the PlayerDetailsViewController.h:
#import <UIKit/UIKit.h>
@class Playerdetailsviewcontroller;
@protocol Playerdetailsviewcontrollerdelegater <NSObject>
-(void) Playerdetailsviewcontrollerdidcancel: (Playerdetailsviewcontroller *) controller;
-(void) Playerdetailsviewcontrollerdidsave: (Playerdetailsviewcontroller *) controller;
@end
@interface Playerdetailsviewcontroller:uitableviewcontroller
@property (nonatomic, weak) ID <PlayerDetailsViewControllerDelegater>delegate;
-(Ibaction) Cancel: (ID) sender;
-(Ibaction) Done: (ID) sender;
@end
Storyboards Tutorial (iii)