KAREEM MAHAMMED
KAREEM MAHAMMED

Reputation: 1695

Opening iPhone Map into our iPhone App as a one of View?

In My Application I Want use Native iPhone Application. For this purpose i get the code as below

UIApplication *app = [UIApplication sharedApplication];
[app openURL:[NSURL URLWithString: @"http://maps.google.com/maps?q=London"]];

It is Working Fine. But it will come outs from the My App. I want Show this is as one of my screens such like We opening Camera in Our apps as a Screen. Similarly i want to show iPhone Native App as a one of my View in My Application.

Upvotes: 0

Views: 223

Answers (3)

Maulik
Maulik

Reputation: 19418

I suppose that you dont want to use MKMapKit as you didn't mentioned. If you want to show a web page in your app with request URL then you can do it with UIWebView.

You can load your request URL in web view as :-

NSString * urlStr = @"http://maps.google.com/maps?q=London" ;
NSURL *url = [NSURL URLWithString:urlStr];
[webview loadRequest:[NSURLRequest requestWithURL:url]];

(2) i want to show iPhone Native App as a one of my View in My Application

For that you can NOT.

Upvotes: 0

Brayden
Brayden

Reputation: 1795

You cannot show another app as a direct view in your application. Instead you'll need to add the MKMapKit framework to your project, make a new UIViewController in your project and in Interface Builder add in the MapKit UI element. You can find tutorials online on how to use MapKit in your app to load specific areas on the map and do really neat things with it.

EDIT: http://www.raywenderlich.com/2847/introduction-to-mapkit-on-ios-tutorial

Upvotes: 1

Lee Armstrong
Lee Armstrong

Reputation: 11452

You need to use MKMapView if you want a native map.

If you want to pass it a location like that you will also need to do some geocoding. Apple provide all of these API's but it isn't one line of code!

Upvotes: 0

Related Questions