如何在 Block 中不加持 self 的情况下调用父类的实现

问题出现

»
Author's profile picture Veight Zhou

Could not find developer disk image

今天真机调试时,显示我的设备 unavailable, 可昨天还是好的。

»
Author's profile picture Veight Zhou

关于惰性初始化的随想

惰性初始化是开发中很常见的一种模式,但是许多细节都值得思考。

»
Author's profile picture Veight Zhou

imageNamed && imageWithContentsOfFile

最近把之前资源瘦身的分支合并了下, 毕竟剁手宝的包已经逼近 100MB 了. 图片资源迁移到 bundle 后, 好像不能在里面新建抽象的 Group 了. 所以我把资源在 bundle 中分了文件夹, 并做了个接口.

»
Author's profile picture Veight Zhou

不要使用宏定义去声明一个常量

前几天追踪了一个线上的crash, 点击cell 上的按钮就会崩溃.由于项目庞大, 花了两天才重现问题. 不过问题比较容易解决. 开发人员给 UIButton 打了 tag, 在处理相应的 Action 回调时, 进行了判别.

»
Author's profile picture Veight Zhou

「译」可选性与ObjectiveC

Swift 能与 ObjectiveC 无缝地交互是一件非常爽的事情,不论是现存的,用 ObjectiveC 写的第三方框架,还是是自己的ObjectiveC 代码。 然而在 Swift 中,可选引用和非可选引用有很大的差别,比如,NSViewNSView? ,在 ObjectiveC 中这两种类型都呈现为 NSView * 。 因为 Swift 的编译器不能明确 NSView * 是否为可选引用,所以它会以可选值隐式拆包的形式:NSView! 在 Swift 中出现。

»
Author's profile picture Veight Zhou

description & debugDescription

有时候我们会在代码中直接输出对象,如:

»
Author's profile picture Veight Zhou

bundle install 安装依赖失败

今天安装 RoR , 执行

»
Author's profile picture Veight Zhou

修复 Xcode 更新后插件丢失

find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info.plist DVTPlugInCompatibilityUUID`
»
Author's profile picture Veight Zhou

使用 Dispatch Group

最近在业务逻辑中实践了一下大中枢派发。简单的串行异步队列通常不能满足需求, 比如你要在多个异步任务完成后才进行某个操作.

»
Author's profile picture Veight Zhou

获得滚动视图停止的正确姿势

由于项目需要, 做了一个滚动视图, 不过需要它停留在一些固定的离散位置, 所以要在用户变动滚动视图偏移后, 进行一次位置的校正. 所以要在合适的实际进行校正函数的调用.

»
Author's profile picture Veight Zhou

Swift 中的函数及其外部参数名

稍微学习了一下 Swift 。

»
Author's profile picture Veight Zhou

CRC冗余生成及校验

前阵子写的一个CRC冗余计算的代码. - 不同类型的 CRC 矩阵直接丢二进制了 - 由于奇偶校验是一种特殊的 CRC, 直接一起写了

»
Author's profile picture Veight Zhou

一个UITextView不回调tableView:didSelectRowAtIndexPath:的坑

我做了一个UITableView, 里边是定制的Cell, Cell中间是一个UITextView.根据需要就能想到, 这个UITextView是不允许用户编辑, 选择, 没有任何视觉变化. 本意是想点击了TestView区域后回调tableView:didSelectRowAtIndexPath:事件的,于是楼主就这么写了:

»
Author's profile picture Veight Zhou

Hide Tabbar Controller with Animation

We always hide some bars animated, like navigation bar:

»
Author's profile picture Veight Zhou