NSUserDefault のキー TCshow に bool 値を設定しました。キーが保存されているかどうかを nslog テストで実行したいので、bool 値を出力しようとしています。ここに私のコードがありますが、機能していません。何か提案はありますか?
- (IBAction)acceptAction:(id)sender {
//key store to nsuserdefault
self.storedKey = [[NSUserDefaults alloc] init];
[self.storedKey setBool:YES forKey:@"TCshow"];
//trying to print out yes or not, but not working...
NSLog(@"%@", [self.storedKey boolForKey:@"TCshow"]);
}