My objective is to collect the OS Version, release details of MAC 10.10.
I have found a way to collect the version details in MAC 10.10 and as well as from prev. version from the link
How do I determine the OS version at runtime in OS X or iOS (without using Gestalt)?
While I compile it is throwing error at "objc_msgSend_stret", when i search the /usr/include/objc folder itself was not exist in my MAC. i could see only gcc present and all my code was build with it.
Is there any best way to copy the output of
[[NSProcessInfo processInfo], @selector(operatingSystemVersion)] to a struct as "MyOperatingSystemVersion"?
typedef struct {
NSInteger majorVersion;
NSInteger minorVersion;
NSInteger patchVersion;
} MyOperatingSystemVersion;
if ([[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)]) {
MyOperatingSystemVersion version = ((MyOperatingSystemVersion(*)(id, SEL))objc_msgSend_stret)([NSProcessInfo processInfo], @selector(operatingSystemVersion));
// do whatever you want with the version struct here
}
else {
UInt32 systemVersion = 0;
OSStatus err = Gestalt(gestaltSystemVersion, (SInt32 *) &systemVersion);
// do whatever you want with the systemVersion as before
}