Search code examples
iphoneiossettings.bundleapplication-settings

How to call a specific user default in iOS


I'm trying to call up a specific setting that is saved in the settings bundle of my iphone app. I want to do an if statement based on what was saved. My code in the implementation file looks like this:

branchMatch = [[NSString alloc] initWithString:[defaults objectForKey:@"branch"]];

The object in the settings file is just the name of the specific branch. I keep getting the SIGABRT error but I'm not sure why.


Solution

  • After much hair pulling, I realized that I need to load user defaults from the delegate class instead of the ViewController.

    Thanks for all the input