sqweek / dialog

Simple cross-platform dialog API for go-lang
ISC License
493 stars 76 forks source link

What's the minimum required Xcode version? #30

Closed mathielo closed 4 months ago

mathielo commented 5 years ago

From the docs:

OSX: uses Cocoa's NSAlert/NSSavePanel/NSOpenPanel classes

Checking their docs, NSAlert / NSSavePanel / NSOpenPanel requires the macOS SDK 10.3+.

We're tried to build a project using dialog in a fairly old Mac with Xcode 7.2.1, which supports macOS SDK 10.11.2, but we got these errors:

# github.com/sqweek/dialog/cocoa
In file included from dlg.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:43:12: error: unknown property attribute 'class'
In file included from dlg.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSString.h:38:
/System/Library/Frameworks/Foundation.framework/Headers/NSItemProvider.h:36:12: error: unknown property attribute 'class'
/System/Library/Frameworks/Foundation.framework/Headers/NSItemProvider.h:41:71: error: property has a previous declaration
/System/Library/Frameworks/Foundation.framework/Headers/NSItemProvider.h:36:78: note: property declared here
/System/Library/Frameworks/Foundation.framework/Headers/NSItemProvider.h:60:12: error: unknown property attribute 'class'
In file included from dlg.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:290:12: error: unknown property attribute 'class'
/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:296:12: error: unknown property attribute 'class'
In file included from dlg.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:11:
/System/Library/Frameworks/Foundation.framework/Headers/NSNotification.h:44:12: error: unknown property attribute 'class'
In file included from dlg.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:32:12: error: unknown property attribute 'class'
/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:43:12: error: unknown property attribute 'class'
/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:44:12: error: unknown property attribute 'class'
In file included from dlg.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:14:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h:7:
/System/Library/Frameworks/Foundation.framework/Headers/NSDate.h:45:12: error: unknown property attribute 'class'
/System/Library/Frameworks/Foundation.framework/Headers/NSDate.h:57:12: error: unknown property attribute 'class'
/System/Library/Frameworks/Foundation.framework/Headers/NSDate.h:58:12: error: unknown property attribute 'class'
In file included from dlg.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:14:
/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h:106:12: error: unknown property attribute 'class'
/System/Library/Frameworks/Foundation.framework/Headers/NSCalendar.h:107:12: error: unknown property attribute 'class'
In file included from dlg.m:1:
In file included from /System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:15:
/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:20:22: error: unknown property attribute 'class'
/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:21:22: error: unknown property attribute 'class'
/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:22:22: error: unknown property attribute 'class'
/System/Library/Frameworks/Foundation.framework/Headers/NSCharacterSet.h:23:22: error: unknown property attribute 'class'

We tried in a different mac with Xcode 9.1 and it worked without any issues. Didn't try with Xcode 8, not sure whether it works with it.


Anyway, the point is: what is the actual minimum supported Xcode version - and perhaps it could be added to the docs by the required Cocoa's classes? I know most people are always on latest versions, but every now and then someone needs to run stuff in older machines and it's nice to know the exact requirements. :bulb:

sqweek commented 5 years ago

what is the actual minimum supported Xcode version

Good question! Thanks for sharing your findings here; I don't even have a real mac to test on, nor spare time to test with ;)

sqweek commented 4 months ago

81 introduced the use of NSApplicationActivationPolicyAccessory which requires macOS 10.6+; I've updated the README to reflect this.