Created
May 26, 2010 18:07
-
-
Save mikeymicrophone/414831 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *plist_path = [NSHomeDirectory() stringByAppendingPathComponent:@"audio_recording_number.plist"]; | |
NSLog(@"plist path: %@", plist_path); | |
NSLog(@"file exists: %i", [[NSFileManager defaultManager] fileExistsAtPath:plist_path]); | |
if ([[NSFileManager defaultManager] fileExistsAtPath:plist_path]) { | |
NSLog(@"found audio config file"); | |
} else { | |
NSLog(@"did not find audio config file"); | |
audio_recording_number = [NSNumber numberWithInteger:0]; | |
NSDictionary *audio_properties = [NSDictionary dictionaryWithObject:audio_recording_number forKey:@"number_of_recordings"]; | |
[audio_properties writeToFile:plist_path atomically:YES]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2010-05-26 14:07:51.323 flower[40853:207] plist path: /Users/mschwab/Library/Application Support/iPhone Simulator/3.1.3/Applications/084FD774-FBD7-4EDC-AFE9-B3FB2A0552A8/audio_recording_number.plist | |
2010-05-26 14:07:51.324 flower[40853:207] file exists: 0 | |
2010-05-26 14:07:51.325 flower[40853:207] did not find audio config file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mschwab$ cat /Users/mschwab/Library/Application\ Support/iPhone\ Simulator/3.1.3/Applications/084FD774-FBD7-4EDC-AFE9-B3FB2A0552A8/audio_recording_number.plist | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>number_of_recordings</key> | |
<integer>0</integer> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the console output indicates that the fileManager cannot confirm that the file exists at that path.
however, when I built this code against the 3.2 SDK, it worked properly.