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.
- How to remove Address Bar in Safari in iOS?
- The entitlements specified…profile. (0xE8008016). Error iOS 4.2
- Adding UIBarButtonItem to UINav..Controller
- How to tell the active view controller when applicationDidBecomeActive is called?
- Experienced in web development. How to get started with iPhone Game Development?
- Figure out size of UILabel based on String in Swift
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];
- watchOS 2: haptic feedback in background
- How to send MSMessage in Messages Extension?
- Swift closure type inference
- Get Instance Of ViewController From AppDelegate In Swift
- populating a tableview with data using JSON and AFNetworking NSDictionary
- XCode Build and Archive for Enterprise Distribution builds old archive
- Why can't I instantiate an empty array of a nested class?
- MultiDimensional Array in Objective c
- NSURLConnection to upload file asynchonrously?
- What is the difference between Swift 2.0 do-try-catch and regular Java/C#/C++ exceptions
- UIImageView with Aspect Fill inside custom UITableViewCell using AutoLayout
- Reachability Notification Never Called
- How to get NSData of mp3 using MPMediaPickerController?
- Pattern match and conditionally bind in a single Switch statement
- iAd didFailToReceiveAdWithError not working sometimes, displays white box