私はこのエラーになっている:「プロパティ初期化子内インスタンスメンバ 『サーバー』を使用することはできません。自己の利用可能な」前に実行プロパティの初期化子」私のこのコード行ではインスタンスメンバプロパティ初期化子内の「サーバー」を使用することはできません
編集
import UIKit
import ChinoOSXLibrary
class LoginCL: UIViewController {
@IBOutlet weak var emailField: UITextField!
@IBOutlet weak var passField: UITextField!
var loggedUser: LoggedUser!
var customerId = "xxx"
var customerKey = "xxx"
var server = "https://api.test.chino.io/v1"
var chino = ChinoAPI.init(hostUrl: server, customerId: customerId, customerKey: customerKey)
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
どうすれば解決できますか?この行にエラーがあります
var chino = ChinoAPI.init(hostUrl: server, customerId: customerId, customerKey: customerKey)
:
また、あなただけのようinitに値を移動することができます。エラーを出す行だけでなく、コード全体を投稿してください。 –
それを行う@MarcoPace – bero