Get device model

Source: Internet
Author: User

Code:

//Add header file#import<sys/utsname.h>-(void) viewdidload {[Super viewdidload]; //additional setup after loading the view, typically from a nib.NSLog (@"--self-machine-%@", [self machinename]);}#pragma-mark-functions//Get device Model-(nsstring*) machinename{structUtsname SystemInfo; Uname (&systemInfo); NSString*result =[NSString stringWithCString:systemInfo.machine encoding:nsutf8stringencoding    ]; returnresult;}/*@ ' i386 ' on the simulator @ ' ipod1,1 ' on ipod touch @ ' ipod2,1 ' on ipod touch Second Generation @ ' ipod3,1 ' on ipod Touch Third Generation @ "ipod4,1" on ipod touch Fourth Generation @ "ipod5,1" on ipod touch Fifth Generation @ "IP hone1,1 ' on iphone @ ' iphone1,2 ' on iphone 3G @ ' iphone2,1 ' on iphone 3GS @ ' ipad1,1 ' on ipad @ ' ipad2,1 ' on ipad 2 @ "ipad 3,1 "on 3rd Generation ipad @" ipad3,2 ": on ipad 3 (GSM+CDMA) @ ' ipad3,3 ': on ipad 3 (GSM) @ ' ipad3,4 ': on ipad 4 (WiFi) @"  ipad3,5 ": On ipad 4 (GSM) @ ' ipad3,6 ': on ipad 4 (GSM+CDMA) @ ' iphone3,1 ' on iphone 4 @ ' iphone4,1 ' on iphone 4S @" iphone5,1 " On iphone 5 @ ' ipad3,4 ' on 4th Generation ipad @ ' ipad2,5 ' on ipad Mini @ ' iphone5,1 ' on iphone 5 (GSM) @ ' iphone5,2 ' on I Phone 5 (GSM+CDMA) @ "iphone5,3 on iphone 5c (GSM) @" iphone5,4 "on iphone 5c (GSM+CDMA) @" iphone6,1 "on iphone 5s (GSM) @" IPhO ne6,2 "on IPhone 5s (GSM+CDMA)*/

Get device model number

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.