jjgod / blog Random notes & thoughts by Jiang Jiang.

Archive for May 2007

管理大型的 Cocoa 项目

NetNewsWire 的作者 Brent Simmons 最近的一篇文章介绍了如何有效的管理大型 Cocoa 项目。他的建议可以总结为下面几条: 为了改善代码的可读,可查找性,应该遵循: 只对那些没有明显关系的对象之间的交互使用 Notification。 Key-Value Observing 也是很危险的,应该只对 Preferences 项目使用这一特性。 只将 Binding 用于很简单的情形,复杂的 TableView 还是用 datasource/delegate 比较好。 管理代码时可以使用的技巧: 用 #pragma mark 来划分代码的区域 用 Ctrl-2 来列出当前打开文件的符号 outline。 用 Shift-cmd-D 来快速打开指定文件。 用 opt-cmd-T 来将当前打开的文件和左侧的目录树同步。 ctrl+double click 打开符号的定义,opt+double click 打开符号的文档。 在文件系统中用平面方式组织文件,不划分多层目录,在 Xcode project 中用 group 来划分层级结构。 对于有 Cocoa 开发经验的人,尤其是管理过这种超过 200 个源文件的较大项目的人来说,这些经验是很有用的。

用 mac + shntool + lame 转换 APE 到 MP3

这里介绍在 Mac OS X 中如何用 mac, shntool 和 lame 来完成 ape – mp3 的工作,只需要一个命令就可以完成。 mac 用我以前贴的那个。 shntool 可以 sudo port install shntool,但它的来源网站似乎被 GFW 了,你可以自行下载编译: $ wget http://www.vi.kernel.org/pub/mirrors/gentoo/source/distfiles/shntool-3.0.2.tar.gz $ tar zxf shntool-3.0.2.tar.gz $ cd shntool-3.0.2; ./configure; make; sudo make install lame 可以用 macports 上的: $ sudo port install lame 然后这样处理 APE: $ shntool split -f CDImage.cue [...]

After →