Skip to content

Commit

Permalink
增添代码
Browse files Browse the repository at this point in the history
  • Loading branch information
100mango committed Sep 17, 2015
1 parent c1eb30f commit ff61831
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions iOS夯实:Crash in Cocoa/Crash in Cocoa.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,24 @@ Cocoa中会导致Carsh的地方:
##1. 集合类越界:

- 数组类型

越界访问会crash

- 字典类型

查询时:
objectForKey,key为nil。能够正常运行。

~~~objective-c
- (nullable ObjectType)objectForKey:(KeyType)aKey;
~~~
当key为nil。能够正常运行。

插入时:
setObject:forKey:。object和key任一为nil,都会crash

~~~objective-c
- (void)setObject:(ObjectType)anObject forKey:(KeyType <NSCopying>)aKey;
~~~
插入时object和key任一为nil,都会crash

- 字符串类型

Expand Down

0 comments on commit ff61831

Please sign in to comment.