Cloudmine을 통한 API 호출은 REST 또는 SOAP을 사용하는 방법과 매우 다릅니다. 이제 구문에 문제가 있습니다. 클라우드 북 웹 사이트의 문서는 객관적인 C로되어 있습니다. 스위프트로 변환하면 오류가 발생합니다. 이다 iOS에서 Cloudmine을 API로 사용하는 방법 Swift
user!.loginWithCallback({(resultCode: CMUserAccountResult!, messages: [AnyObject!]) -> Void in
switch resultCode {
case CMUserAccountLoginSucceeded:
// success! the user now has a session token
var token = user.token
break
case CMUserAccountLoginFailedIncorrectCredentials: break
// the users credentials were invalid
case CMUserAccountOperationFailedUnknownAccount: break
// this account doesn't exist
}
})
난 그냥 객관적인 C 코드에서 변환 :
Cannot convert value of type '(CMUserAccountResult!, [AnyObject!]) -> Void' to expected argument type 'CMUserOperationCallback!'
감사 @Nick :
그래서 난 그냥에 코드를 변경! 나는 내 문제를 해결했다. 하지만 문제가 다시 발생하면 연락을 드리겠습니다. –