chapffy
(chapffy)
1
I have a error that after i build my code and i'm not sure how to fix this.
class AddNotesController : UIViewController {
var delegate: AddNotesDelegate?
@IBOutlet weak var addNote: UIBarButtonItem!
@IBOutlet weak var textfield: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(textfield)
textfield!.becomeFirstResponder()
}
The errors that i received would be view.addSubview(textfield)
chwastek
(Filip Chwastowski)
2
@chapffy did you hook all outlets and do they have correct naming? and if you're using IBOutlets why bother adding these views manually?
see:
https://developer.apple.com/library/archive/referencelibrary/GettingStarted/DevelopiOSAppsSwift/ConnectTheUIToCode.html