ios9

How to fetch all contacts record in iOS 9 using Contacts Framework

大憨熊 提交于 2019-11-26 12:15:47
问题 Most part of AddressBook framework is deprecated in iOS 9. In the new Contacts Framework documentation only shows how to fetch records matches a NSPredicate , but what if I want all the record? 回答1: Both other answers do only load contacts from the container with the defaultContainerIdentifier . In a scenario, where the user has more than one container (i.e. an Exchange and an iCloud account which both are used to store contacts), this would only load the contacts from the account that is

Does App Store reject submission if NSAllowsArbitraryLoads set to YES?

拈花ヽ惹草 提交于 2019-11-26 11:29:05
问题 The new ATS involved by iOS 9 cause lots of http related functionalities stop working. I have to add all the http request url into a whitelist or I could simply disable the ATS by setting NSAllowsArbitraryLoads to YES . Does anybody know if App Store will reject the submission if the NSAllowsArbitraryLoads has been set to YES ? 回答1: UPDATE: Apple will reject Apps not conforming to ATS after the end of Dec 2016. Source However, If you need to load a http:// resource only in web (UIWebView

App does not have access to your photos or videos iOS 9

不问归期 提交于 2019-11-26 11:02:13
问题 When I access my Photo Library with an UIImagePicker to choose a photo, the app shows me sometimes a black screen and sometimes a screen that says that I have to give permissions to my app to access the photos. But when I go to Settings -> Privacy -> Photos, there’s no app there and the app is nowhere to be seen in Settings. I read that I must add two values to my Info.plist but they didn’t worked either. Have anyone run with the same error? I’m working with xcode 7, swift 2.0 and iOS 9 This

fatal error: swapping a location with itself is not supported with Swift 2.0

僤鯓⒐⒋嵵緔 提交于 2019-11-26 09:57:22
问题 I have this extension which will create a new array which have group of arrays randomly from given array: extension Array { var shuffle:[Element] { var elements = self for index in 0..<elements.count { swap(&elements[index], &elements[ Int(arc4random_uniform(UInt32(elements.count-index)))+index ]) } return elements } func groupOf(n:Int)-> [[Element]] { var result:[[Element]]=[] for i in 0...(count/n)-1 { var tempArray:[Element] = [] for index in 0...n-1 { tempArray.append(self[index+(i*n)]) }

IOS 9 Error Domain=kCLErrorDomain Code=0 “(null)”

拟墨画扇 提交于 2019-11-26 09:42:38
问题 Code below should get current location. But above error is generated. Function didUpdateLocations never gets called. Running this on a device (iPhone 5s)iOS 9.1. Info.plist has Required device capabilities and Privacy - Location usage description configured as shown in the attached image. Please help! let locationManager = CLLocationManager() override func viewDidLoad() { super.viewDidLoad() locationManager.delegate = self locationManager.requestAlwaysAuthorization() locationManager

This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes

北慕城南 提交于 2019-11-26 09:36:24
问题 I get this log in the console when I am running my application in is simulator. Haven\'t seen this in iOS 8. I am not quite sure whats causing this. Has anyone else come across the same issue and if so how was it fixed? or is there any help anyone can provide in regards to this? 回答1: Do not change UI from anything but the main thread. While it may appear to work on some OS or devices and not others, it is bound to make your application unstable, and crash unpredictably. If you must respond to

iOS 9 Facebook login simulator -canOpenURL: failed for URL: “fbauth2:///” - error: “(null)”

那年仲夏 提交于 2019-11-26 09:02:53
问题 I\'ve updated to Xcode 7 and the latest iOS SDK. I\'ve added the appropriate entries in my app\'s plist: My app\'s Facebook login works fine on device. However, on iOS 9 simulator, I\'m getting: -canOpenURL: failed for URL: \"fbauth2:///\" - error: \"(null)\" And login is not working. I\'ve seen facebook login issue - canOpenURL: failed for URL: "fbauth2:///" - error: "(null)" but I have FBSDKCoreKit framework. I\'ve also seen Facebook SDK 4.5 IOS 9 but it\'s answer doesn\'t solve my problem.

Swipe-able Table View Cell in iOS 9

家住魔仙堡 提交于 2019-11-26 08:45:37
问题 I want my table list to have a swipe-able menu like in iOS 8 (first introduced in iOS 7). I\'ve found a Ray Wenderlich guide that is clear on how to do it, but it was written a year and 4 months ago and the code is in Objective-C. Did iOS 8 or the upcoming iOS 9 finally include this function in Apple\'s SDK? I know they made the \"swipe to reveal delete function\" built-in years ago. I don\'t want to waste my time implementing patched-together code to mimic the iOS 8 mail function, if Apple\

kCFStreamErrorDomainSSL, -9802 when connecting to a server by IP address through HTTPS in iOS 9

此生再无相见时 提交于 2019-11-26 08:34:39
问题 We have an iOS app that connects to our server through HTTPS. When the app is built with the new iOS 9 SDK and ran under iOS 9, the following error occurs: NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802) The app uses AFNetworking 1.3.4 with pinned certs. The problem occurs if I connect to the server with its IP address. It works if I add the NSAllowsArbitraryLoads config, or if I connect to the server with its domain name. The Tomcat connector is configured with

UITextView with hyperlink text

戏子无情 提交于 2019-11-26 08:25:58
问题 With a non-editable UITextView, I would like to embed text like this in iOS9+: Just click here to register I can create a function and manipulate the text but is there a simpler way? I see that I can use NSTextCheckingTypeLink so getting the text clickable without the \'click here\' part is straightforward in Interface Builder: Just http://example.com to register I\'m using Xcode 8 and Swift 3 if that\'s relevant. 回答1: Set isEditable = false or the text view will go into text-editing mode