xcode7

AVAudioPlayer no longer working in Swift 2.0 / Xcode 7 beta

一世执手 提交于 2019-12-19 17:46:25
问题 For the var testAudio declaration in my iPhone app, I am receiving an error here "Call can throw, but errors cannot be thrown out of a property initializer" import UIKit import AVFoundation class ViewController: UIViewController { var testAudio = AVAudioPlayer(contentsOfURL: NSURL (fileURLWithPath: NSBundle.mainBundle().pathForResource("testAudio", ofType: "wav")!), fileTypeHint:nil) This happened when I moved to the Xcode 7 beta. How can I get this audio clip functioning in Swift 2.0? 回答1:

Xcode 7 error: could not read CFBundleIdentifier from Info.plist (null)

♀尐吖头ヾ 提交于 2019-12-19 17:34:44
问题 Getting this Error as below: error: could not read CFBundleIdentifier from Info.plist (null) When I opened Xcode 7, it asked to update app to recommended settings, I did so and then ran the project and received the above error. I haven't changed anything in the project. What do I need to change here? 回答1: Manesh You just need to do update your all info.plist file. Set Bundle identifier, Bundle name again, will work proper. 回答2: Move your info.plist from the Supporting Files in the Project

Xcode adds a lot of <animations/> tag in my storyboard and xib file

妖精的绣舞 提交于 2019-12-19 12:25:11
问题 Just wanna know if anybody has the same issue as mine: Xcode adds a lot of tags into the storyboard I touch. I try to remove but I can't because it keep adding those tags back. It this a bug of the new Xcode I'm using (7.0.1)? 回答1: As of Xcode 7.2 Beta (7C46I) released on 10/28/2015, just like these tags were added automatically when opening a Storyboard or XIB file in Xcode 7 or 7.1 on El Capitan, these tags are now being removed automatically by just opening a Storyboard or XIB file. (It

SWIFT: Changing view controllers with CMDeviceMotion

不羁岁月 提交于 2019-12-19 11:43:24
问题 I am following this article: http://nshipster.com/cmdevicemotion/ On how to use CMDeviceMotion. They named this part of the article: Keep It To Yourself I made a viewcontroller with a identifier called: PromptViewController. I get an error: Use of undeclared type 'PromptViewController' In the section: if let promptViewController = self?.storyboard?.instantiateViewControllerWithIdentifier("PromptViewController") as? PromptViewController {` Here is my full code: // ViewController.swift //

context?.save(nil) coming up with error

旧巷老猫 提交于 2019-12-19 10:34:14
问题 Using Xcode 7 and swift 2.0 if get the following error on the context?.save(nil). Any help is appreciated "cannot use optional chaining on non-optional value of type 'NSManagedObjectContext' func newItem() { let context = self.context let ent = NSEntityDescription.entityForName("CallList", inManagedObjectContext: context) let nItem = CallList(entity: ent!, insertIntoManagedObjectContext: context) nItem.firstname = firstName.text nItem.lastname = lastName.text nItem.phonenumber = phoneNumber

Xcode 7.2: Failed to Locate or generated signing assets, Wild Card App IDs can not be used to create In House Provisioning Profiles

依然范特西╮ 提交于 2019-12-19 10:25:22
问题 I signed an iOS App and WatchKit App & Extension targets with valid provisioning profiles (Separate provisioning profile for each app identifier, and not wild card App ID), Build was archived successfully but when I try to export/save Enterprise build, Xcode auto generate/locate XC: provisioning profile and it also and resets/invalidates previously selected provisioning profiles. I get below error. (even though we are not using Wild Card App IDs) "Failed to Locate or generated signing assets,

Connect to a Server with Invalid Certificate using NSURLSession (swift2,xcode7,ios9)

放肆的年华 提交于 2019-12-19 09:15:14
问题 I'm using Xcode 7, Swift 2, and iOS9. I want to connect to a web service using NSURLSession but I get the following error when I try to connect: 2015-10-13 16:07:33.595 XCTRunner[89220:4520715] NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9813) 2015-10-13 16:07:33.604 XCTRunner[89220:4520571] Error with connection, details: Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to

Unable to open liblaunch_sim.dylib

[亡魂溺海] 提交于 2019-12-19 06:05:32
问题 Today I have updated xcode. when i tried to run project on simulator(ios version < 9.0) I got this error. "Unable to open liblaunch_sim.dylib. Try reinstalling Xcode or the simulator runtime. It ran perfectly on ios9.0 simulator. here is screen shot. please help me. 回答1: This will also occur when you don't have the simulator actually installed within XCode. I recently upgraded to XCode 7.1 and didn't install all simulators and received this same error. Go to Preferences -> Downloads Verify

Unable to open liblaunch_sim.dylib

蓝咒 提交于 2019-12-19 06:05:30
问题 Today I have updated xcode. when i tried to run project on simulator(ios version < 9.0) I got this error. "Unable to open liblaunch_sim.dylib. Try reinstalling Xcode or the simulator runtime. It ran perfectly on ios9.0 simulator. here is screen shot. please help me. 回答1: This will also occur when you don't have the simulator actually installed within XCode. I recently upgraded to XCode 7.1 and didn't install all simulators and received this same error. Go to Preferences -> Downloads Verify

Swift 2: Invalid conversion from throwing function of type to non-throwing function

南楼画角 提交于 2019-12-19 05:08:41
问题 I have some (ugly) self-written code ported to Swift2 and got this error message in a lambda function: What I didn't understand is, that I handle the whole code with the error throwing function JSONObjectWithData and catch the error. I throw nothing in the code. Nevertheless the compiler means that I am throwing an error. I need to understand this behavior. Please be kind because I know that I have to improve my code to make full use of the new error handling concept in swift2. Thank you very