我希望当用户在设备应用程序上安装应用程序时应该在用户登录后第一次打开应用程序时向他显示 loginScreen 并且用户保持登录状态是否有任何方法可以进行保存,以便如果用户再次打开应用程序第二次然后用户应该登录声明并且不向用户显示登录屏幕,谢谢。
- (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;
}