我想在Objective-C应用程序中使用一些Swift pod,所以我需要使用框架而不是静态库.但是use_frameworks!在我的Podfile中启用会导致#import错误.
我的Podfile:
platform :ios, '8.0'
use_frameworks!
pod 'AFNetworking', '2.6.0'
pod 'Typhoon'
pod 'SSKeychain'
pod 'JBWebViewController'
pod 'TTTAttributedLabel'
pod 'HockeySDK'
pod 'GoogleAnalytics'
pod 'Intercom'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'UIButton+Activity'
pod 'HexColors'
pod 'AFNetworkActivityLogger'
pod 'HCSStarRatingView', :git => 'https://github.com/hsousa/HCSStarRatingView.git'
pod 'LGSideMenuController'
pod 'DateTools'
pod 'SDWebImage'
pod 'SSCWhatsAppActivity'
pod 'UIViewController+BlockSegue'
Run Code Online (Sandbox Code Playgroud)
第一个问题是SSKeychainpod:
在代码中我使用"引号"包括SSKeychain #import "SSKeychain/SSKeychain.h",但如果我理解正确,我需要<angle>从现在开始使用#import <SSKeychain/SSKeychain.h>?但在这种情况下,我收到相同的错误,但在我的代码中.
我的构建阶段:
无论如何,我发现SSKeychain的叉子带有"引号"导入(https://github.com/adamwulf/sskeychain/commit/2b7fd878415e8e4f23f74636cdd8c993466d0749)并切换到那些版本.
但现在我和许多其他豆荚(几乎所有豆荚)都有同样的问题:
在应用中导入: #import "FBSDKCoreKit/FBSDKCoreKit.h"
我真的需要分叉每个repo并更改import语句吗?或者我以错误的方式包括豆荚?
PS:我在每次构建尝试之前清理派生数据和项目.
Cocoapods版本:0.39.0
我已UIDocumentPickerViewController根据文档实现,现在尝试从委托方法中的拾取文件中获取NSData,但[[NSData alloc] initWithContentsOfURL:]返回nil:
- (void)documentPicker:(UIDocumentPickerViewController *)controller didPickDocumentAtURL:(NSURL *)url{
NSData* documentData = [[NSData alloc] initWithContentsOfURL:url];
//documentData is nil
documentData = [[NSData alloc] initWithContentsOfFile:[url path]];
//documentData is still nil :(
}
Run Code Online (Sandbox Code Playgroud)
我正在使用Xcode6 beta6,iPhone模拟器,文件选择器模式UIDocumentPickerModeImport.尝试检索保存到iCloude Drive的文档.