用cococapod 导入 Alamofire 无法import 的解决方法
新建的swift项目用的Alamofire,无法 import Alamofire,这是因为缺少一项设置
解决方法如下:
添加个 $(PODS_ROOT) ,选择recursive就可以了
错误1:
Reason: image not found
解决:
TARGETS -> Linked Frameworks and Libraries中把使用的framework Status改为Optional
错误2:
Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices(0x111ed6998)and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices(0x111cfbd38). One of the two will be used. Which one is undefined.
解决:
Input the following into your Info.plist file.
Photo
Key: Privacy - Photo Library Usage Description Value: $(PRODUCT_NAME)photo use
Camera
Key: Privacy - Camera Usage Description Value: $(PRODUCT_NAME)camera use
More info can be found here:https://iosdevcenters.blogspot.com/2016/09/infoplist-privacy-settings-in-ios-10.html
错误3:
dyld: can't resolve symbol __TMaC10RealmSwift5Realm in /Users/mac/Library/Developer/CoreSimulator/Devices/C676D672-29B3-4B8A-92B2-FF4658560F3B/data/Containers/Bundle/Application/D71FF4D4-D3B9-4CC5-8008-1CC010C40BA9/baoxiao.app/baoxiao because dependent dylib #34 could not be loaded
解决:
错误4:
reason: 'Storyboard()doesn't contain a view controller with identifier 'loginNav''
解决:
这是由于没有找到对应的SB内identifier“xxxx”的VC,Xcode8.0后新变化
错误5:
Cannot override mutable property with read-only property 'size'
解决:
override var size: CGSize {
set{
super.size = newValue
}
get{
return CGSize.zero
}
}
错误6:
‘CGContextAddArcToPoint' is unavailable: Use addArc(self:x1:y1:x2:y2:radius:)
解决:
Name: CGContextAddArcToPoint
# replaced by addArc(tangent1End:tangent2End:radius:)
SwiftName: CGContext.__addArc(self:x1:y1:x2:y2:radius:)
SwiftPrivate: true
这个方法被替换成了
func addArc(tangent1End: CGPoint,tangent2End: CGPoint,radius: CGFloat)