Created
May 11, 2013 04:30
-
-
Save chajka/5558898 to your computer and use it in GitHub Desktop.
役に立たない奇妙なTips ref: http://qiita.com/items/9ab9f315f935820e5c53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nullObject : (null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id nullObject = [[nil alloc] init]; | |
NSLog("%@", nullObject); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class klass = nil; | |
switch (condition) { | |
case a: | |
klass = [MyClass1 class]; | |
break; | |
case b: | |
klass = [MyClass2 class]; | |
break; | |
default: | |
klass = nil; // なくても良い | |
break; | |
}// end case by condition | |
id instance = [[klass alloc] init]; | |
// 以下適切な処理を |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment