Created
June 29, 2014 13:36
-
-
Save is8r/079f5d5a84bf233757b9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
-(NSNumber *) facebook:(NSString*)s | |
{ | |
if(!facebookState) facebookState = [[NSNumber alloc] initWithInt:0]; | |
if(s == @"logout") {//ログアウトの場合 | |
[_facebook logout:self]; | |
facebookState = [[NSNumber alloc] initWithInt:0]; | |
return facebookState; | |
} | |
if([facebookState intValue] == 2) return facebookState; | |
//状態取得したい時 | |
if(s == @"") { | |
if(_facebook && _facebook.isSessionValid==YES) { | |
facebookState = [[NSNumber alloc] initWithInt:1]; | |
} else { | |
facebookState = [[NSNumber alloc] initWithInt:0]; | |
} | |
return facebookState; | |
} | |
//実行関連 | |
if([facebookState intValue] == 0) {//ログインの場合 | |
[self facebookAccountLogin]; | |
} else if([facebookState intValue] == 1) {//投稿 | |
[self postfacebook:s]; | |
facebookState = [[NSNumber alloc] initWithInt:2]; | |
} | |
return facebookState; | |
} | |
-(void) facebooktReset | |
{ | |
facebookState = [[NSNumber alloc] initWithInt:0]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment