I want the when user install apps on device app should show him loginScreen when user first time opens app after that user logins and user remains logins is there any way to make this save so that if user again opens app second then user should be in logged stated and does not show user the login screen thanks.
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch.
self.splitViewController =[[UISplitViewController alloc]init];
self.rootViewController=[[RootViewController alloc]init];
self.detailViewController=[[[FirstDetailViewController alloc]init] autorelease];
self.loginViewController=[[[LoginViewController alloc]init] autorelease];
UINavigationController *rootNav=[[UINavigationController alloc]initWithRootViewController:rootViewController];
UINavigationController *detailNav=[[UINavigationController alloc]initWithRootViewController:detailViewController];
if ([detailNav.navigationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)] )
{
UIImage *image = [UIImage imageNamed:@"Nav.png"];
[detailNav.navigationBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
}
user_Name=@"Jamshaid";
isClickedLogin=@"NO";
userLogin=@"Logout";
self.splitViewController.viewControllers=[NSArray arrayWithObjects:rootNav,detailNav,nil];
self.splitViewController.delegate=self.detailViewController;
NSMutableArray *tempArray = [[NSMutableArray alloc] init];
self.coffeeArray = tempArray;
[tempArray release];
NSMutableArray *tempArray1 = [[NSMutableArray alloc] init];
self.arrayOne = tempArray1;
[tempArray1 release];
NSMutableArray *tempArray2 = [[NSMutableArray alloc] init];
self.arrayTwo = tempArray2;
[tempArray2 release];
NSMutableArray *tempArray3 = [[NSMutableArray alloc] init];
self.libraryArray = tempArray3;
[tempArray3 release];
NSMutableArray *tempArray4 = [[NSMutableArray alloc] init];
self.activityArray = tempArray4;
[tempArray4 release];
NSMutableArray *tempArray5 = [[NSMutableArray alloc] init];
self.arrayOneC = tempArray5;
[tempArray5 release];
NSMutableArray *tempArray6 = [[NSMutableArray alloc] init];
self.arrayTwoC = tempArray6;
[tempArray6 release];
NSMutableArray *tempArrayD = [[NSMutableArray alloc] init];
self.detailArray = tempArrayD;
[tempArrayD release];
NSMutableArray *tempArrayD1 = [[NSMutableArray alloc] init];
self.detailArrayOne = tempArrayD1;
[tempArrayD1 release];
NSMutableArray *tempArrayD2 = [[NSMutableArray alloc] init];
self.detailArrayTwo = tempArrayD2;
[tempArrayD2 release];
NSMutableArray *tempArrayD3 = [[NSMutableArray alloc] init];
self.publishArray = tempArrayD3;
[tempArrayD3 release];
[Coffee getInitialDataToDisplay:[self getDBPath]];
// Add the split view controller's view to the window and display.
// original working [window addSubview:self.splitViewController.view];
[window addSubview:splitViewController.view];
[window makeKeyAndVisible];
return YES;
}