使用GET方法从服务器检索文件时,我一直收到以下错误:
Error: Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)" (Invalid value around character 0.) UserInfo=0x16e81ed0 {NSDebugDescription=Invalid value around character 0.}
Run Code Online (Sandbox Code Playgroud)
我尝试了很多不同的东西,我相信它可能与我想要获得的文件上的JSON格式有关.
这是我一直在使用的代码:
_username = @"JonDoe";
NSDictionary *parameters = @{ @"username" : _username};
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer = [AFJSONResponseSerializer serializerWithReadingOptions:NSJSONReadingAllowFragments];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/plain"];
[manager GET:@"http://.........."
parameters:parameters
success:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"JSON: %@", responseObject);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
NSLog(@"Error: %@", error);
}];
Run Code Online (Sandbox Code Playgroud)
我的POST方法工作正常.我似乎无法用GET解决这个问题.有任何想法吗?谢谢.
我有两个远程存储库.一个是私人(Bitbucket),另一个是公共(Github).我一直在使用Github应用程序将更改推送到Bitbucket,然后使用Xcode将相同的提交推送到Github repo.但是,最近我无法推送到Github的提交并使用SourceTree我收到此错误消息:
This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.
Run Code Online (Sandbox Code Playgroud)
这是它在SourceTree中的外观:
我怎样才能让我的Github回购接受最近的提交?
我成功地通过cocoapods安装了Alamofire,并且在Xcode的设备上构建和运行应用程序时一直在使用它.现在,当我将项目归档以进行分发时,我收到错误:
没有这样的模块'Alamofire'
我将我的配置文件切换到我用于分发的正确的Ad Hoc配置文件,但由于我切换到使用cocoapods而不是手动安装Alamofire,我一直无法存档.我尝试通过在构建设置下将"Build Active Architecture Only"设置为"No"来修复,但没有运气.
ios ×2
xcode ×2
alamofire ×1
cocoa-touch ×1
cocoapods ×1
git ×1
github ×1
json ×1
objective-c ×1
swift ×1