Sure there are some changes from Yosemite or some other version to Sierra, but major apps still support earlier versions and there is no problem getting started on an earlier OS. I have had a quick look at the tutorial and I think the main requirement is the ability run Xcode, so you can get started. You might find a minor difference but there is no reason to avoid it completely.
That said think about updating that MacBook some timeā¦ itās good to be current especially in the Apple world.
(Sarahās answer beat me by a minute - thereās two people encouraging you.)
Thanks for the macOS tutorials! Iāve wanted to program for the Mac for a long time. Hoping to be able to leverage my iOS knowledge.
Iāve followed the tutorial but I canāt get the helloLabel to display the greeting. It will always only show āHelloā, even though the greeting variable is getting set properly to either Hello World! in the case of an empty name field, or āHello Steveā when I enter my name. Hereās what I get when I print the value of the greeting variable:
Printing description of greeting:
"Hello Steve!"
Iāve disconnected and reconnected the outlet for the label but no joy. Hereās my code:
import Cocoa
class ViewController: NSViewController {
@IBOutlet weak var nameField: NSTextField!
@IBOutlet weak var helloLabel: NSTextField!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
override var representedObject: Any? {
didSet {
// Update the view, if already loaded.
}
}
@IBAction func sayButtonClicked(_ sender: Any) {
var name = nameField.stringValue
if name.isEmpty {
name = "World"
}
let greeting = "Hello \(name)!"
helloLabel.stringValue = greeting
}
}
EDIT: I figured it out. I had selected the label, then Edit > Resize to Fit Content, thinking it would automatically resize the field to fit whatever content would be in the field, now or in the future. Bad thinking. Resized label to be full screen width and all is well. It just ended up that it was truncating the text right after āHelloā which threw me.
Very helpful tutorial but I am having one problem following it in the section mentioning āGo back to Main.storyboard and click on the button to select it. In the Utilities panel on the right, make sure the Attributes Inspector is showing ā the 4th button across the top.ā
The problem I have is that Main.storyboard opens in a separate window, and when I click on the View Controller, the Attributes Inspector panel of the main XCode window just says āNot Applicableā. I am not sure how to resolve this.
I have recently upgraded to MAC OS Sierra and I got this error āMac app that is damaged and canāt be openedā. Anyone knows how to resolve this error?
I am a bit confused as to how you could get this error with an app you have built yourself from Xcode. It is a misleading error message that usually indicates macOSās security is blocking the app from running.
The sample project does not code sign the app, but I thought that apps you build yourself in Xcode were exempt from these restrictions.
Try right-clicking on the app and selecting Open to see if that can bypass the security settings, after a confirmation dialog.
One other possible fix is to go to System Preferences - Security & Privacy. In the General tab, change the āAllow apps downloaded from:ā setting to āApp Store and identified developersā.
This tutorial is more than six months old so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]