小编Jon*_*han的帖子

(可可错误3840.)"(字符0周围的值无效.)AFNetworking

使用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解决这个问题.有任何想法吗?谢谢.

cocoa-touch json objective-c ios afnetworking-2

28
推荐指数
1
解决办法
4万
查看次数

最近PusH无法向Github提交已推送到Bitbucket的内容

我有两个远程存储库.一个是私人(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回购接受最近的提交?

git xcode github atlassian-sourcetree

5
推荐指数
1
解决办法
3252
查看次数

无法归档Xcode项目,错误没有这样的模块'Alamofire'

我成功地通过cocoapods安装了Alamofire,并且在Xcode的设备上构建和运行应用程序时一直在使用它.现在,当我将项目归档以进行分发时,我收到错误:

没有这样的模块'Alamofire'

我将我的配置文件切换到我用于分发的正确的Ad Hoc配置文件,但由于我切换到使用cocoapods而不是手动安装Alamofire,我一直无法存档.我尝试通过在构建设置下将"Build Active Architecture Only"设置为"No"来修复,但没有运气.

xcode ios cocoapods swift alamofire

5
推荐指数
2
解决办法
1084
查看次数