How to use storyboards on the iPad, with a split-view controller (iOS5.0)?

Up vote 1 down vote favorite share g+ share fb share tw.

Ios ipad ios5 storyboard link|improve this question asked Oct 19 '11 at 23:53tadasz1015.

MasterViewController. H @property (assign,nonatomic) id delegate; MasterViewController. M - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (delegate!

=nil) { // get your data here { your code here } delegate sendDataToView:data; } } in your AppDelegate. M file. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch.

UISplitViewController *splitViewController = (UISplitViewController *)self.window. RootViewController; UINavigationController *navigationController = splitViewController. ViewControllers lastObject; splitViewController.

Delegate = (id)navigationController. TopViewController; // set the view controller here UINavigationController *masterNavController = splitViewController. ViewControllers objectAtIndex:0; MasterViewController *masterViewController = masterNavController.

ViewControllers objectAtIndex:0; UINavigationController *detailNavController = splitViewController. ViewControllers objectAtIndex:1; DetailViewController *detailViewController = detailNavController. ViewControllers objectAtIndex:0; masterViewController.

Delegate = detailViewController; return YES; }.

Haven't found anything either. Workable solution is to just go ahead and make story boards for each view (or complex ones at least) and have the appDelegate class contain them. I'm actually surprised the story board ide doesn't allow addition of child views... Maybe in next update if not already.

Matthijs Hollemans 's book "ios5 by tutorials" includes how to use storyboards on ipad. But that book needs to buy, bot free. I just wanted to find the sample code,but failed.

Yes I saw that book contains example, but it's a bit silly to buy a book for (hope) simple example.. – tadasz Nov 4 '11 at 16:35 You can create a protocol for as a delegate. The delegate is used to sent data from MasterViewController to your DetailViewController. – pyanfield Nov 10 '11 at 6:00.

You can do that as below. Create a new protocol as delegate MyDataDelegate.h. @protocol MyDataDelegate - (void)sendDataToView:(MyData *)data; @end.

In your DetailViewController. H file. @interface DetailViewController : UIViewController in your DetailViewController.

M file. - (void)sendDataToView:(MyData *)data { // your code how to display data. }.

Using Xcode 4 create a master-detail application project template. Go to the storyboard file, expand the master view and add another static cell by selecting the default static cell named "Detail" and pressing Cmd + D. Name the new static cell as "Hello" (or anything you like.

) Now in your MasterViewController. M file, implement this: - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { self. DetailViewController setDetailItem:tableView cellForRowAtIndexPath:indexPath textLabel text; } This example will set the default label in the detailViewController to the selected cell nam of the masterViewController.

Note the setDetailItem: method takes an id parameter and in this example you are passing an NSString *.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions