how to make the view controller compatible with iphone 5 if xib not taken

How can a view controller be make compatible with iphone 5 if it's xib file not taken. Is it possible to make that change programmatically. Thanks in advance.

Answers


Yes defiantly you can do this. XIB are just files too just open one in a texteditor - you'll see that it consists of readable xml code. now for making viewController compatible with Iphone 5 just put if else condition and make thing separately for different devices by checking height of particular device but defiantly its going to be long job

For my universal app, Forex App, I'm simply using the screen height detection concept like so:

CGSize screenSize = [[UIScreen mainScreen] bounds].size;

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
    if (screenSize.height > 480.0f) {
        /*Do iPhone 5 stuff here.*/
    } else {
        /*Do iPhone Classic stuff here.*/
    }
} else {
    /*Do iPad stuff here.*/
}

check the device is iPhone 5 or not and set frame programmatic..

CGRect screenRect = [[UIScreen mainScreen] applicationFrame];

    if (screenRect.size.height >= 548 )
    {
       // set your frame for iPhone 5
    }else
    {
       // set your frame for iPhone 4
    }

Yes you can do that by adding the following condition

CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
    iPhone 4 or less 
}
else if (result.height == 568)
{
     iPhone 5 condition
}

Wherever you want to differentiate between the two phones.


Need Your Help

EF- How to do a 'Not In' using Linq to Entities

c# asp.net sql linq-to-entities

I'm using the Entity framework 3.5 and am having trouble running this query.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.