I want graphics card details using objective c.
used IOServiceGetMatchingServices api for it, its working fine in Intel processor machine, but not returning model info for M1 machine. here is the code I was using
used IOServiceGetMatchingServices api for it, its working fine in Intel processor machine, but not returning model info for M1 machine. here is the code I was using
Code Block CFMutableDictionaryRef matchDict = IOServiceMatching("IOPCIDevice"); io_iterator_t iterator; if (IOServiceGetMatchingServices(kIOMasterPortDefault,matchDict, &iterator) == kIOReturnSuccess) { io_registry_entry_t regEntry; while ((regEntry = IOIteratorNext(iterator))) { CFMutableDictionaryRef serviceDictionary; if (IORegistryEntryCreateCFProperties(regEntry, &serviceDictionary, kCFAllocatorDefault, kNilOptions) != kIOReturnSuccess) { IOObjectRelease(regEntry); continue; } const void *GPUModel = CFDictionaryGetValue(serviceDictionary, @"model"); if (GPUModel != nil) { if (CFGetTypeID(GPUModel) == CFDataGetTypeID()) { NSString *modelName = [[NSString alloc] initWithData: (NSData *)GPUModel encoding:NSASCIIStringEncoding]; NSLog(@"GPU Model: %@", modelName); [modelName release]; } } CFRelease(serviceDictionary); IOObjectRelease(regEntry); } IOObjectRelease(iterator); }