五一深圳之旅
五一的时候去了女友家,正好遇到了她们家里有些事情,我算是清闲了两三天,当然没有电脑网络。
去诺信网吧遇到了lol帐号被清空,玩完一局结束后被封号的各种问题,才发现我帐号记错了,但是玩一把被封号还真是恶心到我了哈。
五一的时候去了女友家,正好遇到了她们家里有些事情,我算是清闲了两三天,当然没有电脑网络。
去诺信网吧遇到了lol帐号被清空,玩完一局结束后被封号的各种问题,才发现我帐号记错了,但是玩一把被封号还真是恶心到我了哈。
Swift 2.2 以后的 seletor 使用有两种方式:
var dict = [Int:Any]()
dict[1] = 15
let x = dict[1] as? String
print(x) // nil because dict[1] is an Int
let zz = dict[1] as! String // crashes because a forced downcast fails
dict[2] = "Yo"
let z = dict[2] as! String?
print(z) // optional("Yo")
let z2 = dict[2] as! String
print(z2) // exactly String
let m = dict[3] as! String?
print(m) // nil. the forced downcast succeeds, but dict[3] has no value
警告 Treating a forced downcast to ‘NSNumber’ as optional will never produce ‘nil’
提示 Fix-it use ‘as?’ to perform a conditional downcast to ‘NSNumber’
最近用 swfit 需要一个 barbuttonitem,在 storyboard 创建后 connect 到 viewcontroller 发现,在 viewdidload 里还有值,被隐藏然后再次加载的时候为 nil。
From a practical perspective, in iOS and OS X outlets should be defined as declared properties. Outlets should generally be weak, except for those from File’s Owner to top-level objects in a nib file (or, in iOS, a storyboard scene) which should be strong. Outlets that you create should therefore typically be weak, because:
Outlets that you create to subviews of a view controller’s view or a window controller’s window, for example, are arbitrary references between objects that do not imply ownership.
The strong outlets are frequently specified by framework classes (for example, UIViewController’s view outlet, or NSWindowController’swindow outlet).
Jade官网 Node Template Engine,自己来看就是简便 html 标签语言的一种实现。对了现在改名叫做 pug 了。
这个语法还是有点不习惯,尤其是分支感觉很凌乱。
你对本页的描述