Jul
07
Difference between nullable, __nullable and _Nullable in Objective-C
Published 12:07 Jul 07, 2016 by @ezra.
#Programming# From the Swift blog:
This feature was first released in Xcode 6.3 with the keywords __nullable and ...
Jun
28
OS X: Menu Bar Extra is invisible in macOS Dark Mode
Published 12:06 Jun 28, 2016 by @ezra.
#Programming# 周末提交的 APP 又被秒拒, 理由很简单, “Menu Bar Extra is invisible in macOS Dark Mode”, 菜单栏图标在黑色模式中看不到。
由于是第一次用黑白色的...
Jun
01
OS X: csrutil
Published 12:06 Jun 01, 2016 by @ezra.
#Programming# El Capitan 加入了 Rootless 机制, 不再能够随心所欲的读写很多路径真是很难过。
Rootless 机制将成为对抗恶意程序的最后防线
要关闭 Rootless, 需要进入恢复系统...
May
13
max-height: x% doesn't work on Chrome
Published 12:05 May 13, 2016 by @ezra.
#Programming# Some times using percentages for fluidity in layouts is tricky because you have to deal with contain...
May
12
Swift: Optional Protocol Methods Without @objc
Published 12:05 May 12, 2016 by @ezra.
#Programming# Objective-C 协议 (protocol) 在 Swift 中是一个特殊的存在, 当你使用 @objc 标记一个协议, LLVM 会生成一系列额外内容:
一个 isa 指针
运行时模块, 例...
May
10
Cocoa: Change Cursor
Published 12:05 May 10, 2016 by @ezra.
#Programming# The way to change the cursor when it's over an NSButton:
First, you should subclass NSButton first,...
May
06
CSS Selectors Level 4
Published 12:05 May 06, 2016 by @ezra.
#Programming# 关于 CSS Selectors Level 4 阶段性新特性的总结。
Negation pseudo-class :not
:not 用于将符合规则的元素剔除, 将样式规则应用于其他元素上。
在 C...
Apr
27
Cocoa: Sending mail via Python
Published 12:04 Apr 27, 2016 by @ezra.
#Programming# 偶然看到一个讨论, 需求很简单, 单纯的 SMTP 邮件发送。
这样的话我想 Python 应该是一个不错的选择, 那么首先我们需要写一个 Python 程序, 我们将它保存为 mail.py:
im...
Apr
25
Sparkle 2: Publishing an update
Published 12:04 Apr 25, 2016 by @ezra.
#Programming# 配置好一些基本的内容后,是时候发布一个新版本了。
归档
首先你需要归档你的应用。
如果你使用 DMG,归档后不要再次压缩 .dmg 文件
如果你使用 ZIP,你可以通过 ditto -c -k --...
Apr
25
Sparkle 1: Setup
Published 12:04 Apr 25, 2016 by @ezra.
#Programming# 做 Mac 开发的同学应该至少都听说过 Sparkle,一个应用升级框架,Sparkle 是开源的,参考 Github。
不过需要注意的是,Sparkle 的使用场景应仅仅局限于 非 App Sto...
Apr
22
NSImage: Get size in pixels
Published 12:04 Apr 22, 2016 by @ezra.
#Programming# Just simple:
let rep = originImage.representations.first
let pixelSize = CGSize(width: (rep?.pixelsW...
Apr
14
Haskell Primer 008: 类型类
Published 12:04 Apr 14, 2016 by @ezra.
#Programming# 在 Haskell 中,类型类 (typeclass) 是定义类型行为的接口,如果一个类型是某类型类的实例 (Instance),那么它一定实现了该类型类所描述的行为。
这里需要注意,不要将 Has...