I want to detect my current device name. How do I detect it through iPhone SDK? Also how do I detect if the iPhone doesn't have a SIM inserted?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- back button text does not change
相关文章
- 现在使用swift开发ios应用好还是swift?
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- How can I add media attachments to my push notific
- How do you detect key up / key down events from a
- “Storyboard.storyboard” could not be opened
Whether you are on an iPhone or a iPod Touch:
To detect the version of the OS:
To detect a specific model, you would need to test for some capability that only that model has, so to detect an iPhone 3GS, check for a video capability on the camera:
What you are looking for is this:
This will return whether the device is an iPhone or iPod touch
From the UIDevice.h file:
Here is a class written by Erica Sadun that provides extensive capabilities for this:
http://github.com/erica/uidevice-extension/blob/master/UIDevice-Hardware.m
Check out the rest of the repo - there are a few more classes that would prove to be really useful for fine-grained device querying.