0
    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{


if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
    // iPhone Classic
    NSLog(@"iPhone 4");
}
if(result.height == 568)
{
    // iPhone 5
    NSLog(@"iPhone 5");
}
}

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

SideMenuViewController *leftMenuViewController = [[SideMenuViewController alloc] init];



ContainerOfSideMenuByVeerViewController *container = [ContainerOfSideMenuByVeerViewController
                                                  containerWithCenterViewController:[self navigationController]
                                                  leftMenuViewController:leftMenuViewController];

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

return YES;

}

我想更改 leftMenuViewController 中存在的 NSString 的值并重新加载它,以便我可以根据新数据更改逻辑。

我想更改每个控制器中的 NSString ,但我无法这样做,因为 leftMenuViewController 从 didFinishLauchingWithOption 开始,它只加载一次。

我怎样才能做到这一点?

4

1 回答 1

0

你可以refreshleftMenuViewControllerpropertyNSString. 用这个定义 SideMenuViewController *leftMenuViewController inAppdelegatefile and make it属性,合成it. Now you are able to refresh yourleftMenuViewController with yourNSString`:

AppDelegate *appDelegate = [UIApplication sharedApplication];
[appDelegate.leftMenuViewController refresh:yourStr];
于 2013-06-09T11:22:29.980 回答