-1

I'm new in iPhone, I created application that is started with UITabbarController with 4 items using AppDelegate. through the app I opened some views and I want to relaunch the AppDelegate again by using a code like:

[appdelegate presentModalViewController:myNavController animated:YES];

is this possible?

this is in my AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    NSMutableArray *array = [[NSMutableArray alloc] init];

    MaktabatyTableViewController *own = [[MaktabatyTableViewController alloc] initWithStyle:UITableViewStylePlain];
    UINavigationController *ownNavController = [[UINavigationController alloc] initWithRootViewController:own];
    [array addObject:ownNavController];

    NewestTableViewController *newest = [[NewestTableViewController alloc] initWithStyle:UITableViewStylePlain];
    UINavigationController *newestNavController = [[UINavigationController alloc] initWithRootViewController:newest] ;
    [array addObject:newestNavController];

    MostBuyTableViewController *mostbuy = [[MostBuyTableViewController alloc] initWithStyle:UITableViewStylePlain];
    UINavigationController *mostbuyNavController = [[UINavigationController alloc] initWithRootViewController:mostbuy];
    [array addObject:mostbuyNavController];

    FreeBooksTableViewController *free = [[FreeBooksTableViewController alloc] initWithStyle:UITableViewStylePlain];
    UINavigationController *freeNavController = [[UINavigationController alloc] initWithRootViewController:free];
    [array addObject:freeNavController];

    self.tabBarController = [[UITabBarController alloc] init];
    self.tabBarController.viewControllers = array;

    [self.window setBackgroundColor:[UIColor whiteColor]];
    [self.window addSubview:self.tabBarController.view];

    self.window.rootViewController = self.tabBarController;
    [self.window makeKeyAndVisible];

    return YES; 
}

Thanks in advance.

4

1 回答 1

0

我想你正在寻找这样的东西..

一个登录屏幕,它是一个带有登录字段的简单视图,在登录时,这个屏幕是没有用的。主应用程序基于标签栏。

以及用户退出后显示的注销屏幕或屏幕。

我的一个应用程序中有这个要求,所以我制作了一个示例模板。也许它可以帮助您检查这个

于 2012-09-24T15:31:49.827 回答