Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Your login

Hi, I have red everything its pretty interesting. I was wondering really how, after the login pops, how do you close and retrive info back to the Splitviewcontroller to I belive populate the correct data with the selected user login ?

Could you share info? I am actually in that trouble.

Thanks..!
 
Lol, well, that's not a mather of "Login views", rather, how do I share info between controllers.
Well, some answers are, use a SynthesizeSingleton file.
Or, send a Notificaiton I logged in, and send info with an object with it, and listen to that in another view.
Just saying ;)
 
Hey,

I had same trouble, and didn't like nobody helped me. So I will post my solution :) So u can keep happy coding ^_-

In ur appDelegate
Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application {

-->

Code:
	LoginScreenController *modalLoginView = [[[LoginScreenController alloc] initWithNibName:@"LoginScreenController" bundle:nil] autorelease];
	[modalLoginView setModalPresentationStyle:UIModalPresentationFullScreen];
	[self.splitViewController presentModalViewController:modalLoginView animated:NO];

BEFORE the
Code:
[window makeKeyAndVisible];

Don't forget to import the "LoginScreenController.h" at top :)

Good luck

Hi i tried the same question on my app with Xcode 4.2 iOS5 using storyboard

i have applied exactly like you have said which works for the thread starter but not me.

here are my code:

Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    
    NSLog(@"applicationDidFinishLaunchingWithOptions");
    //--Copy database to the user's phone if needed.
    [self copyDatabaseIfNeeded];
    
    //--Initialize the login array.
    NSMutableArray *tempArray = [[NSMutableArray alloc] init];
    self.loginArray = tempArray;
    [tempArray release];
    
    //--Once the db is copied, get the initial data to display on the screen.
    [Login getInitialDataToDisplay:[self getDBPath]];
    
    // Configure and show the window
    
    LoginDBMainViewController *modalLoginView = [[[LoginDBMainViewController alloc] initWithNibName:@"LoginDBMainViewController" bundle:nil] autorelease];
    [modalLoginView setModalPresentationStyle:UIModalPresentationFullScreen];
    [self.splitViewController presentModalViewController:modalLoginView animated:NO];
    
	[window addSubview:[navigationController view]];
	[window makeKeyAndVisible];
    
    // Override point for customization after application launch.
    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
    UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
    splitViewController.delegate = (id)navigationController.topViewController;
    return YES;
}

Please advice.
 
First of all, I have no experience in Storyboarding, so not sure if that's the same flow or not.. But I think the error lies here
Code:
    LoginDBMainViewController *modalLoginView = [[[LoginDBMainViewController alloc] initWithNibName:@"LoginDBMainViewController" bundle:nil] autorelease];
    [modalLoginView setModalPresentationStyle:UIModalPresentationFullScreen];
    [self.splitViewController presentModalViewController:modalLoginView animated:NO];
    
	[window addSubview:[navigationController view]];

You show a modal ViewController, and AFTER you add a subview, which will means, it will add it on top of the modal, so I think the error is there!

Good luck :)

Greets, Noxx
 
First of all, I have no experience in Storyboarding, so not sure if that's the same flow or not.. But I think the error lies here
Code:
    LoginDBMainViewController *modalLoginView = [[[LoginDBMainViewController alloc] initWithNibName:@"LoginDBMainViewController" bundle:nil] autorelease];
    [modalLoginView setModalPresentationStyle:UIModalPresentationFullScreen];
    [self.splitViewController presentModalViewController:modalLoginView animated:NO];
    
	[window addSubview:[navigationController view]];

You show a modal ViewController, and AFTER you add a subview, which will means, it will add it on top of the modal, so I think the error is there!

Good luck :)

Greets, Noxx

Thanks for replying =)

i had try commenting away the code that adds a subview and my LoginDBMainViewController does not appear, still showing my split view.

Please advice
 
Check if all your pointers are okay, and also put this block
Code:
    // Override point for customization after application launch.
    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
    UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
    splitViewController.delegate = (id)navigationController.topViewController;
before the window keyvisible thing ^_-
Also, I don't think that's the best way to do it (or if it's changed like that in storyboard, no problem.)
 
Check if all your pointers are okay, and also put this block
Code:
    // Override point for customization after application launch.
    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
    UINavigationController *navigationController = [splitViewController.viewControllers lastObject];
    splitViewController.delegate = (id)navigationController.topViewController;
before the window keyvisible thing ^_-
Also, I don't think that's the best way to do it (or if it's changed like that in storyboard, no problem.)

Yea i have no idea how to make it work, in your examples you guys are using XIB. so in my case is storyboard and i am not sure if that is the correct way to do it. i am just trying my luck and apparently it doesn't work. in the XIB method, there are NIBs and NIBNames. i am not sure what initWithNibName should be filled in the case of storyboard.

i was told that it can't be done on the app delegate.m because it is a UIResponder and not a UIViewController class. but you guys were successful. so i want it to work too =)

i have tried the above mentioned shifting of the code but still no magic.. =(
 
Last edited:
Like you implied yourself, we had MainWindow.xib (pre xcode 4.2), so I have absolutely no idea how to help you out, I think users like Dejo, Balanw, Firewood, Art are the persons you are looking for to help you for this solution, since I haven't taken the step towards Storyboards, and don't want to feed you wrong information, or let you make spaghetti code :eek:
Maybe another hunt at google?
 
edit:(actually solved my original questions)



stupid me, i didn't create the UISubclass and import it, but now it just doesnt show up.



I'm just not sure what methods are a necessity to show up the modal view for the loginviewcontroller.m
 
Last edited:
Like you implied yourself, we had MainWindow.xib (pre xcode 4.2), so I have absolutely no idea how to help you out, I think users like Dejo, Balanw, Firewood, Art are the persons you are looking for to help you for this solution, since I haven't taken the step towards Storyboards, and don't want to feed you wrong information, or let you make spaghetti code :eek:
Maybe another hunt at google?

Yea sure thing. i will hunt on google again. thanks for your help anyway. maybe i will start another thread here too with my question.

Cheers!
 
call splitviewcontroller on button click

Hello,

Well thanks for your above tutorial , I want to ask after open a login screen how can i call the split View controller on button click.




Ohh i get the solution : happy coding:

use this only :

[self dismissModalViewControllerAnimated:YES];

on your button click;


Please reply ..
Anxiouly Waiting
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.