Created
February 17, 2012 11:44
-
-
Save mpurbo/1852892 to your computer and use it in GitHub Desktop.
geomon-client-ios: ユーザーの存在の確認(同期のリクエスト)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// MMGClient *client = ... | |
// ユーザーIDはサーバーで既に登録されるか確認する。 | |
// デリゲートがnilすると、同期してリクエストをする。 | |
MMGObject *checkUserObj = [client checkAvailabilityOfUserId:@"baabaablacksheep" withDelegate:nil]; | |
if (checkUserObj.error != nil || checkUserObj.type != kMMGUser) { | |
NSLog(@"ユーザー確認のエラーが発生しました: %@", [checkUserObj.error localizedDescription]); | |
} else { | |
// タイプはkMMGUserの場合は、安全にMMGUserにキャストできる。 | |
MMGUser *checkUser = (MMGUser *)checkUserObj; | |
if (checkUser.sid == MMG_UNDEFINED_SID) { | |
NSLog(@"ユーザーIDはまだ登録されていません。"); | |
} else { | |
NSLog(@"ユーザーは既に登録済みです、sid = %ld", checkUser.sid); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment