Call the iphone map, phone, email, SMS and content method

Source: Internet
Author: User

The code is as follows

-(ibaction) Openmaps {

Where is Apple on the map anyway?

nsstring* Addresstext = @ "1 Infinite Loop, Cupertino, CA 95014";

URL encode the spaces

Addresstext = [Addresstext stringbyaddingpercentescapesusingencoding:nsasciistringencoding];

nsstring* Urltext = [NSString stringwithformat:@ "http://maps.google.com/maps?q=%@", Addresstext];

Lets throw this text on the "so we can view" URL in the event we have a issue

NSLog (Urltext);

[[UIApplication sharedapplication] Openurl:[nsurl Urlwithstring:urltext]];

}

-(ibaction) Openemail {

Fire off a email to Apple support

[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "mailto://devprograms@apple.com"];

}

-(ibaction) Openphone {

Call Google 411

[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "tel://8004664411"];

}

-(ibaction) opensms {

Text to Google SMS

[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "sms://466453"];

}

-(ibaction) Openbrowser {

Lanuch any IPhone developers fav site

[[UIApplication sharedapplication] openurl:[nsurl urlwithstring:@ "http://itunesconnect.apple.com"];

}

Automatically fill in SMS content

The code is as follows

Mfmessagecomposeviewcontroller *picker = [[Mfmessagecomposeviewcontroller alloc] init];

Picker.messagecomposedelegate = self;

picker.recipients = [Nsarray arraywithobject:@ "48151623"];

Picker.body = @ "body text."

[Self presentmodalviewcontroller:picker animated:yes];

[Picker release];

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.