IOS 6应用升级到IOS 7 [英] IOS 6 App Upgrade To IOS 7
本文介绍了IOS 6应用升级到IOS 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将我的应用程序从IOS 6升级到IOS 7 ... 我的应用是通用的,为了升级到IOS 7,我创建了两个不同的XIB文件 IOS 6和IOS 7的版本.我已经完成升级,但问题是我的应用程序在IOS 7 4英寸模拟器中运行完美...但是当我在IOS 7 3.5模拟器或设备中运行我的应用程序时,其图形并且数据未在正确的位置显示...有时会崩溃...
I want to Upgrade My App From IOS 6 To IOS 7... My App is Universal and For Upgrade to IOS 7 i have created Two Different XIB Files one for IOS 6 and One For IOS 7..and i have Complete the Upgrade but the Problem is My App is Running Perfect in IOS 7 4 inch Simulator...but when i Run My App in IOS 7 3.5 Simulator or Device then its Graphics and Data is not display in its proper Place...and sometime it crash...
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"])
推荐答案
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];
}
}
这篇关于IOS 6应用升级到IOS 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文