nsuserdefaults

read Microsoft Intune app configuration properties from cordova

人走茶凉 提交于 2019-12-11 17:54:44
问题 app configuration properties can be deployed to an iOS app with the Microsoft Intune app configuration policies. These properties are configured in plist format and deployed like explained in the docs https://github.com/MicrosoftDocs/IntuneDocs/blob/master/intune/app-configuration-policies-use-ios.md it seems like this properties can be read by the Intune iOS SDK as "MDM app config" like explained here: https://docs.microsoft.com/en-us/intune/app-sdk-ios#enable-targeted-configuration-appmam

Swift: Create an Array of Double values and save it to NSUserDefaults

試著忘記壹切 提交于 2019-12-11 17:14:55
问题 In the app I'm developing, I need to create an array that will store values of a variable (money, which is a double and changes when the user inputs a different value). So the idea was to create an array variable from a NSUSerDefaults key: var moneyArray:Array = NSUserDefaults.standardUserDefaults().arrayForKey("MoneyArray") Then I needed to append the value so: moneyArray.append(money) And now I would save the array again: NSUserDefaults.standardUserDefaults().setObject(moneyArray,forKey:

What's the best way to save multiple variables into NSUserdefaults and display on another view controller in the order saved?

北城以北 提交于 2019-12-11 17:08:37
问题 New swift guy here! I'm having problems conceptualizing how to store this information of a location with multiple details. Is user defaults the best way? Perhaps json array file? I've got two view controllers 1. favorites and 2. info. FavoritesViewController displays multiple groups of data in the order in which they were favorited like this Favorites Group 1 Remove button - Name of location - Address - latitude - longitude - Hours then continues groups On the infoViewController it shows

How to save Pin Annotation once app is closed (Swift)

泄露秘密 提交于 2019-12-11 16:25:51
问题 Currently, my app pins a location and that location is stores like so: func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) { // Find location of user var userLocation:CLLocation = locations[0] as! CLLocation var latitude = userLocation.coordinate.latitude var longitude = userLocation.coordinate.longitude var latDelta:CLLocationDegrees = 0.01 var longDelta: CLLocationDegrees = 0.01 var span: MKCoordinateSpan = MKCoordinateSpanMake(latDelta, longDelta)

NSUserDefaults: storing struct/class with only property list compliant types, in a readable format

╄→гoц情女王★ 提交于 2019-12-11 15:36:08
问题 Suppose a dictionary is stored in UserDefaults according to the following code: UserDefaults.standard.set(["name": "A preset", "value": 1], forKey: "preset") The plist that results from running this command is: <?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>preset</key> <dict> <key>name</key> <string>A preset</string> <key>value</key> <integer>1</integer> </dict> <

Appending Images in Array

穿精又带淫゛_ 提交于 2019-12-11 13:53:38
问题 I am trying to append images in array after downloading from XML enclosure . 20 images are in XML . I want to store these images one by one in array in order form, and then trying to save in NSUserDefaults . Can any one please tell me how i can do this? Thanks var imageArray : [NSData] = [] var imgIndex = 0 downloadFileFromURL(NSURL(string: self.posts.objectAtIndex(indexPath.row).valueForKey("enclosure") as! String)!, completionHandler:{(img) in dispatch_async(dispatch_get_main_queue(), { ()

Save and Load MapAnnotation pins using NSMutableArray

会有一股神秘感。 提交于 2019-12-11 13:38:55
问题 I need help with my MapAnnotation codes. I want to save map pins so that the user can come back to the map and see the ones he/she has placed. However this code does not show the pins when the view loads. Code for adding and saving pins: - (void)addPinToMap:(UIGestureRecognizer *)gestureRecognizer { if (gestureRecognizer.state != UIGestureRecognizerStateBegan) return; CGPoint touchPoint = [gestureRecognizer locationInView:self.mapView]; CLLocationCoordinate2D touchMapCoordinate = [self

Saving rich text in NSUserDefaults

假装没事ソ 提交于 2019-12-11 10:53:49
问题 I'm a new to Objective-C and I can't find an answer to my problem. I've written a simple program using a text field to enter some text, then use: SaveFBCover1 = Cover1.stringValue; DefaultCover1 = [NSUserDefaults standardUserDefaults]; [DefaultCover1 setObject:SaveFBCover1 forKey:@"SaveCover1"]; [DefaultCover1 synchronize]; to save it. After that, it does this DefaultCover1 = [NSUserDefaults standardUserDefaults]; loadFBCover1 = [DefaultCover1 objectForKey:@"SaveCover1"]; FBCoverImageText =

NSUserDafaults reading Root.plist got a nil value

依然范特西╮ 提交于 2019-12-11 10:26:49
问题 This is the code in my AppDelegate: NSString *pathStr = [[NSBundle mainBundle] bundlePath]; NSString *settingsBundlePath = [pathStr stringByAppendingPathComponent:@"Settings.bundle"]; NSString *finalPath = [settingsBundlePath stringByAppendingPathComponent:@"Root.plist"]; NSDictionary *settingsDict = [NSDictionary dictionaryWithContentsOfFile:finalPath]; NSArray *prefSpecifierArray = [settingsDict objectForKey:@"PreferenceSpecifiers"]; prefSpecifiersArray is setted to 0x0 < nil >. I really

How can I pass a “MutableArray with full of Objects” to another class by using NSUserDefaults?

风流意气都作罢 提交于 2019-12-11 09:39:42
问题 How can I pass a " MutableArray with full of Objects" to another class by using NSUserDefaults ? I know how to pass " MutableArray "s but this does not work! So; I have a MutableArray; ' myCityObjects ', and I populate it with objects; ' cities ' In each ' cities ' object there are properties like cityName , cityLocation etc... [myCityObjects addObject:cities]; Now, what I want to do is to pass this MutableArray (filled with objects) to another class by using ' NSUserDefaults '; [