Core Services
iPhone Developer Tips Stats:
|
Sleep, Pause or Block a Thread
If you ever need to briefly pause a thread of execution, there are two class methods in NSThread you can use. Although you have to use these methods judiciously, they can be handy in instances where you need to force a delay in order to achieve some desired effect.
For example, if you want to [...]
Getting the iPhone User Name
The original tip I wrote (shown below) does retrieve the user name, however, giving its undocumented status as well as the returning a string with punctuation removed, the approach suggested by Pascal in the comment section is much better:
[[UIDevice currentDevice] name];
When running this code from my device it returns "John’s iPhone" and when running from [...]








