当我在swift 2中构建我的应用程序时遇到问题.Xcode说:
'required'initulator'init(coder :)'必须由'UIView'的子类提供
这是该类的代码:
class creerQuestionnaire: UIView {
@IBOutlet weak var nomQuestionnaire: UITextField!
@IBOutlet weak var question: UITextField!
@IBOutlet weak var reponse: UITextField!
var QR: Questionnaire
@IBAction func creerQuestion(sender: AnyObject) {
QR.ajouterQuestion(question.text!, nouvReponse: reponse.text!)
}
}
Run Code Online (Sandbox Code Playgroud)
这是班级调查问卷:
import Foundation
class Questionnaire {
var QR = [String(), String()]
func getQuestion(nbQuestion: Int) ->String {
return QR[nbQuestion]
}
func getReponse(nbReponse: Int) ->String {
return QR[nbReponse]
}
func ajouterQuestion(nouvQuestion: String, nouvReponse: String) {
QR += [nouvQuestion, nouvReponse]
}
}
Run Code Online (Sandbox Code Playgroud)
留言Merci!
我尝试在ios真实设备上运行react-native应用程序。它在模拟器或使用 xcode 的设备上运行良好,但我想使用命令行运行我尝试了以下操作:
>npm install -g ios-deploy
>react-native run-ios --device "My iPhone"
Run Code Online (Sandbox Code Playgroud)
这就是我得到的:
info Found Xcode workspace "Project.xcworkspace"
info Building (using "xcodebuild -workspace Project.xcworkspace -configuration Debug -scheme Project -destination id=00008020-0001395426EA002E")
......................................................................
2020-04-06 11:15:02.836 xcodebuild[16724:402803] DTDeviceKit: deviceType from 00008020-0001395426EA002E was NULL
2020-04-06 11:15:02.967 xcodebuild[16724:402797] DTDeviceKit: deviceType from 00008020-0001395426EA002E was NULL
info Installing and launching your app on My iPhone
Run Code Online (Sandbox Code Playgroud)
该应用程序出现在我的 iPhone 中,但未运行。
地铁在新航站楼开通,但我只得到这个:
###### ######
### #### #### ###
## ### ### ##
## #### ##
## #### ##
## ## …
Run Code Online (Sandbox Code Playgroud)