ios9

'invalid context 0x0' after Migration to iOS 9

随声附和 提交于 2019-12-03 11:01:53
问题 I've migrated the app to iOS 9, and it works as usually, but there three log messages: <Error>: CGContextSaveGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. <Error>: CGContextTranslateCTM: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW_BACKTRACE environmental variable. <Error>: CGContextRestoreGState: invalid context 0x0. If you want to see the backtrace, please set CG_CONTEXT_SHOW

Dynamic Type and Self-Sizing Cells with Static Table

坚强是说给别人听的谎言 提交于 2019-12-03 10:38:16
I have a typical master-detail app that allows the user to browse a scrolling list of objects, and then drill to detail for any particular object with a push segue. The scrolling master list is a UITableView built with prototype cells, and the detail scene is a static UITableView with a fixed number of sections and cells. I would like to implement Dynamic Type and Self-Sizing Cells in my app so that the user can change the base font size. So far, I have been successful making self-sizing cells with the scrolling list of prototype cells: by using Auto Layout, setting number of lines in each

In 7.3/9/2+ Swift how to disable rotation animation, when device rotates?

自闭症网瘾萝莉.ら 提交于 2019-12-03 10:16:26
This question is strictly about iOS9+ Say you have an ordinary modern app (autolayout, storyboard, universal) which does allow all four rotation positions you want it to autorotate in the normal way, so it will change to your new constraint-based layouts when user rotates device from landscape to portrait But you simply want NO animation during the user rotating the device. You want it to just "click" to the new sideways or upright layout. The only way I have been able to achieve this is by adding: override func viewWillTransitionToSize(size:CGSize, withTransitionCoordinator coordinator

How unwindForSegue:towardsViewController: works?

余生颓废 提交于 2019-12-03 09:58:57
问题 In my simple app, I have created some controllers with basic segues between them: Yellow controller -> BlueController -> GreenController -> OrangeController . Every of them has its own custom class. From OrangeController I created unwindSegue to my YellowController . It is ok. Within every class I put: override func unwindForSegue(unwindSegue: UIStoryboardSegue, towardsViewController subsequentVC: UIViewController) { print(unwindSegue) print(subsequentVC) } But it was not called at all. Why?

iOS9 - UITableViewCellContentView is covering up Controls inside Cell

本小妞迷上赌 提交于 2019-12-03 09:51:12
问题 I have made a custom UITableViewCell called "SwitchCell" that has a switch. In iOS9 Only, using Xcode 7 beta, the Content view in the cell is on top of the switch. (See screenshot of View Hierarchy. You can clearly see that the content view of the cell is on top of the other views. ): So all the touches to the UISwitch are intercepted, and the IBAction does not fire. In iOS8, this is not a problem. See screenshot for iOS 8.4 simulator. You can see that there is no content view on top of the

Programmatically Link CNContacts

旧时模样 提交于 2019-12-03 09:39:06
In my app, I want to create a new contact. If a contact with the same name already exists, I want to link the new contact to the old one. I have looked into the CNContact and CNContactStore references, and don't see any way to link contacts. Is this possible, and if so, how? In IOS9 contacts in different accounts that represent the same person may be automatically linked together. To achieve this you should make sure that the name of your newly inserted contact matches the name of the contact you would like to unify with. The documentation linked below gives the example of "John Appleseed" on

ios 9 and NSAppTransportSecurity

这一生的挚爱 提交于 2019-12-03 08:29:41
There is a problem with iOS 9 and work with the server. I info.plist set: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> When you run the application through Xcode, everything is fine. Work with the server takes place perfectly. But as soon as I stop the application and try to run it by simply clicking on the icon in the simulator. The network stops working. The same problem when I send the application to the Review in TestFlight. The application is installed, but the network stops working again. Xcode 7.0 (7a220) iOS 9.0 Are you sure it's not

Splash screen animation is not supporting with Xcode 7 GM(iOS9). App crashes with an error

北战南征 提交于 2019-12-03 08:24:46
In my application i am using the below code to show an animated splash screen. App working fine in Xcode-6.4(iOS 8), but coming to Xcode-7GM version(iOS9) app crashes with an error. window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; imageArray = [[NSMutableArray alloc] initWithCapacity:IMAGE_COUNT]; // Build array of images, cycling through image names for (int i = 1; i <= IMAGE_COUNT; i++) [imageArray addObject:[UIImage imageNamed: [NSString stringWithFormat:@"image__%d.png",i]]]; animationImageView = [[UIImageView alloc] initWithFrame:self.window.bounds];

AVPlayer not playing audio - iOS 9, Objective - C

会有一股神秘感。 提交于 2019-12-03 08:12:06
I am trying to play audio from a URL in my app. Everything happens as expected in iOS 8 (simulator and physical devices). For iOS 9, it works in simulator but on device, the audio simply does not play. The streaming appears, if I click on play, the progress bar also shows that audio is getting loaded and playing but the sound does not come. This issue is happening in iOS 9 physical device. It works totally fine with iOS 8 physical device. I created a simple button. On clicking on button, the AVPlayerViewController is loaded and AVPlayer is initialized with the given URL. The code is following:

Base64 Encoding/Decoding with Swift 2

别来无恙 提交于 2019-12-03 07:58:41
My code was working well on Xcode 6.4 with Swift 1.2: var imageData = UIImageJPEGRepresentation(firstImageView.image!, 0.2) let base64String = imageData!.base64EncodedStringWithOptions(.allZeros) Once I moved to Xcode 7 and Swift 2 the following error appeared: type of expression is ambiguous without more context So I tried: let base64String = imageData!.base64EncodedStringWithOptions(options: NSDataBase64EncodingOptions.allZeros) But there is no "allZeros" option among NSDataBase64EncodingOptions. You should use .Encoding64CharacterLineLength instead of .allZeros : let imageData =