Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

eplefrik

macrumors newbie
Original poster
Mar 25, 2012
15
0
Hi!

This code open a url in safari on click:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:mad:"http://www.apple.com"]];

But I don't know where the code should be. I tried to put in in ViewController.m below the viewDidUnload. But I can't get the button to work.

I'm new with XCode, so hope someone can help me.

Sorry for my english.
 
Last edited:
What you posted is just a piece of code, you need to put it inside a method.

You would benefit a lot from reading about Objective-c
 
What you posted is just a piece of code, you need to put it inside a method.

You would benefit a lot from reading about Objective-c

Ok, thanks! But can you give me the whole code, and where I should insert it?
 
No I will not give you the whole code, what good will that do you?

You need to start in baby steps and then improve. You wont improve if you don't understand how method, Objects etc works.

So as i stated, start by learning something about the basics of the language you want to code in.

I dont say this to be a douche, but to be honest, if you skip over the basics, you will never understand how to code stuff.
 
No I will not give you the whole code, what good will that do you?

You need to start in baby steps and then improve. You wont improve if you don't understand how method, Objects etc works.

So as i stated, start by learning something about the basics of the language you want to code in.

I dont say this to be a douche, but to be honest, if you skip over the basics, you will never understand how to code stuff.

Okey, but do you know about some good webpages where I can learn about Objective-C ?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.