-
-
Save sei0o/2243922f2a22b200279a to your computer and use it in GitHub Desktop.
NSUserDefaultsから取ってきたアレをalert
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
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; | |
int value = [ud integerForKey:@"hogelo"]; // 値をとってくる | |
UIAlertView *alert = [[UIAlertView alloc] initWithTitle: @"タイトルだお" | |
message: [value description] // int型をNSStringに変換するお | |
delegate: nil | |
cancelButtonTitle: nil | |
otherButtonTitles: @"OK", nil // nilを忘れない | |
]; | |
// 参考 | |
// http://iphone-tora.sakura.ne.jp/uialertview.html | |
// http://iphone-tora.sakura.ne.jp/nsuserdefaults.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment