property-list

Attempt to insert non-property value Objective C

这一生的挚爱 提交于 2019-12-03 02:50:42
问题 Hi l am trying to create a fourates lists from an restaurants Object, my application has a list of different restaurants, l want the ability for users to add favourate restaurants, and this code is not working - (IBAction)toggleFav:(id)sender { Restaurant *resto = [self restaure]; NSMutableDictionary *dic = [[NSMutableDictionary alloc] init]; [dic setObject:resto.price forKey:@"restoPrice"]; [dic setObject:resto.restaurantId forKey:@"restaurantId"]; [dic setObject:resto.restoAbout forKey:@

modifying a Plist from command line on Mac using Defaults

无人久伴 提交于 2019-12-02 16:43:35
Does any one know how to modify a Plist file from command line using defaults ? Currently there are two Dictionaries under the URL types array; I need to add another. Every command i've tried have either replaced the entire dictionary, or created a new array called URL types instead of editing it. Any ideas of how this can be done in defaults (the console Mac app) and not PlistBuddy? Lri Open the Info.plist in a text editor to see the actual identifiers. defaults write Absolute/Path/to/Info.plist CFBundleURLTypes -array-add '<dict> <key>CFBundleTypeRole</key> <string>Viewer</string> <key

Attempt to insert non-property value Objective C

天涯浪子 提交于 2019-12-02 16:20:53
Hi l am trying to create a fourates lists from an restaurants Object, my application has a list of different restaurants, l want the ability for users to add favourate restaurants, and this code is not working - (IBAction)toggleFav:(id)sender { Restaurant *resto = [self restaure]; NSMutableDictionary *dic = [[NSMutableDictionary alloc] init]; [dic setObject:resto.price forKey:@"restoPrice"]; [dic setObject:resto.restaurantId forKey:@"restaurantId"]; [dic setObject:resto.restoAbout forKey:@"restoAbout"]; [dic setObject:resto.restoAddress forKey:@"restoAddress"]; [dic setObject:resto

NSDictionary with NSNumber to NSString mapping is non-property-list object

痴心易碎 提交于 2019-11-30 09:07:24
问题 Following code: [[NSUserDefaults standardUserDefaults] setObject:photoIdToPath forKey:@"photo_id_to_path"]; gives me the following error: Attempt to set a non-property-list object { 417675729 = "/Users/k06a/Library/Application Support/iPhone Simulator/7.1/Applications/21163736-DF6F-4E79-8196-6A966C81ED1B/Documents/417675729"; } as an NSUserDefaults value for key photo_id_to_path Here is photoIdToPath dictionary content analysis from Xcode debug console: (lldb) po photoIdToPath { 417675729 = "

NSDictionary with NSNumber to NSString mapping is non-property-list object

佐手、 提交于 2019-11-29 12:10:18
Following code: [[NSUserDefaults standardUserDefaults] setObject:photoIdToPath forKey:@"photo_id_to_path"]; gives me the following error: Attempt to set a non-property-list object { 417675729 = "/Users/k06a/Library/Application Support/iPhone Simulator/7.1/Applications/21163736-DF6F-4E79-8196-6A966C81ED1B/Documents/417675729"; } as an NSUserDefaults value for key photo_id_to_path Here is photoIdToPath dictionary content analysis from Xcode debug console: (lldb) po photoIdToPath { 417675729 = "/Users/k06a/Library/Application Support/iPhone Simulator/7.1/Applications/21163736-DF6F-4E79-8196

Copy Groovy class properties

别说谁变了你拦得住时间么 提交于 2019-11-27 09:14:04
I want to copy object properties to another object in a generic way (if a property exists on target object, I copy it from the source object). My code works fine using ExpandoMetaClass , but I don't like the solution. Are there any other ways to do this? class User { String name = 'Arturo' String city = 'Madrid' Integer age = 27 } class AdminUser { String name String city Integer age } def copyProperties(source, target) { target.properties.each { key, value -> if (source.metaClass.hasProperty(source, key) && key != 'class' && key != 'metaClass') { target.setProperty(key, source.metaClass

Copy Groovy class properties

和自甴很熟 提交于 2019-11-26 14:35:33
问题 I want to copy object properties to another object in a generic way (if a property exists on target object, I copy it from the source object). My code works fine using ExpandoMetaClass, but I don't like the solution. Are there any other ways to do this? class User { String name = 'Arturo' String city = 'Madrid' Integer age = 27 } class AdminUser { String name String city Integer age } def copyProperties(source, target) { target.properties.each { key, value -> if (source.metaClass.hasProperty