我想在iOS上发布NetService,我创建这样的NetService:
import UIKit
override func viewDidLoad() {
super.viewDidLoad()
let dimensions = (width: 200, height: 300)
let control = TestHarness(frame: CGRect(x: dimensions.width / 2, y: dimensions.height / 2, width: dimensions.width, height: dimensions.height))
control.JobTitle = "Developer b2.0" // << -- No overlap in simulator
let contentView = UIView(frame: control.frame.insetBy(dx: -100, dy: -100))
contentView.backgroundColor = #colorLiteral(red: 0.3098039329, green: 0.01568627544, blue: 0.1294117719, alpha: 1)
contentView.addSubview(control)
view.addSubview(contentView)
}
然后我发布它,到目前为止,它可以正常工作。但是当我将类型更改为 else
{
alert("name : "+name+"\ncakedonuts : "+cakedonuts+"\nglazeddonuts : "+glazeddonuts);
return true;
}
时,我得到了以下错误信息:
let netService = NetService(domain: "local.", type: "_demo._tcp.", name: "demo", port: 0)