Reputation: 21
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?
Upvotes: 1
Views: 3171
Reputation: 37290
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
.
Upvotes: 5