Saturday, September 21, 2013

Objective-C > NSMutableSet

1. Declare a new NSMutableSet object named "":
 NSMutableSet *favouriteFruits = [NSMutableSet setWithCapacity: 3];


2. Common class method [ + ] and instance methods [ - ]:

+: Class Method: 無須實體化就可以使用的方法 (生仔用only)
-: Instance Method: 需先實體化才可以使用的方法,假設str1 已經是NSString 文字實體 (生完仔, 對仔落指令)

[-] (void) addObject: (id) object


Notes: Despite being added twice, @"Apple" only appears in the set once.



1 comment: