# err **Repository Path**: yuyunzhang/err ## Basic Information - **Project Name**: err - **Description**: Ios经验总结,希望大家积极贡献 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2015-12-22 - **Last Updated**: 2020-12-18 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### 1.数据请求下来, 但是界面没有刷新 1. 看一下block回调的位置,可能是这么写的 : // 这是错误的写法 { // 进入子线程 { 请求数据 解析 添加到数组 } // 会主线程 { block() } } // 应该这么写 { // 进入子线程 { 请求数据 解析 添加到数组 // 会主线程 { block() } } } ### 2. 代码冲突 1. 跟团队内部人员商量,然后手动解决, 再合并
Error Domain=com.alamofire.error.serialization.response Code=-1016 "Request failed: unacceptable content-type: application/x-javascript" UserInfo={com.alamofire.serialization.response.error.response=<NSHTTPURLResponse: 0x7fbddbc18350> { URL: http://api2.pianke.me/pub/today } { status code: 200, headers {
"Cache-Control" = "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
Connection = "keep-alive";
"Content-Encoding" = gzip;
"Content-Type" = "application/x-javascript; charset=utf-8";
Date = "Wed, 02 Dec 2015 03:38:36 GMT";
Etag = a8bc877f523a4096caa746bc2fa8d2a3;
Expires = "Thu, 19 Nov 1981 08:52:00 GMT";
Pragma = "no-cache";
Server = nginx;
"Set-Cookie" = "PHPSESSID=s0upj58k0ghbfj15r3fp8dcmm2; path=/; domain=pianke.me";
"Transfer-Encoding" = Identity;
Vary = "Accept-Encoding";
} }
原因: 后台返回的数据的文件格式是javascript的.AFNetworking 解析不了.所以需要我们告诉AndFNetworking返回数据时javascript格式的,这样AFNetworking就可以解析了(默认ANF 是按照json格式处理的,如果返回时html也会报错) 解决方案:
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"application/x-javascript"];
1,实例方法里面的self,是对象的首地址。 2,类方法里面的self,是Class. 尽管在同一个类里面的使用self,但是self却有着不同的解读。在类方法里面的self,可以翻译成class self;在实例方法里面的self,应该被翻译成为object self。在类方法里面的self和实例方法里面的self有着本质上的不同,尽管他们的名字都叫self
1,去在sourceTree的偏好设置中删除账号
2,再推送
NSString *headPath = [[NSBundle mainBundle] pathForResource:@"head" ofType:@"html"]; NSString *footPath = [[NSBundle mainBundle]pathForResource:@"foot" ofType:@"html"]; NSString *strHead = [NSString stringWithContentsOfFile:headPath encoding:NSUTF8StringEncoding error:nil]; NSString *strFoot = [NSString stringWithContentsOfFile:footPath encoding:NSUTF8StringEncoding error:nil]; NSString *html = [NSString stringWithFormat:@"%@%@ %@",strHead,object[@"body"],strFoot];[self.webView1 loadHTMLString:html baseURL:nil];### 8. 出现这种错误情况处理 1.
这个解决也比较简单,
在Build Setting 中的Other Linker Flags选项中加入$(OTHER_LDFLAGS)
如图:
编译通过.........
今天在服务器上git pull是出现以下错误:
error: Your local changes to the following files would be overwritten by merge:
application/config/config.php
application/controllers/home.php
Please, commit your changes or stash them before you can merge.
Aborting
不知道什么原因造成的代码冲突,处理方法如下:
如果希望保留生产服务器上所做的改动,仅仅并入新配置项:
git stash
git pull
git stash pop
然后可以使用git diff -w +文件名 来确认代码自动合并的情况.
如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:
git reset --hard
git pull
反过来,如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:
git reset --hard git pull
其中git reset是针对版本,如果想针对文件回退本地修改,使用
git checkout HEAD file/to/restore
git-updating-currently-checked-out-branch-warning
Counting objects: 3, done.
Writing objects: 100% (3/3), 226 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, updating the current branch in a non-bare repository
remote: error: is denied, because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error:
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error:
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To git@192.168.45.42:teamwork.git
! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to 'git@192.168.45.42:teamwork.git'
解决方法:
git config receive.denyCurrentBranch ignore
这里详细记录下
http://stackoverflow.com/questions/738154/what-does-git-updating-currently-checked-out-branch-warning-mean
根据stackoverflow上的讨论记录,默认的git init建立的仓库所处分支master的情况下不允许向自己的远程分支提交,
所以最终的解决方案是建立裸库 也就是 git init --bare 或者 git init --bare --share
cannot-update-paths-and-switch-to-branch-at-the-same-time
$ git checkout -b test --track origin/master fatal: Cannot update paths and switch to branch 'test' at the same time. Did you intend to checkout 'origin/master' which can not be resolved as commit?解决方案:
git remote -v
git fetch origin
然后重新执行刚才的track命令,成功
error: Malformed value for push.default: simple error: Must be one of nothing, matching, tracking or current.解决方案:
git config --global push.default upstream
提交后提示
fatal: recursion detected in die handler
问题原因:
问题原因是http.postBuffer默认上限为1M所致。在git的配置里将http.postBuffer变量改大一些即可,比如将上限设为500M:
git config --global http.postBuffer 524288000