代码签名错误,iOS9

时间:2016-02-17 06:38:48

标签: ios objective-c xcode swift code-signing

我真的厌倦了这一点。我已经尽力解决了这个问题。但没有取得成功。我的SWIFT代码在模拟器上运行良好。但是当我尝试在设备上运行它或尝试进行存档时,我得到了这个编译错误

internal func backService()
    {
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), { () -> Void in
            let anObject = try! Realm().objects(remindertbl).filter("status = 0")
            print("here")
            for loop in anObject
            {
                let dateFormatter = NSDateFormatter()
                dateFormatter.dateFormat = "dd/MM/yyyy hh:mm a"
                let  timestamp = dateFormatter.stringFromDate(NSDate())
                let timeStampint = dateFormatter.dateFromString(timestamp)!.timeIntervalSince1970
                if(loop.reminderdays == Int64(timeStampint))
                {
                    if(loop.status == 0){                            

                    let notification = UILocalNotification()
                    notification.fireDate = NSDate(timeIntervalSince1970: 0)
                    notification.alertBody = "\(loop.title)"
                    notification.alertAction = "swipe to opem VLB Cloud!"
                    notification.soundName = UILocalNotificationDefaultSoundName
                    notification.userInfo = ["CustomField1": "w00t"]
                    UIApplication.sharedApplication().scheduleLocalNotification(notification)

                    let updateObject = try! Realm().objects(remindertbl).filter("status = 0")
                    var reminderObject = remindertbl()
                    for updateStatus in updateObject{
                        try! Realm().write()
                            {
                                print("target")
                                reminderObject.status = 2
                                reminderObject.reminderId = updateStatus.reminderId
                                reminderObject.syncflag = updateStatus.syncflag
                                reminderObject.vehicleid = updateStatus.vehicleid
                                reminderObject.syncid = updateStatus.syncid
                                reminderObject.dateadded = updateStatus.dateadded
                                reminderObject.datemodified = Int64(Timestamp)!
                                reminderObject.remindertime = updateStatus.remindertime
                                reminderObject.reminerDate = updateStatus.reminerDate
                                reminderObject.reminderdays = updateStatus.reminderdays
                                reminderObject.title = updateStatus.title
                                reminderObject.targetdistance = updateStatus.targetdistance
                                reminderObject.currentdistance = updateStatus.currentdistance
                                reminderObject.remindertype = updateStatus.remindertype

                                reminderObject.synctype = updateStatus.synctype
                                reminderObject.recuringdays = updateStatus.recuringdays
                                reminderObject.recuringdistance = updateStatus.recuringdistance

                                try! Realm().add(reminderObject, update: true)
                                reminderObject = remindertbl()
                        }
                    }
                }
            }
        }

    })
}

我尝试重新生成配置文件。但那件事情甚至没有奏效。我跟着this。但不工作..  不知道我做错了什么。

1 个答案:

答案 0 :(得分:7)

问题是因为 Apple WWDRCA 已在Feb 14, 2016过期。

解决此问题

  • 转到钥匙串访问,然后在菜单中

  • 点击查看 - - > 显示过期的证书

  从登录系统钥匙串中

删除过期的 Apple全球开发者关系证书颁发机构

  • 系统下,您可以看到证书已过期

enter image description here

  • 通过downloading从Apple安装续订的证书,然后双击它。

    Your keychain should show like that

  • 重新启动 xcode

  • 清理项目构建