Tutorials, Free Online Tutorials, publishbookmarks provides tutorials and interview questions of all technology like java tutorial, android, java frameworks, javascript, ajax, core java, sql, python, php, c language etc. for beginners and professionals.
// Get the system version
NSString *versionString;
NSDictionary * sv =[NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
versionString =[sv objectForKey:@"ProductVersion"];NSLog(@"%@", versionString);
NSString* major =@"";
NSString* minjor =@"";
NSArray* majminor =[versionString componentsSeparatedByString:@"."];LOG_INFO("Verify_CORE_ML 26.3");
major =[majminor objectAtIndex:0];LOG_INFO("Verify_CORE_ML 26.4");
minjor =[majminor objectAtIndex:1];
// Get Mac notebook model: Model Identifier// Official model list: https://support.apple.com/en-s/ht201300// Command line View: System_profiler Sphardwaredatatype
size_t len =0;sysctlbyname("hw.model",NULL,&len,NULL,0);if(len){
char*model =(char*)malloc(len*sizeof(char));sysctlbyname("hw.model", model,&len,NULL,0);printf("%s\n", model);// My machine output: macBookpro16,1free(model);}