在Xcode 8中,發(fā)現(xiàn)項目中調用系統(tǒng)相冊時,發(fā)現(xiàn)會有這樣的錯誤:
objc[5582]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x12b724998) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x12af15d38). One of the two will be used. Which one is undefined.
經過查詢,是由于iOS 10更新后,開發(fā)者調用系統(tǒng)相冊需要在info.plist文件中添加白名單,分別有
調用系統(tǒng)相冊權限:
key: NSPhotoLibraryUsageDescription
value(string): photoLibraryDesciption
調用系統(tǒng)相機權限:
key: NSCameraUsageDescription
value(string): cameraDesciption