0

How can I change the main window nib name? I am using two xib for iPhone4 and iPhone5. But my project having the main window. How to check and change the xib for iPhone5 and iPhone4.

Please help me. Thanks in advance.

Mani
  • 1,310
  • 1
  • 20
  • 40

1 Answers1

0

Use the following macro:

#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )

Then in your code:

if (IS_IPHONE_5) {
... load the nib for iPhone5 ...
} else {
... load the nib for iPhone4 ...
}
SAE
  • 1,609
  • 2
  • 18
  • 22