Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

Relying in the size is wrong in so many levels. How about we ask to the system?

- (NSString *) getDeviceModel { struct utsname systemInfo; uname(&systemInfo); return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; } 

Taken from Best way to detect hardware type, iPhone4 or iPhone5?Best way to detect hardware type, iPhone4 or iPhone5?, edzio27 answer.

Relying in the size is wrong in so many levels. How about we ask to the system?

- (NSString *) getDeviceModel { struct utsname systemInfo; uname(&systemInfo); return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; } 

Taken from Best way to detect hardware type, iPhone4 or iPhone5?, edzio27 answer.

Relying in the size is wrong in so many levels. How about we ask to the system?

- (NSString *) getDeviceModel { struct utsname systemInfo; uname(&systemInfo); return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; } 

Taken from Best way to detect hardware type, iPhone4 or iPhone5?, edzio27 answer.

Source Link
3d0
  • 290
  • 6
  • 15

Relying in the size is wrong in so many levels. How about we ask to the system?

- (NSString *) getDeviceModel { struct utsname systemInfo; uname(&systemInfo); return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding]; } 

Taken from Best way to detect hardware type, iPhone4 or iPhone5?, edzio27 answer.