我想把我的应用程序从IOS 6升级到IOS 7.我的应用程序是通用的,为了升级到IOS 7,我创建了两个不同的XIB文件,一个用于IOS 6,一个用于IOS 7..and,我已经完成了升级,但问题是,当我在IOS 73.5模拟器或设备中运行我的应用程序时,我的应用程序在IOS 7 4英寸Simulator...but中运行得很好,那么它的图形和数据在其正常的Place...and中就不会显示,有时会崩溃。
i have also used Macro Below..
#define iPhone5 @"iPhone 5"
#define iPhone @"iPhone"
#define iPad @"iPad"
#define IS_IPHONE ([[[UIDevice currentDevice]model]hasPrefix:@"iPhone"])
#define IS_IPOD ([[[UIDevice currentDevice]model]hasPrefix:@"iPod touch"])
#define IS_HEIGHT_GET_568 [[UIScreen mainScreen]bounds].size.height==568.0f
#define IS_IPHONE_5 (IS_HEIGHT_GET_568)
#define IS_IPAD ([[[UIDevice currentDevice]model]hasPrefix:@"iPad"])发布于 2013-12-20 12:29:25
i Have Got the Answer:
Follow the Step Below to Upgrade Your App From IOS 6 To IOS 7 and its Working Fine in Below Simulator
IOS 6: iPhone , iPad
IOS 7: iPhone 3.5 inch , iPhone 4 inch, iPad
**Follow the Step Below to Upgrade Your App**
First Create Macro in App Delegate.m File
#define iPhone5 @"iPhone 5"
#define iPhone @"iPhone"
#define iPad @"iPad"
#define IS_IPHONE ([[[UIDevice currentDevice]model]hasPrefix:@"iPhone"])
#define IS_IPOD ([[[UIDevice currentDevice]model]hasPrefix:@"iPod touch"])
#define IS_HEIGHT_GET_568 [[UIScreen mainScreen]bounds].size.height==568.0f
#define IS_IPHONE_5 (IS_HEIGHT_GET_568)
#define IS_IPAD ([[[UIDevice currentDevice]model]hasPrefix:@"iPad"])
**Now in Application didFinishLaunching Option Method**
//Check IOS Whether it is IOS 6 OR IOS 7
NSString *version = [[UIDevice currentDevice] systemVersion];
NSLog(@"IOS VERSION================%@",version);
BOOL isAtLeast6 = [version hasPrefix:@"6."];
BOOL isAtLeast7 = [version hasPrefix:@"7."];
if (isAtLeast6) // if IOS Version 6 Then
{
if (IS_IPAD) //if IOS Version 6 and iPad Then
{
NSLog(@"IOS 6 Ipad Called");
viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstViewController_iPad" bundle:nil] autorelease];
}
else // if IOS 6 and iPhone The
{
NSLog(@"IOS 6 iPhone Called");
viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstView" bundle:nil] autorelease];
}
}
else if (isAtLeast7)
{
if (IS_IPHONE_5)
{
viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstView" bundle:nil] autorelease];
[viewController1 setEdgesForExtendedLayout:UIRectEdgeNone];//Automatically Set UI For IOS 7
NSLog(@" IOS 7 iPhone Called");
}
else
{
viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstView" bundle:nil] autorelease];
[viewController1 setEdgesForExtendedLayout:UIRectEdgeNone];
}
}https://stackoverflow.com/questions/20628088
复制相似问题