IOS 6应用升级到IOS 7

编程入门 行业动态 更新时间:2024-10-25 00:30:20
本文介绍了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

本文发布于:2023-11-17 06:49:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1609206.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:升级到   IOS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!