IOS network with multi-threaded--8. Use of Baidu maps (call system browser)

Source: Internet
Author: User

Open Baidu Map by calling the device's own browser

1 //1. Define a method to open the features of Google Maps2-(ibaction) openmaps3 {4     //2. Define a string, as the current location of Baidu map abandoned5NSString *addresstest =@"";6     //3. In the request URL path, if the Chinese language is included, the request will be unsuccessful. This is the need to convert the Chinese parameter to the U.S. Standard Information Interchange code. 7Addresstest =[Addresstest stringbyaddingpercentescapesusingencoding:nsasciistringencoding];8     //4. Define a full URL path9NSString *urltext = [NSString stringWithFormat:@"http://map.baidu.com%@", addresstest];TenNSLog (@"urltext======%@", urltext); One      A     //5. Get the application singleton object, and then call the object's open URL method to open the URL of the specified path - [[uiapplication sharedapplication] Openurl:[nsurl Urlwithstring:urltext]]; -}

Add a call to the Viewdidload function after the second method

1 [self openmaps];

Operation Result:

IOS network with multi-threaded--8. Use of Baidu maps (call system browser)

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.