1

I have a problem identifying the types of devices.

When I connect iPhone 4 the print is " is iPhone 4"

When I connect iPhone 5 or 5 s the print is " is iPhone 5"

When I connect iPhone 6 plus the print is " is iPhone 6 plus"

And the problem is :

When I connect iPhone 6 the print is " is iPhone 5 "

This is a sample code:

- (void)viewDidLoad {
[super viewDidLoad];

[self print];

}


-(void)print

{
#define isIphone4  ([[UIScreen mainScreen] bounds].size.height == 480)?TRUE:FALSE

if (isIphone4)
{
    NSLog(@"is iphone 4");
}


#define isIphone5  ([[UIScreen mainScreen] bounds].size.height == 568)?TRUE:FALSE

if (isIphone5)
{
    NSLog(@"is iphone 5");
}

#define isIphone6  ([[UIScreen mainScreen] bounds].size.height == 667)?TRUE:FALSE

if (isIphone6)
{
    NSLog(@"is iphone 6");
}

#define isIphone6plus  ([[UIScreen mainScreen] bounds].size.height == 736)?TRUE:FALSE

if (isIphone6plus)
{
    NSLog(@"is iphone 6 plus");
}

}

What could be the problem ??

Edit :

I add a LaunchImage :

enter image description here

And the print still " is iPhone 5 "

Roei Nadam
  • 1,780
  • 1
  • 15
  • 33

1 Answers1

1

if you do not include a @3x welcome screen in your app bundle. it will consider the screen size as in an iPhone 5 and will upscale your interface. Maybe that's your issue

Nicolas Manzini
  • 8,379
  • 6
  • 63
  • 81
  • 1
    Have not figured out what to do, would love more help I tried a few things said here but I still did not solve the problem – Roei Nadam Dec 29 '14 at 09:46