iOS[UIApplication shared Application]openURL 등 자주 사용 하 는 방법:전화,위치 확인 등

1773 단어 iOSOC•사과
전화 하 다
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://    "]];

2.문자 보 내기
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"sms://    "]];

3.앱 위치 설정 권한 설정
NSURL *settingsURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];

[[UIApplicationsharedApplication] openURL:settingsURL];

4.Safari 를 호출 하여 페이지 열기
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://eyecm.com"]];

5,APP 상점 호출
NSURL *url= [NSURL URLWithString:@"http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=291586600&mt=8"];

[[UIApplication sharedApplication] openURL:url];

6.appstore 상점 리 뷰 호출
NSInteger apple_id = 121212;

NSString *str = [NSString stringWithFormat:

                                 @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%ld",

                                 (long)apple_id ];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]];

7.메 일 클 라 이언 트 호출(Apple Mail)
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://[email protected]"]];

8.구 글 맵 호출(구 글 맵 스)
NSString *searchQuery = @"1 Infinite Loop, Cupertino, CA 95014";

searchQuery = [addressText stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];

NSString *urlString=[NSString stringWithFormat:@"http://maps.google.com/maps?q=%@", searchQuery];

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlText]];

좋은 웹페이지 즐겨찾기