plist

What are some advantages of using Core Data? (as opposed to plist)

怎甘沉沦 提交于 2019-11-30 11:22:34
I am relatively new to iOS and programming, and I made an app before, but it used a plist for storage, which I saved to the documents folder. Now, I am thinking about switching over to Core Data, but it looks a little complicated, and I'm not sure if it will work for what I want. I am going to have a bunch of data which I need to graph, so I'm not sure if Core Data is best for this, as it seems that I cannot create an array type in the .xcdatamodeld file. What are some other advantages of Core Data? Is it faster? Easier to use (once you set it up)? Update: For anyone wondering, I finished the

How to program a NSOutlineView?

蓝咒 提交于 2019-11-30 10:12:44
I am having trouble creating a NSOutlineView in Xcode 8 (Swift 3). I have a plist file with some information that I would like to present in an OutlineView. The plist file looks as following (example): Root Dictionary *(1 item) Harry Watson Dictionary *(5 items)* name String Harry Watson age Int 99 birthplace String Westminster birthdate Date 01/01/1000 hobbies Array *(2 items)* item 0 String Tennis item 1 String Piano The OutlineView should look pretty similar, like follow: name Harry Watson age 99 birthplace Westminster birthdate 01/01/1000 > hobbies ... (<- this should be expandable) I

Swift 3 - UIButton adding setTitle from plist and database

梦想与她 提交于 2019-11-30 10:08:31
问题 I have plist file and database, in the plist file has English letters and in database row has String for example (London) and I convert String to characters array and appended into plist file. I created 14 UIButtons by (for loop) and I was given setTitle from row of database and given shuffle and adding letters from plist and given shuffle. So my problem is when adding my characters from database is show me just characters from database and shuffled like this: But I don’t need just that I

iphone SDK:Can write data to plist on Simulator but can't do same thing at Device?

吃可爱长大的小学妹 提交于 2019-11-30 09:25:00
问题 Why I can write information to plist on simulator But can't do this on real iphone/ipod device ???? Is there exist an absolute path to put a .plist file in xcode project ??? Thanks for all reply and answers ~ code : this how I write text to plist from textfield NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"Password" ofType:@"plist"]; NSMutableDictionary *propertyList = [[NSMutableDictionary alloc] initWithContentsOfFile:plistPath]; [propertyList setValue:serialNumber.text

Even with “voip” present in “UIBackgroundModes” in “plist”, iOS App does not auto start after device reboot in iOS10

强颜欢笑 提交于 2019-11-30 09:24:09
I need my VoIP App to auto start after rebooting the device. Apple docs clearly mention that :- (=========EDIT: This is from official Apple docs please have a look at this before commenting or answering that the App cannot be launched without user interaction or silent push notification. Also have a look at Github project below, people have verified this behaviour) Values for the UIBackgroundModes array Value : voip Description : The app provides Voice-over-IP services. Apps with this key are automatically launched after system boot so that the app can reestablish VoIP services. Apps with this

Reading plist file

谁说我不能喝 提交于 2019-11-30 09:08:56
I created plist with big base of different animals in it (keys) and added this plist in my project. Type of every animal is NSDictionary. In every dictionary there are 5 more keys - characteristics of these animals (). I would like to go through every animal and if I match a certain characteristics of this animal, I put this animal in another array. So, I tried to make a code: NSArray *newArray = [[NSArray alloc]initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"animals" ofType:@"plist"]]; for (int i = 0;[newArray objectAtIndex:i];i++) { if ([[newArray objectAtIndex:i]objectForKey

NSNumber vs Int

瘦欲@ 提交于 2019-11-30 08:58:16
问题 If integers cannot be written to a dictionary and then to a .plist, but NSNumbers can is it better to use NSNumbers throughout the app, rather than needing to convert every-time saving or loading a dictionary from a .plist? 回答1: As a generalization: Just stick with POD types until you need to use an object based representation, such as NSNumber . The performance is much better with the PODs, but you'll need NSNumber in some cases. In some cases, it may make sense to use NSNumber instead --

Can i modify Root.plist in settings bundle dynamically?

拈花ヽ惹草 提交于 2019-11-30 08:40:07
问题 I have a settings bundle in my app.. containing root.plist now i have a screen which contains a checkbox .. on pressing the check box i want to change the BOOL value for DefaultValue key of PSToggleSwitchSpecifier in the plist. Since its being done at runtime.. my question is that .. can the file be changed at runtime and if yes.. give an idea how to do it?? here is the plist: <plist version="1.0"> <dict> <key>PreferenceSpecifiers</key> <array> <dict> <key>DefaultValue</key> <string></string>

How do I append a new item to a plist?

痴心易碎 提交于 2019-11-30 07:36:14
问题 In my iPhone app, I have two plist files to store "Themes". One is a read-only file containing default themes, and one contains custom Themes that the user has created. I'm using plist files because it's very easy for me to read from the plist and create new Theme objects. My plist is an array of dictionary objects. Is there any easy way to append a new dictionary object to my plist file? Or do I need to read the file into memory, append the new dictionary object, and write it back to the

Deleting plist file does not reset app on macOS 10.9+

試著忘記壹切 提交于 2019-11-30 05:55:55
问题 While developing a Cocoa application on 10.9, I have noticed that if I go to ~/Library/Preferences and delete the plist file for my app (to reset it), on the next build-and-run, the app behaves as if the plist file had never been deleted at all. It took me a long time to track down why this happens and I did not see a question/answer about it on SO, so I'm writing this question and answering it myself to help others. 回答1: On 10.9, the system is doing some more robust "caching" of preferences.