Reputation: 510
I can't understand the storyboards in xcode 5. I'm searching for the answers by doing manuals but nothing works, even simple storyboard scenes. Almost all of the manuals are on xcode 4.x, but I work in the fifth. As I understand there are some differences between the implementation of scenes in the xcode 4 and 5. I can't understand at all the principle of storyboards, and therefore do not understand why nothing works. Please help me to understand the difference between the xib and storyboard. What is the best for working and under what conditions? All the books which I have are about the IOS 6 and they're all with xib examples which I can't even run in the fifth xcode. Can't find adequate documentation on developer.apple.com, all confused. Аs I understand, the books about xcode 5 + IOS 7 will be released in a few months. Please, help me to make this scheme, the cells in the tableviews are static. Link to scheme https://www.dropbox.com/s/mwwfqgsj2d98exe/Scheme.jpg
Upvotes: 1
Views: 3066
Reputation: 13181
Here is an explanation for storyboards in Xcode 5 and specifics on how to make the connections between different scenes as identified in your scheme outlined in the image below:
Starting with the big picture:
So specific to your scheme:
Within the Storyboard: Inside the Document Outline (Editor > Show Document Outline):
Expand two scenes
Here are some code samples to get you started:
// In a story board-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"showDealDetail"])
{
// Get reference to the destination view controller
DealDetailViewController *dvc = [segue destinationViewController];
// Pass any objects to the view controller here, like...
[dvc setDetailObject:(NSManagedObject*)sender];
} else if ([[segue identifier] isEqualToString:@"showActivityDetail"])
{
ActivityDetailViewController * advc = [segue destinationViewController];
// Pass any objects to the view controller here, like...
[advc setDetailObject:(NSManagedObject*)sender];
} else if ( [[segue identifier] isEqualToString:@"showMatchDetail"])
{
MatchDetailViewController * mdvc = [segue destinationViewController];
// Pass any objects to the view controller here, like...
[mdvc setDetailObject:(NSManagedObject*)sender];
}
}
From ViewController1 within the two button action methods call:
//execute manual segue
[self performSegueWithIdentifier:@"showAlternate" sender: self];
Upvotes: 2