Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/99.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 应用程序委派-页面控制器错误_Ios_Swift - Fatal编程技术网

Ios 应用程序委派-页面控制器错误

Ios 应用程序委派-页面控制器错误,ios,swift,Ios,Swift,我不确定我在下面的陈述中做错了什么。我已经在我的项目中添加了一个页面视图控制器,但是当我构建并运行该项目时,我得到了一个“bool”错误。代码如下: func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { // Override point for customization after ap

我不确定我在下面的陈述中做错了什么。我已经在我的项目中添加了一个页面视图控制器,但是当我构建并运行该项目时,我得到了一个“bool”错误。代码如下:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.

    UIApplication.sharedApplication().setStatusBarStyle(UIStatusBarStyle.LightContent, animated: true)

    let pageControl = UIPageControl.appearance()
    pageControl.pageIndicatorTintColor = UIColor.lightGrayColor()
    pageControl.currentPageIndicatorTintColor = UIColor.whiteColor()
}

您尚未返回该语句,您需要返回true或false。我想你忘了
返回true
。请尝试使用以下代码:

    let pageControl = UIPageControl.appearance()
    pageControl.pageIndicatorTintColor = UIColor.lightGrayColor()
    pageControl.currentPageIndicatorTintColor = UIColor.whiteColor()

    return true

希望有帮助

谢谢你解决了这个问题!我一定是在添加页面控件doh时删除了它!谢谢你解决了这个问题!我一定是在添加页面控件doh时删除了它!
    let pageControl = UIPageControl.appearance()
    pageControl.pageIndicatorTintColor = UIColor.lightGrayColor()
    pageControl.currentPageIndicatorTintColor = UIColor.whiteColor()

    return true