iOS不支持跨商店副本EKEvent

时间:2017-10-05 14:42:52

标签: ios11 xcode9 ekevent

我在Xcode 9,iOS11上保存EKEvent时收到此NSInternalInconsistencyException错误。

<button type="button" class="fc-btnBloquearAgenda-button fc-button fc-state-default fc-corner-right">
<span class="fc-icon fc-icon-fa fa fa-lock"></span>
</button>

错误:

  

致命异常:NSInternalInconsistencyException iOS不支持   跨店复制品。

2 个答案:

答案 0 :(得分:3)

每当您将任何值分配给其他对象时,意味着将一个值复制到其他值,因此有时会发送异常。

就我而言:

if(orginalEvent.structuredLocation != nil){
            newEvent.structuredLocation = orginalEvent.structuredLocation
        }

所以,我已经替换为以下内容:

if(orginalEvent.structuredLocation != nil){
            if orginalEvent.structuredLocation!.title.characters.count > 0{

                let location = EKStructuredLocation(title: orginalEvent.structuredLocation!.title)
                if(orginalEvent.structuredLocation?.geoLocation != nil){
                    location.geoLocation = CLLocation(latitude: (orginalEvent.structuredLocation?.geoLocation?.coordinate.latitude)!, longitude:  (orginalEvent.structuredLocation?.geoLocation?.coordinate.longitude)!)
                }

                newEvent.structuredLocation = location
            }

        }

所以,它现在正在运作。

答案 1 :(得分:0)

请勿创建和使用新的EKEventStore()。只需使用现有的EKEventStore实例。

相关问题