This question already has answers here:
Determine device (iPhone, iPod Touch) with iOS
(31 answers)
How to get device make and model on iOS?
(23 answers)
Closed 9 years ago.
How can I check if device is 4 or 4s?
Is there a way for me to do this? I want to check because I am using a UINavigationBar blur, and it for my situation it doesn't look good without the blur, so I will change it if it is an iPhone 4.
Ypu can do it like this:
#import <sys/utsname.h>
NSString*
machineName()
{
struct utsname systemInfo;
uname(&systemInfo);
return [NSString stringWithCString:systemInfo.machine
encoding:NSUTF8StringEncoding];
}
The result should be like this:
//Simultor
#"i386" on 32-bit Simulator
#"x86_64" on 64-bit Simulator
//iPhone
#"iPhone1,1" on iPhone
#"iPhone1,2" on iPhone 3G
#"iPhone2,1" on iPhone 3GS
#"iPhone3,1" on iPhone 4 (GSM)
#"iPhone3,3" on iPhone 4 (CDMA/Verizon/Sprint)
#"iPhone4,1" on iPhone 4S
#"iPhone5,1" on iPhone 5 (model A1428, AT&T/Canada)
#"iPhone5,2" on iPhone 5 (model A1429, everything else)
#"iPhone5,3" on iPhone 5c (model A1456, A1532 | GSM)
#"iPhone5,4" on iPhone 5c (model A1507, A1516, A1526 (China), A1529 | Global)
#"iPhone6,1" on iPhone 5s (model A1433, A1533 | GSM)
#"iPhone6,2" on iPhone 5s (model A1457, A1518, A1528 (China), A1530 | Global)
#"iPhone7,1" on iPhone 6 Plus
#"iPhone7,2" on iPhone 6
#"iPhone8,1" on iPhone 6S
#"iPhone8,2" on iPhone 6S Plus
#"iPhone8,4" on iPhone SE
#"iPhone9,1" on iPhone 7 (CDMA)
#"iPhone9,3" on iPhone 7 (GSM)
#"iPhone9,2" on iPhone 7 Plus (CDMA)
#"iPhone9,4" on iPhone 7 Plus (GSM)
//iPad 1
#"iPad1,1" on iPad - Wifi (model A1219)
#"iPad1,1" on iPad - Wifi + Cellular (model A1337)
//iPad 2
#"iPad2,1" - Wifi (model A1395)
#"iPad2,2" - GSM (model A1396)
#"iPad2,3" - 3G (model A1397)
#"iPad2,4" - Wifi (model A1395)
// iPad Mini
#"iPad2,5" - Wifi (model A1432)
#"iPad2,6" - Wifi + Cellular (model A1454)
#"iPad2,7" - Wifi + Cellular (model A1455)
//iPad 3
#"iPad3,1" - Wifi (model A1416)
#"iPad3,2" - Wifi + Cellular (model A1403)
#"iPad3,3" - Wifi + Cellular (model A1430)
//iPad 4
#"iPad3,4" - Wifi (model A1458)
#"iPad3,5" - Wifi + Cellular (model A1459)
#"iPad3,6" - Wifi + Cellular (model A1460)
//iPad AIR
#"iPad4,1" - Wifi (model A1474)
#"iPad4,2" - Wifi + Cellular (model A1475)
#"iPad4,3" - Wifi + Cellular (model A1476)
// iPad Mini 2
#"iPad4,4" - Wifi (model A1489)
#"iPad4,5" - Wifi + Cellular (model A1490)
#"iPad4,6" - Wifi + Cellular (model A1491)
// iPad Mini 3
#"iPad4,7" - Wifi (model A1599)
#"iPad4,8" - Wifi + Cellular (model A1600)
#"iPad4,9" - Wifi + Cellular (model A1601)
// iPad Mini 4
#"iPad5,1" - Wifi (model A1538)
#"iPad5,2" - Wifi + Cellular (model A1550)
//iPad AIR 2
#"iPad5,3" - Wifi (model A1566)
#"iPad5,4" - Wifi + Cellular (model A1567)
// iPad PRO 12.9"
#"iPad6,3" - Wifi (model A1673)
#"iPad6,4" - Wifi + Cellular (model A1674)
#"iPad6,4" - Wifi + Cellular (model A1675)
//iPad PRO 9.7"
#"iPad6,7" - Wifi (model A1584)
#"iPad6,8" - Wifi + Cellular (model A1652)
//iPod Touch
#"iPod1,1" on iPod Touch
#"iPod2,1" on iPod Touch Second Generation
#"iPod3,1" on iPod Touch Third Generation
#"iPod4,1" on iPod Touch Fourth Generation
#"iPod7,1" on iPod Touch 6th Generation
Related
I cant figure out the following issue: I made a menu that should be usable for multiple apple devices. I tested it in several simulators of xcode (now 14.2). Some simulators work well but not all.
For example the simulators wil not activate the didSelectItemAt in the CollectionView:
iPad Air (4th generation- iOS 14.2) - 1180.0, 820.0
iPad 10th generation - iOS 16.2
iPad Pro 11.0 inch (2th gen) (iOS 14.2) 1194.0, 834.0
iPad Pro 12.9 inches 1366.0, 1024.0
The layout of the menu looks oke en works fine.
In didSelectItemAt works fine in the simulators:
iPhone 11 Pro
iPhone 12 - iOS 14.2 - 844.0, 390.0
iPad Air 2 - iOS 14.2 - 1024.0, 768.0
iPad (6th generation - iOS 16.2) 1024.0, 768.0
iPad (9th generation - iOS 16.2) 1080.0, 810.0
iPad Pro (9,7 inch - iOS 14.4) 1024.0, 768.0
I found that in the Debug ViewHierachy there is a difference between e.g. ipad Air 2 and ipad 11 Pro.
By the iPad 11 Pro there is an extra UIView added that I can't explain. I think this falls over the items. The reason i think why i cant select the items when use e.q. iPad 11 Pro. But I don't know how to adjust this. (See also the images).
iPad Air 2
iPad 11 Pro
Before iOS 7, iPhone apps that opened on iPads used to launch in 2x mode. iOS 7 seems to force all apps, even if they weren't designed for the iPad, to launch in 1x mode. How can we force our app to launch in 2x mode on iPads using iOS 7?
iPhone apps on iPads running iOS 7 now always open as a Retina iPhone app, while on iOS 6 they opened as a non-retina apps on non-retina iPads.
On Retina iPads (iPad 3 and 4) the apps may display in 1x (iPhone sized) or 2x (taking as much of the iPad screen as possible) and may be toggled.
On non-Retina iPads (iPad 2 and iPad mini) the apps only display in 2x mode and cannot be toggled. This is because the non-retina iPads do not have enough pixel density to display the retina iPhone apps at the "normal" size.
This behavior is determined by the OS and cannot be changed by your app.
Why does my UIScrollView get hidden when I run my application on the 3,5 inch (iPhone 4s and older) iOS simulator?
On the iPhone 5 (4 inch) iOS simulator it's shown normally...
Thank for your answers.
This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
How to test apps for iPhone 5
In xcode 4.2 and above we can find the both device for retina display and non retina display.
that means '960-by-640-pixel resolution at 326 ppi' and '480-by-320-pixel resolution at 163 ppi' as iOS Simulator.
(in iOS Simulator menu bar, Hardware > Device > iPad/iPhone/iPhone(Retina)).
How can i choose device from Simulator for new iPhone 5 (1136-by-640-pixel resolution at 326 ppi) ..?
Both Richard and NSPostWhenIdle are correct. You need to updated to Xcode 4.5 GM, then you'll see an option for "iPhone (Retina 4-inch)", which is the iPhone 5 display.
can a single application be used in both iphone and ipod touch > or we have to build them seperately ? Are there IPod only applications ?
They all work for both unless there are specific features that only the iPhone has, but everything the iPod can do, the iPhone can. You have to check for the specific features while programming to make sure it'll work on the iPod if you have optional features that will only work on the iPhone.
Examples:
-GPS
-Camera(for 1-3rd gen iPod Touch)
-3G network, although most of the time apps will default to wi-fi if
you're connected
-Gyroscope(for the new iPhone 4 and ipod Touch 4g models only)
-Some apps are intensive so the programmer might restrict it to the
newer 1ghz cpu that only the iPhone 4 and iPod touch 4g have now
-Retina Display check(again only iPhone 4 and iPod touch 4g)
-Multitasking(iOS 4 only on certain models)
-Microphone(iPhone and iPod Touch 4G, earlier iPod Touch models need headset)
-Bluetooth(iPod Touch 1G and 2G don't have it)
Although some 2G models later enabled bluetooth with OS 3.0