Changing Data in a Plist
Hey, alright so I have a .plist that looks like;
<plist version="1.0"> <dict> <key>Item 0</key> <dict> <key>Name</key> <string>Jero</string> <key>Initiative</key> <integer>0</integer> <key>EditThis</key> <false/> </dict> </dict> </plist>
In the app I have it so that when one of the rows (The data is put in a UITableView) is selected it pushes to a new view controller. I would like also to set the ‘EditThis’ boolean to yes, so the edit view controller can learn which to edit. However I can’t seem to figure out how to change the value. Any help is much appreciated.
Solutions Collect From Internet About “Changing Data in a Plist”
Load the plist into a mutable dictionary:
NSMutableDictionary *plist = [NSMutableDictionary dictionaryWithContentsOfFile:@"file.plist"]; [plist setObject:[NSNumber numberWithBool:YES] forKey:@"EditThis"]; [plist writeToFile:@"file.plist" atomically:YES];
- Determine image MB size from PHAsset
- My Xcode 7.3 compiler is constantly breaking and causing extremely long Build and Compile times
- Local Notification
- Unable to install same apps on 1 device
- Attempting to load the view of a view controller while it is deallocating … UIAlertController
- Can I convert an image into a grid of dots?
- Sort NSDictionary keys as NSDate
- Programmatically Disable Mouse & keyboard
- iOS Autolayout – Frame size not set in viewDidLayoutSubviews
- Where is NSAlert.h in the iOS SDK?
- how can i disable user touch of a UIbarbutton without disabling?
- Test whether a UIView is in the middle of animation
- Xcode: Release app update for iPhone only?
- When to use closures in swift?
- Subclass of GKGraphNode costToNode method never getting called