iOS5不支持Auto Layout功能

问题描述

今天做陆家嘴金融杂志iPad版,在iOS6上运行都可以,但是运行在iOS5上报如下错误:

2012-12-24 15:25:29.912 Magazine[321:c07] *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'

*** First throw call stack:

(0x14cc022 0xecccd6 0x1474a48 0x14749b9 0x3504a3 0x35067b 0x350383 0x25016d 0xf61fc 0xf6779 0xf699b 0x55401 0x55670 0x55836 0xe241dd8 0x5c72a 0x2d596 0x2e274 0x3d183 0x3dc38 0x31634 0x13b6ef5 0x14a0195 0x1404ff2 0x14038da 0x1402d84 0x1402c9b 0x2dc65 0x2f626 0x236d 0x2295)

terminate called throwing an exception(lldb)

问题解决

选中.stroyborad和.xib文件,在Inspector属性栏将Interface Builder Document下的“Use Autolayout”复选框勾去掉。

Three20不支持iOS6

问题描述

今天新建的iOS6项目添加Three20类库,报错,如下:

/Three20/src/Three20UI/Sources/UIViewAdditions.m:109:5: Unknown type name '_tapCount'; did you mean 'ItemCount'?

/Three20/src/Three20UI/Sources/UIViewAdditions.m:109:15: Expected identifier or '('

/Three20/src/Three20UI/Sources/UIViewAdditions.m:110:5: Use of undeclared identifier '_locationInWindow'

/Three20/src/Three20UI/Sources/UIViewAdditions.m:111:5: Use of undeclared identifier '_previousLocationInWindow'

/Three20/src/Three20UI/Sources/UIViewAdditions.m:113:43: Use of undeclared identifier '_locationInWindow'

/Three20/src/Three20UI/Sources/UIViewAdditions.m:114:5: Use of undeclared identifier '_view'; did you mean 'view'?

/Three20/src/Three20UI/Sources/UIViewAdditions.m:115:5: Use of undeclared identifier '_window'

/Three20/src/Three20UI/Sources/UIViewAdditions.m:116:5: Use of undeclared identifier '_phase'

/Three20/src/Three20UI/Sources/UIViewAdditions.m:117:5: Use of undeclared identifier '_touchFlags'

/Three20/src/Three20UI/Sources/UIViewAdditions.m:118:5: Use of undeclared identifier '_touchFlags'

/Three20/src/Three20UI/Sources/UIViewAdditions.m:119:5: Use of undeclared identifier '_timestamp'

/Three20/src/Three20UI/Sources/UIViewAdditions.m:127:3: Use of undeclared identifier '_phase'; did you mean 'phase'?

/Three20/src/Three20UI/Sources/UIViewAdditions.m:128:3: Use of undeclared identifier '_timestamp'

问题解决

在UIViewAdditions.m文件中:

#ifdef DEBUG

改为:

#ifdef DEBUG_TOUCHES

iOS5 Storyboard error

问题描述

今天开始做陆家嘴金融杂志,发现新建的项目报错,如下:
Storyboards are unavailable on iOS 4.3 and prior

问题解决

1.Open XXXXXX.storyboard
2.Open Identity and Type tag in your right view of Xcode.
3.Set the value of Development in Document Versioning to "Xcode 4.2" (my default value is "Default Version (Xcode 4.1)".
4.Change the value of Deployment from Project SDK Version (iOS 5.0) to iOS 5.0, then back to Project SDK Version (iOS 5.0)