Created
February 21, 2012 09:43
-
-
Save mpurbo/1875511 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
/** | |
* 非同期的にユーザーを登録する。 | |
*/ | |
- (void)registerUserUsingClient:(MMGClient *)client | |
{ | |
[client registerUserWithId:@"baabaa" | |
name:@"Baa Baa Black Sheep" | |
email:@"[email protected]" | |
password:@"moomoo" | |
delegate:self]; | |
} | |
/** | |
* 正常に登録のリクエストを送信したコールバック。 | |
*/ | |
- (void)requestFinishedWithResponse:(MMGObject *)registerUserObj | |
{ | |
if (registerUserObj.error != nil || registerUserObj.type != kMMGUser) { | |
NSLog(@"ユーザー登録のエラーが発生しました: %@", [registerUserObj.error localizedDescription]); | |
} else { | |
MMGUser *user = (MMGUser *)registerUserObj; | |
NSLog(@"ユーザーが登録されました、sid:%ld, id: %@, name:%@", user.sid, user.identifier, user.name); | |
} | |
} | |
/** | |
* リクエストが失敗したコールバック。 | |
*/ | |
- (void)requestFailedWithError:(NSError *)error | |
{ | |
NSLog(@"登録のリクエストエラーが発生しました: %@", [error localizedDescription]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment