ios9

Getting video from Asset Catalog using On Demand ressources

和自甴很熟 提交于 2019-12-22 08:57:06
问题 I attributed to my .mp4 video the "tokyo" tag for example, and set it as installed during the app installation. Now before I was using a Path to get it from my resources, now it's different because it's located on the Asset Catalog. After found documentations, I tried something like : NSBundleResourceRequest(tags: ["tokyo"]).beginAccessingResourcesWithCompletionHandler { (error) -> Void in let tokyoVideo = NSDataAsset(name: "tokyo") So I can do : tokyoVideo.data to access NSData but I'm using

UIPasteboard string returning null from Today extension

时间秒杀一切 提交于 2019-12-22 08:53:20
问题 It seems that in iOS 9/Xcode 7 beta 5, I am unable to access [[UIPasteboard generalPasteboard] string]; from my Today widget extension as every time no matter the contents, it returns (NULL). I looked through the release notes and I did not see anything regarding this. Any ideas? 回答1: It seems to be an undocumented bug with iOS 9 beta 5, in particular, the iOS runtime. Same code works with normal app on iOS 9 beta 5, and today widget in iOS 8.x devices. 回答2: My app, which is a password

Login flow failing after upgrading to iOS9

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 08:23:53
问题 After upgrading my app to iOS9 I’am getting an error in my app which says: : objc[344]: Cannot form weak reference to instance (0x15919e00) of class LoginVC. It is possible that this object was over-released, or is in the process of deallocation. Below is the function in which i get this error: -(void)dismissLogin { self.isLoggingIn = NO; [self stopLoginAnimation]; [self dismissViewControllerAnimated:YES completion:NO]; [[NSNotificationCenter defaultCenter] removeObserver:self]; [self

The file couldn’t be opened because URL type http isn’t supported

一笑奈何 提交于 2019-12-22 07:32:30
问题 Using iOS 9 I'm attempting to use NSFileManager's moveItemAtURL : do { print(localURL) // http://localhost:3000/api/v1/activities print(cacheFile) // file:///Users/kyledecot/Library/Developer/CoreSimulator/Devices/35C03988-D8F5-42E5-AB35-B99BE461EEAE/data/Containers/Data/Application/69593B3A-F764-4BC3-89AD-72B701BF85C8/Library/Caches/activities.json try fileManager.moveItemAtURL(localURL, toURL: cacheFile) } catch let error as NSError { print(error) } When catching the error I'm getting:

The file couldn’t be opened because URL type http isn’t supported

99封情书 提交于 2019-12-22 07:29:06
问题 Using iOS 9 I'm attempting to use NSFileManager's moveItemAtURL : do { print(localURL) // http://localhost:3000/api/v1/activities print(cacheFile) // file:///Users/kyledecot/Library/Developer/CoreSimulator/Devices/35C03988-D8F5-42E5-AB35-B99BE461EEAE/data/Containers/Data/Application/69593B3A-F764-4BC3-89AD-72B701BF85C8/Library/Caches/activities.json try fileManager.moveItemAtURL(localURL, toURL: cacheFile) } catch let error as NSError { print(error) } When catching the error I'm getting:

UITableViewAutomaticDimension not working on iOS 8

风格不统一 提交于 2019-12-22 05:36:10
问题 I was following this tutorial to make self sizing cells. I registered custom cell into table view and in the cell xib I gave every subview constraints manually. Please refer to the source code in GitHub Arranging 3 labels vertically in one cell's content view worked fine in iOS 9 but not in iOS 8 (both tested in device and simulator). In iOS 8 one cell does not have fitting height and not every label shows all it's full text. iOS 8 not fitting: iOS 9 as I expected: Any advice would be

How do I replace MPMoviePlayer notifications?

人盡茶涼 提交于 2019-12-22 05:23:20
问题 In iOS 9 MPMoviePlayer and all his components are deprecated. We used MPMoviePlayerController notifications, like MPMoviePlayerLoadStateDidChangeNotification, MPMovieDurationAvailableNotification, MPMoviePlayerPlaybackStateDidChangeNotification, MPMoviePlayerReadyForDisplayDidChangeNotification , to track video service quality. But now with AVPlayerViewController I can't find properly replacement for these notifications. How do I replace these notifications now? 回答1: AVPlayerViewController is

How localise the key UIApplicationShortcutItemTitle

做~自己de王妃 提交于 2019-12-22 05:02:52
问题 How should I localise the key UIApplicationShortcutItemTitle ? I know how localisation works for keys like NSLocationUsageDescription and NSLocationAlwaysUsageDescription : you put your localisation in the InfoPlist.strings file. However, those are unique keys at the route of the document. In this case, I'll have one UIApplicationShortcutItemTitle for each quick action, nested inside a dictionary and and array. How can I localise these nested values? 回答1: Despite

Strange (bug ?) with Xcode 7 / iOS 9 b5 with dataWithContentsOfURL

↘锁芯ラ 提交于 2019-12-22 04:56:16
问题 I have a part of code who works as expected on all iOS versions, but not on iOS 9: NSData *response = [NSData dataWithContentsOfURL: [NSURL URLWithString: url] options:NSDataReadingUncached error:&error]; It's a simple json text. I got this error: Error Domain=NSCocoaErrorDomain Code=256 "The file “xxx.php” couldn’t be opened." UserInfo={NSURL= http://xxx.xxx.com/xxx/xxx.php?lang=fr } How this url can be intepreted as a file ? Response = nil... Thanks. 回答1: Technically is it because of the

xcode 7.1 for iOS 9 missing libc++.dylib required for Objective C Realm Static Framework

寵の児 提交于 2019-12-22 04:16:11
问题 I am following this doc for integrating realm in my iOS app. Realm static framework for iOS My problem is in step 3. I am unable to find libc++.dylib. I find a few other .tbd ones but none of them are libc++. I followed a few other SO posts on using the "add other" option and doing command+shift+G and find that library but it's not in that list either. Does anyone know any workarounds? 回答1: I had the same problem. I found some kind of way around. Go to Build Phases > Link Binary with