How do I get the device name?

3k views Asked by At

I'm trying to get the device name and make it visibile on a UILabel but I don't know how (Yes, I'm new on XCode). I know I should use[UIDevice currentDevice] but I don't know where and how to make the name visible.

So, where should I use UIDevice? And how can I make the name visible on a UILabel?

1

There are 1 answers

10
Lyndsey Scott On

Use label.text = [UIDevice currentDevice].name;

Edit: Write it in your .m file. If you want to set it as soon as the view loads, insert the code in viewDidLoad.