xcode6

XCode 6.0.1 Enterprise In House Distribution Is Not Creating ipa/plist

喜你入骨 提交于 2019-12-09 10:34:12
问题 After upgrading to XCode 6.0.1, in In House Enterprise Distribution from Archive now creates a .pkg file instead of .ipa/.plist files. This breaks our enterprise distribution system. I haven't found any documentation on this change. Does anyone have any insight on this? 回答1: add key "Application supports iTunes file sharing" value YES or "LSRequiresIPhoneOS" value YES to info.plist before choose Archive now.it will built ipa with xcode 6.0.1 来源: https://stackoverflow.com/questions/26022943

Swift equivalent of Array.componentsJoinedByString?

帅比萌擦擦* 提交于 2019-12-09 07:23:33
问题 In Objective-C we can call componentsJoinedByString to produce a string with each element of the array separated by the supplied string. While Swift has a componentsSeparatedByString method on String, there doesn't appear to be the inverse of this on Array: 'Array<String>' does not have a member named 'componentsJoinedByString' What is the inverse of componentsSeparatedByString in Swift? 回答1: Swift 3.0: Similar to Swift 2.0, but API renaming has renamed joinWithSeparator to joined(separator:)

All IBOutlets become nil after switching to Xcode 6 Beta 5

旧时模样 提交于 2019-12-09 07:00:02
问题 For instance, there is a property in a view controller @IBOutlet weak var nameLabel: UILabel! This property is nil inside viewWillAppear and viewDidLoad , so the app crashes at runtime. It was working fine in Xcode 6 Beta 4. After I switched to Beta 5, it complained about the controller class does not implement its superclass's required members . So I added required init(coder aDecoder: NSCoder!) { super.init(coder: aDecoder) } And that compiler error disappeared. However, the app crashes for

How to solve this error with healthkit?

我是研究僧i 提交于 2019-12-09 06:49:38
问题 I'm adding code for healthkit in my ios Swift app, but I'm getting an error... /* Ask for permission to access the health store */ override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) if HKHealthStore.isHealthDataAvailable(){ healthStore.requestAuthorizationToShareTypes(typesToShare, readTypes: typesToRead, completion: {(succeeded: Bool, error: NSError!) in if succeeded && error == nil{ println("Successfully received authorization") } else { if let theError = error{

IBOutlets and IBactions require ! in the end

浪子不回头ぞ 提交于 2019-12-09 06:04:23
问题 I tried to start and go from Obj-C to Swift today and I was reading the documentation. I tried to create an easy IBOutlet in Swift and it constantly gave me those errors. View Controller has no initialiser required init(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } IBOutletproperty has non-optional type 'UILabel' and that constantly pops up with this code: @IBOutlet var outputLabel : UILabel but when I add an ! mark, it's running without errors like so

Xcode 6 adds two dots (periods) when coding in Swift for prediction

不打扰是莪最后的温柔 提交于 2019-12-08 18:41:22
问题 Whenever I am typing and want to access functions for a specific object, Xcode adds a second dot after the first one that I have typed. This is frustrating because I have to manually remove one of them every time. Is there a way to change this? 回答1: If your swift files contain Unicode characters, auto completion will fail even if the characters are comments. So just delete all the Unicode characters, and the auto completion feature will work well ! 回答2: I have found that when I had the

Xcode 6: 'Answers.h' file not found after Fabric Crashlytics update

萝らか妹 提交于 2019-12-08 18:18:37
问题 I was working along in my storyboard in Xcode 6.3.2 on an Objective-C project. All of a sudden when I try to build I get an error: /.../Developer/ProjectName/Crashlytics.framework/Headers/Crashlytics.h:14:9: 'Answers.h' file not found I've had Crashlytics installed and working in my app for a few weeks. I have it running through the Fabric plugin. I switched over the the Fabric app and noticed it had recently updated Crashlytics. In Xcode if I go "Source Control" -> "Commit..." to look at my

How to initialize UIBezierPath to draw a circle in swift?

折月煮酒 提交于 2019-12-08 17:18:44
问题 I'm trying to draw a circle in Swift, but when I write my code I get a error "could not find an overload for 'init' that accepts the supplied arguments. In the class UIBezierPath there is a init function: init(arcCenter center: CGPoint, radius: CGFloat, startAngle: CGFloat, endAngle: CGFloat, clockwise: Bool) -> UIBezierPath But when I declared this with this code I get the error.. Need I cast any variable to other type? but if I compiled this in iphone 4 I don't get the error, only in iphone

pickerView shows up as question marks instead of data?

独自空忆成欢 提交于 2019-12-08 16:31:51
问题 I am trying to add a pickerview to my iphone application but instead of showing string from my array it shows question marks. Does anyone know why? I've been trying to figure it out for the past hour... Here is my code of the controller that contains the pickerview: class NewIssueViewController: UIViewController, UIPickerViewDelegate { var componentArr = ["component1","component2","component3","component4"] override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after

How to adjust font size of text in a UIButton to fit the width programmatically in Swift?

拟墨画扇 提交于 2019-12-08 15:29:14
问题 I am trying to set the text in my UIButton programmatically, but the text becomes abbreviated when displayed in the button. Is there a way to adjust the font size of the text in the button to fit the width, through code? I have checked other questions, but the answers do not solve my problem. Thanks. 回答1: Add this line for button object: button.titleLabel?.adjustsFontSizeToFitWidth = true 回答2: If you work with the titleLabel you can use UILabel's adjustsFontSizeToFitWidth https://developer