public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int i = scan.nextInt();
scan.nextLine();
double d = scan.nextDouble();
scan.nextLine();
String s = scan.nextLine();
System.out.println("String: " + s);
System.out.println("Double: " + d);
System.out.println("Int: " + i);
}
Вам просто нужно переместить объявление своего контроллера из вашего метода. Попробуйте вот так:
let aboutController = AboutController(windowNibName: "About")
let preferencesController = PreferencesController(windowNibName: "Preferences")
func showAbout(sender: AnyObject) {
println("showing about window")
aboutController.showWindow(aboutController.aboutWindow)
}
func showPreferences(sender: AnyObject) {
println("showing preferences window")
preferencesController.showWindow(preferencesController.preferencesWindow)
}