NSUserDefaultsに問題があります。私は自分のアプリについてできる限り本の手順を実行しましたが、それでも同じ問題が発生します。
私は
*** -[NSUserDefaults integerForKey:]: message sent to deallocated instance 0x3b375a0
設定をロードしようとするとエラーが発生します。これが私が持っているコードです、それはAppDelegateクラスにあります。
- (void)applicationDidFinishLaunching:(UIApplication *)application {
recordingController = [[RecordingTableViewController alloc] initWithStyle:UITableViewStylePlain];
[recordingController retain];
// Add the tab bar controller's current view as a subview of the window
[window addSubview:tabBarController.view];
[self loadSettings];
}
-(void)loadSettings
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSNumber loop = [defaults objectForKey:@"loop_preference"];
NSNumber play = [defaults objectForKey:@"play_me_preference"];
NSNumber volume = [defaults objectForKey:@"volume_preference"];
}
ご覧のとおり、私はまだ値を使って何もしようとはしていませんが、ループ設定の行の読み取りでエラーが発生します。NSStringを読んでみてもわかります。
任意の提案をいただければ幸いです。
ありがとう
ピーター