alpineedge3 Posted March 31, 2008 Share Posted March 31, 2008 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 More sharing options...
DaveGee Posted March 31, 2008 Share Posted March 31, 2008 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 More sharing options...
cpatch Posted April 1, 2008 Share Posted April 1, 2008 Try launching Safari on the simulator before you run your app. That worked for me with the seismic indicator demo app. Craig Link to comment Share on other sites More sharing options...
alpineedge3 Posted April 2, 2008 Author Share Posted April 2, 2008 Try launching Safari on the simulator before you run your app. That worked for me with the seismic indicator demo app. Craig @cpatch: That trick worked nicely. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts