Jump to content

iPhone: opening url from button to safari


4 posts in this topic

Recommended Posts

hello,

 

i want to open a url from a UIButton in iPhone. I've attached this method to an IB button:

 

 - (IBAction)doSendCode:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]];
}

 

When the method is called, the app shrinks away like it's going to open safari, but the whole simulator quits. There is no crash alert popup, so I am wondering if I'm doing something wrong or that's supposed to happen in the simulator.

Link to comment
Share on other sites

hello,

 

i want to open a url from a UIButton in iPhone. I've attached this method to an IB button:

 

 - (IBAction)doSendCode:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.google.com"]];
}

 

When the method is called, the app shrinks away like it's going to open safari, but the whole simulator quits. There is no crash alert popup, so I am wondering if I'm doing something wrong or that's supposed to happen in the simulator.

 

Well... I'm not 100% sure but I downloaded some seismic indicator application from the Apple iPhone developer site and I think it was designed to do something similar... (when something was clicked a url was launched) and it too just 'ended' when you did the actual click...

 

You might want to find that code and check it out...

 

HTHs

 

Dave

Link to comment
Share on other sites

 Share

×
×
  • Create New...