Xcode - How do I Detecting screen size of iPhone
I have two xibs, one for the iPhone 4 and one for the iPhone 5; 3.5 inch
and 4 inch. I simply want to put some code that tells the app which to
load. I have this code which is supposed to do the job:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone))
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
//Load 3.5 inch xib
}
if(result.height == 568)
{
//Load 4 inch xib
}
I put it in the ViewController.M and the build fails saying there is a
parse issue expected identifier of "(" Can anyone help me with this simple
fix? Thanks!
No comments:
Post a Comment