Open main menu

CDOT Wiki β

Changes

User:John Dang

51 bytes added, 03:15, 12 May 2009
Apple Development: varargs list must be nil-terminated; also removed extra right brackets
<li>'''''- (NSUInteger)count'''''</li>
<span style="color:#6600FF;">NSArray</span> *nsarray = [<span style="color:#6600FF;">NSArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Source!"</span>, nil];
<span style="color:#6600FF;">NSUInteger</span> *count;
<li>'''''- (id)objectAtIndex:(NSUInteger)index'''''</li>
<span style="color:#6600FF;">NSArray</span> *nsarray = [<span style="color:#6600FF;">NSArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Source!"</span>, nil];
<span style="color:#6600FF;">NSObject</span> *nsobject = [nsarray <span style="color:#660099;">objectAtIndex</span>:0];
<li>'''''- (id)lastObject'''''</li>
<span style="color:#6600FF;">NSArray</span> *nsarray = [<span style="color:#6600FF;">NSArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Source!"</span>, nil];
<span style="color:#6600FF;">NSObject</span> *nsobject = [nsarray <span style="color:#660099;">lastObject</span>];
<li>'''''- (NSUInteger)indexOfObject:(id)that'''''</li>
<span style="color:#6600FF;">NSArray</span> *nsarray = [<span style="color:#6600FF;">NSArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Source!"</span>, nil];
<span style="color:#6600FF;">NSUInteger</span> *index;
<li>'''''- (void)addObject:(id)that'''''</li>
<span style="color:#6600FF;">NSMutableArray</span> *nsmarray = [<span style="color:#6600FF;">NSMutableArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Source!"</span>, nil];
[nsmarray <span style="color:#660099;">addObject</span>]:<span style="color:#CC0000;">@"Open Mind!"</span>];
<li>'''''- (void)addObjectFromArray:(NSArray *)that'''''</li>
<span style="color:#6600FF;">NSMutableArray</span> *nmsarray = [<span style="color:#6600FF;">NSMutableArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Source!"</span>, nil]; <span style="color:#6600FF;">NSArray</span> *nsarray = [<span style="color:#6600FF;">NSArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Mind!"</span>, nil];
[nsmarray <span style="color:#660099;">addObjectFromArray</span>:nsarray];
<li>'''''- (void)insertObject:(id)that atIndex:(NSUInteger)index'''''</li>
<span style="color:#6600FF;">NSMutableArray</span> *nsmarray = [<span style="color:#6600FF;">NSMutableArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Source!"</span>, nil];
[nsmarray <span style="color:#660099;">insertObject</span>:<span style="color:#CC0000;">@"Open Mind!"</span> <span style="color:#660099;">atIndex</span>:1];
<li>'''''- (void)removeAllObjects'''''</li>
<span style="color:#6600FF;">NSMutableArray</span> *nsmarray = [<span style="color:#6600FF;">NSMutableArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Source!"</span>, nil]; [nsmarray <span style="color:#660099;">addObject</span>]:<span style="color:#CC0000;">@"Open Mind!"</span>];
[nsmarray <span style="color:#660099;">removeAllObjects</span>];
<li>'''''- (void)removeObject:(id)that'''''</li>
<span style="color:#6600FF;">NSMutableArray</span> *nsmarray = [<span style="color:#6600FF;">NSMutableArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Source!"</span>, nil]; [nsmarray <span style="color:#660099;">addObject</span>]:<span style="color:#CC0000;">@"Open Mind!"</span>];
[nsamrray <span style="color:#660099;">removeObject</span>:<span style="color:#CC0000;">@"Open Source!"</span>];
<li>'''''- (void)removeObjectAtIndex:(NSUInteger)index'''''</li>
<span style="color:#6600FF;">NSMutableArray</span> *nsmarray = [<span style="color:#6600FF;">NSMutableArray</span> <span style="color:#660099;">initWithObjects</span>:<span style="color:#CC0000;">@"Open Source!"</span>, nil]; [nsmarray <span style="color:#660099;">addObject</span>]:<span style="color:#CC0000;">@"Open Mind!"</span>];
[nsmarray <span style="color:#660099;">removeObjectAtIndex</span>:0];
1
edit