2017-10-05 11 views

답변

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 
      } 

     } 

을 그래서, 지금 노력하고 있습니다.