needs to parse the string by yourself.
2. If you only need to obtain the hardware type, such
IPhone,
IPod Touch
IPhone SimulatorAnd so on.
+ (STD: string) getiosdevicename;
Implementation:
+ (STD: string) getiosdevicename
{
Nsstring * nsmodelname = [[uidevicecurrentdevice] model];
Return [nsmodelnameUtf8string];
}
The machineName value is as follows: "iPhone1, 1" => "iPhone 1G ",
"IPhone1, 2" => "iPhone 3G ",
"IPhone E2, 1" => "iPhone 3GS ",
"IPhone3, 1" => "iPhone 4 ",
"IPhone3, 2" =
[Code Note] Get the device model, note the device model
I. Code.
-(Void) viewDidLoad {[super viewDidLoad]; // Do any additional setup after loading the view. NSLog (@ "-- self-machine-% @", [self machineName]) ;}# pragma-mark-functions // obtain the device model-(NSString *) machineName {struct utsname systemInfo; uname ( systemInfo); NSString * result = [NSString stringWithCString: systemInfo. machine encoding: NSUTF8StringEncoding]; return result;}/* @ "i386" on the simulator @ "iPod1, 1" on i
[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "sms://888588"]; Call your own browser safari [[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:@ "http://url"]; Also: itms://can open Mobilestore.app audio-player-event://can open ipod audio-player-event://?uicmd= Show-purchased-playlist can open ipod playlist video-player-event://can open video in ipod3. No lock screen U
://888588"]; Call your own browser safari [[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:@ "http://url"]; Also: itms://can open Mobilestore.app audio-player-event://can open ipod audio-player-event://?uicmd= Show-purchased-playlist can open ipod playlist video-player-event://can open video in ipod3. No lock screen UIApplication *app = [uiapplication sharedapplication]; app.idletimerdisa
isEqualToString: @" iPhone2, 1 "]) return @" iPhone 3GS "; if ([deviceString isEqualToString: @ "iPhone3, 1"]) return @ "iPhone 4"; if ([deviceString isEqualToString: @ "iPhone4, 1"]) return @ "iPhone 4 S "; if ([deviceString isEqualToString: @ "iPhone5, 2"]) return @ "iPhone 5"; if ([deviceString isEqualToString: @ "iPhone3, 2"]) return @ "Verizon iPhone 4"; if ([deviceString isEqualToString: @ "iPod1, 1"]) return @ "iPod Touch 1G"; if ([deviceString isEqualToString: @ "iPod2, 1"]) return @ "i
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.