UITableView的insert和delete操作与numberOfRowsInSection同步问题

问题描述:通过CrashRepoter得到如下报错信息:
Application Specific Information:
*** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason: ‘Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (0) must be equal to the number of rows contained in that section before the update (2), plus or minus the number of rows inserted or deleted from that section (0 inserted, 3 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).’

问题解决:在[self.tableView insertRowsAtIndexPaths:withRowAnimation:]和[tableView deleteRowsAtIndexPaths:withRowAnimation:]进行修改的操作前后加保护:
[tableView beginUpdates]和[self.tableView endUpdates]

Xcode升级导致插件失效

问题描述:Xcode升级后有些插件失效

问题分析:在控制台中查看log,显示是白名单问题

问题解决:把Xcode的UUID加入插件plist中:
XCODEUUID=`defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID`
defaults write ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/HOStringSense.xcplugin/Contents/Info DVTPlugInCompatibilityUUIDs -array-add $XCODEUUID

Mac App Store 下载更新错误

问题描述:使用Mac App Store更新Xcode时一直重复出现如下错误:

使用“已购”页面再试一次

问题解决

1、点击下载
2、在出现去已购项目重试的提示之前,打开launchpad,找到正在连接的app图标。
3、鼠标长按,图标左上角的叉叉出现,点击左上角的叉删除该图标。
4、再回到AppStore,重新下载即可。

换设备后ssh报错

问题描述:运行ssh报如下错误
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
23:00:20:83:de:02:95:f1:e3:34:be:57:3f:cf:2c:e7.
Please contact your system administrator.
Add correct host key in /home/xahria/.ssh/known_hosts to get rid of this message.
Offending key in /home/xahria/.ssh/known_hosts:8
RSA host key for localhost has changed and you have requested strict checking.
Host key verification failed.

问题分析:估计是RSA key不匹配

问题解决:修改安全配置
打开.ssh/config(或者/etc/ssh/ssh_config)
找到并修改为:
StrictHostKeyChecking no
UserKnownHostsFile /dev/null

brew update报错

问题描述:运行brew update,报错
error: The following untracked working tree files would be overwritten by merge:
Library/Aliases/libtcnative
Library/Aliases/myrepos
Library/Contributions/example-formula.rb
Library/Formula/acme.rb
Library/Formula/activemq-cpp.rb
Library/Formula/ahcpd.rb
Library/Formula/analog.rb
Library/Formula/ansible.rb
Library/Formula/apple-gcc42.rb
Library/Formula/argus-clients.rb
Library/Formula/argus.rb
Library/Formula/babeld.rb
Library/Formula/bacula-fd.rb
Library/Formula/bgpq3.rb
Library/Formula/bitchx.rb
Library/Formula/brag.rb
Library/Formula/cdlabelgen.rb
Library/Formula/charm-tools.rb
Library/Formula/clipper.rb
Library/Formula/clojurescript.rb
Library/Formula/datomic.rb
Library/Formula/dieharder.rb
Library/Formula/dmalloc.rb
Library/Formula/dtrx.rb
Library/Formula/ejdb.rb
Library/Formula/electric-fence.rb
Library/Formula/etcd.rb
Library/Formula/etcdctl.rb
Library/Formula/fdclone.rb
Library/Formula/flowgrind.rb
Library/Formula/fswatch.rb
Library/Formula/gammu.rb
Library/Formula/gcab.rb
Library/Formula/git-cal.rb
Library/Formula/gtkspell3.rb
Library/Formula/hamsterdb.rb
Library/Formula/haxe.rb
Library/Formula/headphones.rb
Library/Formula/htmlcleaner.rb
Library/Formula/irrtoolset.rb
Library/Formula/juju.rb
Library/Formula/kimwitu++.rb
Library/Formula/kstart.rb
Library/Formula/laszip.rb
Library/Formula/libatomic_ops.rb
Library/Formula/libav.rb
Library/Formula/libcello.rb
Library/Formula/libcppa.rb
Library/Formula/libdrawtext.rb
Library/Formula/libftdi0.rb
Library/Formula/libgsm.rb
Library/Formula/libiscsi.rb
Library/Formula/liblacewing.rb
Library/Formula/libnatpmp.rb
Library/Formula/libqxt.rb
Library/Formula/libresample.rb
Library/Formula/lmdb.rb
Library/Formula/mbelib.rb
Library/Formula/mboxgrep.rb
Library/Formula/mecab-unidic.rb
Library/Formula/mergelog.rb
Library/Formula/midicsv.rb
Library/Formula/mitmproxy.rb
Library/Formula/mkvtomp4.rb
Library/Formula/mlt.rb
Library/Formula/mm-common.rb
Library/Formula/moc.rb
Library/Formula/mongo-c.rb
Library/Formula/monkeysphere.rb
Library/Formula/mp3blaster.rb
Library/Formula/msitools.rb
Library/Formula/msktutil.rb
Library/Formula/n.rb
Library/Formula/namebench.rb
Library/Formula/nanomsg.rb
Library/Formula/neko.rb
Library/Formula/ninja-ide.rb
Library/Formula/npth.rb
Library/Formula/ondir.rb
Library/Formula/ori.rb
Library/Formula/osxfuse.rb
Library/Formula/owamp.rb
Library/Formula/pgrouting.rb
Library/Formula/pjsip.rb
Library/Formula/pktanon.rb
Library/Formula/pmccabe.rb
Library/Formula/polygen.rb
Library/Formula/ponysay.rb
Library/Formula/proftpd.rb
Library/Formula/q.rb
Library/Formula/randomize-lines.rb
Library/Formula/rbenv-readline.rb
Library/Formula/re2.rb
Library/Formula/reaver.rb
Library/Formula/sbuild.rb
Library/Formula/sdl2.rb
Library/Formula/sdl2_image.rb
Library/Formula/sdl2_mixer.rb
Library/Formula/sdl2_net.rb
Library/Formula/sdl2_ttf.rb
Library/Formula/shellinabox.rb
Library/Formula/slimerjs.rb
Library/Formula/snzip.rb
Library/Formula/spim.rb
Library/Formula/sslh.rb
Library/Formula/stlviewer.rb
Library/Formula/strongswan.rb
Library/Formula/sysbench.rb
Library/Formula/tcpsplit.rb
Library/Formula/texapp.rb
Library/Formula/tinyxml.rb
Library/Formula/tlassemble.rb
Library/Formula/tmux-mem-cpu-load.rb
Library/Formula/tomcat-native.rb
Library/Formula/tpp.rb
Library/Formula/tractorgen.rb
Library/Formula/typesafe-activator.rb
Library/Formula/uberftp.rb
Library/Formula/v.rb
Library/Formula/viewglob.rb
Library/Formula/voltdb.rb
Library/Formula/vstr.rb
Library/Formula/watchman.rb
Library/Formula/wimlib.rb
Library/Formula/wy60.rb
Library/Formula/xcproj.rb
Library/Formula/xplot.rb
Library/Formula/z80asm.rb
Library/Formula/z80dasm.rb
Library/Formula/zpython.rb
Library/Homebrew/cxxstdlib.rb
Library/Homebrew/install_renamed.rb
Library/Homebrew/os.rb
Library/Homebrew/resource.rb
Library/Homebrew/software_spec.rb
Please move or remove them before you can merge.
Aborting
Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master

问题解决
cd `brew –repository`
git reset –hard HEAD
brew update
不行的话试试如下:
cd `brew –repository`
git reset –hard origin/master
brew update