home ‣ Collections: NSArray, NSMutableArray, NSDictionary, NSMutableDictionary, NSSet, NSMutableSet, NSCountedSet

15 Mar 2008 · Tags: objective c ← newer • 93 of 588older →

NSArray:  - (unsigned) count  - (id) objectAtIndex:(int)  - (BOOL) containsObject:(id)anObject
NSMutableArray  - (void)addObject:(id)anObject  - (void)insertObject:(id)anObject atIndex:(unsigned)index  - (void)removeObjectAtIndex:(unsigned)index  - (void)removeObject:(id)anObject

NSDictionary:  - (unsigned) count  - (void) setObject:(id)anObject forKey:(id)aKey
  - (NSArray*) allKeys
  - (id) objectForKey:(id)aKey

NSMutableDictionary
  - (void)setObject:(id)anObject forKey:(id)aKey
  - (void)removeObjectForKey:(id)aKey

To store int, float, long: wrap inside NSNumber object

Serializing to/from a file (in plist format):
  - (id)initWithContentsOfFile:(NSString*)aPath
  - (BOOL)writeToFile:(NSString*)aPath atomically:(BOOL)flag

blog comments powered by Disqus