I持っURL値を使用してappDelegateのappDidFinishLoading方法から負荷にファイルをチェックするアプリNSUserDefaults設定ルートPLISTで、私はおそらく店舗:一部の静とNSUserDefaults設定バンドルのplist
NSString *pathStr = [[NSBundle mainBundle] bundlePath];
NSString *settingsBundlePath = [pathStr stringByAppendingPathComponent:@"Settings.bundle"];
NSString *finalPath = [settingsBundlePath stringByAppendingPathComponent:@"Root.plist"];
NSDictionary *settingsDict = [NSDictionary dictionaryWithContentsOfFile:finalPath];
NSArray *prefSpecifierArray = [settingsDict objectForKey:@"PreferenceSpecifiers"];
NSDictionary *prefItem;
for (prefItem in prefSpecifierArray){
NSString *keyValueStr = [prefItem objectForKey:@"Key"];
if ([keyValueStr isEqualToString:kFirstNameKey]){
nsUserDefURL = [prefItem objectForKey:@"DefaultValue"];
}
if ([keyValueStr isEqualToString:kSecondNameKey]){
NSLog(@"You are using local data:%@",[prefItem objectForKey:@"DefaultValue"]);
}
}
NSLog(@" this is the url == %@", nsUserDefURL);
// since no default values have been set (i.e. no preferences file created), create it here
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:nsUserDefURL,kFirstNameKey,@"YES",kSecondNameKey,nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:appDefaults];
[[NSUserDefaults standardUserDefaults] synchronize];
:
NSString *kFirstNameKey = @"url";
NSString *kSecondNameKey = @"Web DataSource";
NSLogでnsUserDefURLを設定しても、設定のplistにはデフォルト値が表示されます。私は、(私はシミュレータでそうすることができなかったことを知っていた)アプリケーションの設定に行って、私はURLフィールドの値を変更しましたが、私はまだ設定ルートのデフォルトのプレースホルダの値であるtest2.xml値を取得plist。ここで
はplistのです:
それとも、設定バンドルは、Xcodeのシミュレータ上で動作しないということでしょうか?
nsUserDefURL = [[NSUserDefaults standardUserDefaults] stringForKey:kFirstNameKey];
しかし、これは、各打ち上げデフォルト値を読み取ります