xcode9

Xcode 9 throws errors involving 'require'

穿精又带淫゛_ 提交于 2019-12-04 03:58:31
When upgrading code to build under Xcode 9, I see compile errors in code using require and require_noerr : require(length > offsetof(struct blob, cert), outLabel); The first error is: error: implicit declaration of function 'require' is invalid in C99 I also get a lot of error: use of undeclared identifier 'outLabel' . This is in RRTransactionVerifier.m which is Apple code for dealing with receipt validation. How do I fix these errors? Danny Parker require and require_noerr are macros that used to be defined in AssertMacros.h. As of Xcode 9 these macros have changed. The reasons are documented

Sum of 3 UITextField? [closed]

本小妞迷上赌 提交于 2019-12-04 02:42:56
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . https://ibb.co/nH38wG Why the result is 123 and not 6 ? Anyone is able to elaborate and explain it to me please? 回答1: You are adding the text ( String ) values to each other in the label text. You should do this instead: guard let num1 = Int(textField1.text), let num2 = Int(textField2.text), let num3 = Int

UIRefreshControl() in iOS 11 Glitchy effect

瘦欲@ 提交于 2019-12-04 01:48:32
Every time I pull to refresh the TableView, the UIRefreshControl appears to be glitchy. Below is the code I am using. Any Ideas? In AppDelegate: UINavigationBar.appearance().isTranslucent = false UINavigationBar.appearance().barTintColor = UIColor.red UINavigationBar.appearance().tintColor = UIColor.white In UITableViewController: self.tableView.refreshControl = UIRefreshControl() if #available(iOS 11.0, *) { self.navigationController?.navigationBar.prefersLargeTitles = false } else { // Fallback on earlier versions } self.tableView.refreshControl = refreshCont For me self

“Failed to set plugin placeholders” message?

做~自己de王妃 提交于 2019-12-04 00:16:56
Xcode 9.1 Simulator 10.0 OSX 10.12.6 I would like to upload a new build of my sticker pack to iTunes Connect. But Product > Archive is grayed out. So I ran the Simulator and got ""Failed to set plugin placeholders for (name)." Only one answer anywhere in the whole world -- delete Derived Data Folder. I did and got same error message. BTW Under General in Xcode the Version is 1. The build is 1.4. Does the build number have to be changed somewhere else as well? What worked for me, Go to your target Build Phases and on "Embedded App Extensions" check the "Copy only when installing" checkbox. I

Swift 4 Using KVO to listen to volume changes

无人久伴 提交于 2019-12-04 00:15:39
I just updated to Swift 4 and Xcode 9 and got a (swiftlint) warning for the following code telling me that I should use KVO now: Warning: (Block Based KVO Violation: Prefer the new block based KVO API with keypaths when using Swift 3.2 or later. (block_based_kvo)) The old code: override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { if keyPath == "outputVolume"{ guard let newKey = change?[NSKeyValueChangeKey.newKey] as? NSNumber else { fatalError("Could not unwrap optional content of new key") } let

Xcode 9 iOS 10 / 11 Simulators - All Apps Crashing [duplicate]

你离开我真会死。 提交于 2019-12-03 23:07:11
This question already has an answer here : Closed 2 years ago . Xcode 9 iOS Simulator - Unable To Obtain Valid Process Handle (1 answer) I just installed Xcode 9 and tried running the iOS 11 and 10.3.1 simulators. Weirdly, ALL the stock apps in the simulator are crashing / force closing the moment I click on any of them, i.e. Safari, Photos, etc. I've tried it on iPhone X, iPhone 8/8+ and iPhone 6+ simulators with iOS 11 / 10.3.1, all with the same crashing result. If I try it on older iOS simulators such as iPhone 6+ iOS 9.2, then it runs fine. If I try to launch it many times, i.e. 40 - 50

Vapor doesn't work with xcode 9 and swift 4

匆匆过客 提交于 2019-12-03 22:23:03
When I try to compiled my newly created vapor project with Xcode 9 I get 189 compile errors. What's the trick to making this work? I installed vapor and the toolbox, and create via 'vapor new test --template=api' and then 'vapor xcode' to start it up. Check that everything is up to date. The following builds and runs for me at this time: Use latest vapor toolbox. Currently: vapor new test --template=api cd test swift package tools-version # 4.0.0 # use `swift package tools-version --set-current` if needed rm Package.resolved vapor update vapor --version # Vapor Toolbox: 3.1.2 # Vapor Framework

IPhone 6 plus simulator scaling [duplicate]

房东的猫 提交于 2019-12-03 17:33:27
问题 This question already has answers here : How to resize the iPhone/iPad Simulator? (11 answers) Closed last year . Even after scaling the IPhone 6 plus simulator to 50% (No option to scale less than this), the size is still big to work with it. How can i scale down it to 25% or less ? 回答1: Run this in a terminal: defaults write ~/Library/Preferences/com.apple.iphonesimulator SimulatorWindowLastScale "0.4" You may vary "0.4" to your liking. Then, in simulator, hardware-> devices-> iphone 6 plus

How do I use Key-Value Coding in Swfit 4.0?

拥有回忆 提交于 2019-12-03 17:08:45
I never used Swift4 before, and dont know how to use KVC in it. I try to create model with Dictionary, here the code: class Person : NSObject { var name: String = "" var age: Int = 0 init(dict: [String : Any]) { super.init() self.setValuesForKeys(dict) } } let dict: [String : Any] = ["name" : "Leon", "age" : 18] let p = Person(dict: dict) print(p.name, p.age) There I get two question: 1. Why dont I using AnyObject ? "Leon" and 18 was infer to String and Int , does it using in KVC? 2. @objc var name: String = "" , this form is worked, but I can not understand it. Thanks for all helps. To

bottom layout deprecated since ios 11.0

一曲冷凌霜 提交于 2019-12-03 16:27:09
问题 What can I do to fix Bottom layout is deprecated iOS 11, I am using Xcode 9 beta 2. 回答1: Simply check the "Use safe area layout guides" button in the File Inspector of the IB. 回答2: Function of @paper1111 works fine in Xcode Version 9.3.1, but for me not worked first time. After two days of World War with Interface Builder Solution: 1) check the "Use safe area layout guides" button in the File Inspector of the Interface Builder. 2) uncheck the "Use safe area layout guides" button in the File