之前一直都是在Xcode4.4下使用Three20开发框架,今天升级到4.5了发现在IOS6下无法将程序编译到真机上,还有就是Three20在IOS6下旋转的代码全部失灵了,非常奇怪。今天抽了一点时间研究了一下,本文仅作为自己备份!
首先我们解决无法编译的问题。
three20的开发包我用的是gitbug上的https://github.com/facebook/three20官网上的Three20迟迟不见更新,无奈啊!
找到UIViewAdditions.h 和UIViewAdditions.m这两个类,将#ifdef DEBUG 标签全部改成 #ifdef DEBUG_TOUCHES
像这里写的一样 一共三处https://github.com/cogenta/three20-1.0.5/commit/be70e1ff3965c0ff4f7598bf5213349629a27540
这一步做完后,在IOS6的模拟器上已经可以运行Three20程序了,可是还是不能编译到真机!如下图所示,我们需要把Valid Architectures 的属性改成成 armv6 armv7 修改完毕后即可正常编译在真机。
下面我们来解决在IOS6中如何让Three20设备旋转
在AppDelegate中修改如下代码
02
|
TTNavigator*
navigator = [TTNavigator navigator];
|
03
|
navigator.persistenceMode
= TTNavigatorPersistenceModeAll;
|
06
|
self.window
= [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
08
|
navigator.window
= self.window;
|
10
|
TTURLMap*
map = navigator.URLMap;
|
接着在切换ViewController的时候加入代码
1
|
if (![navigator
restoreViewControllers])
|
4
|
[navigator
openURLAction:[TTURLAction actionWithURLPath:@ "tt://Tab" ]];
|
6
|
self.window.rootViewController
= navigator.rootViewController;
|
接着在TTNavigationController.m中加入下面两行代码,TTNavigationController是Three20的源码,大家在Xcode中搜索一下这个关键字即可看到、。
1
|
-
( BOOL )shouldAutorotate{
|
4
|
-(NSUInteger)supportedInterfaceOrientations{
|
5
|
return [self.topViewController
supportedInterfaceOrientations];
|
如果你需要旋转的是UITabBarController那么加入如下代码
01
|
-( BOOL )shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
03
|
return [self.selectedViewController
shouldAutorotateToInterfaceOrientation:interfaceOrientation];
|
06
|
-(NSUInteger)supportedInterfaceOrientations
|
08
|
return [self.selectedViewController
supportedInterfaceOrientations];
|
11
|
-( BOOL )shouldAutorotate
|
如果你需要旋转的是ViewController那么加入如下代码
01
|
-
( BOOL )shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
|
03
|
return (interfaceOrientation
!= UIInterfaceOrientationPortraitUpsideDown);
|
06
|
-(NSUInteger)supportedInterfaceOrientations
|
08
|
return UIInterfaceOrientationMaskAllButUpsideDown;
|
11
|
-( BOOL )shouldAutorotate
|
OK 这样就可以完美解决了。不过毕竟这是我们手动修改Three20 ,还是希望Three20社区尽快更新,据说FaceBook的客户端要放弃使用Three20 不知道未来Three20还能走多远,观望中!!
本文参考内容http://www.goodnewtiger.com/llf/cegeek/?p=61
分享到:
相关推荐
iOS 13.6 xcode 真机包iOS 13.6 xcode 真机包
iOS 真机调试包 支持iOS 16.1-16.3 系统 下载完直接拖入Xcode,然后重启Xcode,连接真机调试。
Xcode iOS 16真机调试包 开发调试 iOS16适配
升级 iOS 13 之后,使用 Xcode 10 真机调试会提示错误: Could not locate device support files. 这是因为 Xcode 10 默认没有自带 iOS 13 的调试包,下载调试包,然后重新打开 Xcode 就可以了。 打开Finder 按下: ...
这是16的真机调试包,文件直接解压放到 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
xcode真机调试所需,从xcode9.2解压获得,使用时解压到 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport即可
下载解压放到/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport即可,重启Xcode即可,无需升级系统和Xcode
需要的请下载, 复制到 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 然后把你需要的调试包拖进去
macos-lion-dp4-10.8+ios6+xcode4.5.zip 含wifi,ipad,iphone等等全套bt种子
2023【iOS 真机调试支持包】 iOS 16.6 16.5正式版,Xcode 14.3.1 支持
让 Xcode 支持真机调试 iOS14.2(beta) 打开 访达 (command + shift + G )前往文件夹 拷贝到 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport目录下重启 Xcode 即可
xcode免更新IOS17.0真机调试包。
This iPhone 6 is running iOS 10.3.1 (14E304), which may not be supported by this version of Xcode. Could not find Developer Disk Image 原因:Xcode没有更新版本,手机更新了新版本,Xcode里面没有手机...
iOS16.5 真机调试包, 路径: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport 使用方法: 1、下载资源,放入上述路径中; 2、重启Xcode即可使用。
This iPhone 6 is running iOS 10.3.1 (14E304), which may not be supported by this version of Xcode. Could not find Developer Disk Image 原因:Xcode没有更新版本,手机更新了新版本,Xcode里面没有手机...
iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16真机包iOS 16...
Xcode真机调试iOS14.6
解决xcode11无法真机调试ios14设备: 将文件解压拖入目录 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
xcode真机调试包 ios13.0,可真机调试ios13.0,来源xcode11 beta 2