我正在尝试放置第一个启动视图。我已经尝试了一些东西,但这不起作用。
这是我所拥有的:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIPageControl *pageControl = [UIPageControl appearance];
pageControl.pageIndicatorTintColor = [UIColor lightGrayColor];
pageControl.currentPageIndicatorTintColor = [UIColor blackColor];
pageControl.backgroundColor = [UIColor whiteColor];
return YES;
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"yourCondition"])
{
//launch your first time view
self.viewController = [[viewController alloc] initWithNibName:@"viewController" bundle:nil];
}
else
{
//launch your default view
self.viewController = [[viewController alloc] initWithNibName:@"defaultViewController" bundle:nil];
[[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"yourCondition"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
不知何故,它说 viewController 不是 AppDelegate 的对象类型。有任何想法吗?