Skip to content

Instantly share code, notes, and snippets.

@sei0o
Last active August 29, 2015 14:05
Show Gist options
  • Save sei0o/2243922f2a22b200279a to your computer and use it in GitHub Desktop.
Save sei0o/2243922f2a22b200279a to your computer and use it in GitHub Desktop.
NSUserDefaultsから取ってきたアレをalert
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