gpt4 book ai didi

ios - 预期返回 'Bool' parse.com 推送通知的函数中缺少返回

转载 作者:搜寻专家 更新时间:2023-11-01 06:23:50 28 4
gpt4 key购买 nike

我正在尝试通过 swift&parse.com 使用推送通知。我正在接受这个错误。我该如何解决这个问题。

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

// Register for Push Notitications, if running iOS 8
if application.respondsToSelector("registerUserNotificationSettings:") {

let types:UIUserNotificationType = (.Alert | .Badge | .Sound)
let settings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: types, categories: nil)

application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()

} else {
// Register for Push Notifications before iOS 8
application.registerForRemoteNotificationTypes(.Alert | .Badge | .Sound)
}


}//Missing return in a function expected to return 'Bool'

最佳答案

该函数需要一个 bool 值作为返回值。

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool 
{
// Your code.
return true
}

关于ios - 预期返回 'Bool' parse.com 推送通知的函数中缺少返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28025458/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com