This file contains hidden or 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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSMutableArray *myMutableArray = [NSMutableArray array]; | |
[myMutableArray insertObject:[NSString stringWithString:@"1"] | |
atIndex:[myMutableArray count]]; | |
[myMutableArray insertObject:[NSString stringWithString:@"2"] | |
atIndex:[myMutableArray count]]; |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSMutableArray *myMutableArray = [NSMutableArray array]; | |
[myMutableArray insertObject:[NSString stringWithString:@"1"] | |
atIndex:[myMutableArray count]]; | |
[myMutableArray insertObject:[NSString stringWithString:@"2"] | |
atIndex:[myMutableArray count]]; |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSMutableArray *myMutableArray = [NSMutableArray array]; | |
[myMutableArray insertObject:[NSString stringWithString:@"1"] | |
atIndex:[myMutableArray count]]; | |
[myMutableArray insertObject:[NSString stringWithString:@"2"] | |
atIndex:[myMutableArray count]]; |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSMutableArray *myMutableArray = [NSMutableArray array]; | |
[myMutableArray insertObject:[NSString stringWithString:@"1"] | |
atIndex:[myMutableArray count]]; | |
[myMutableArray insertObject:[NSString stringWithString:@"2"] | |
atIndex:[myMutableArray count]]; |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSMutableArray *array = [NSMutableArray array]; | |
NSLog(@"%@", array); | |
[array addObject:[NSString stringWithString:@"blackColor"]]; | |
NSLog(@"%@", array); | |
[array insertObject:[NSString stringWithString:@"redColor"] atIndex:0]; |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSMutableArray *anArray = [NSMutableArray array]; | |
[anArray addObject:[NSString stringWithString:@"red"]]; | |
id anObject = [anArray objectAtIndex:0]; | |
[anArray removeObjectAtIndex:0]; | |
[anObject someMessage]; // crash !!! |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSMutableArray *anArray = [NSMutableArray array]; | |
[anArray addObject:[NSString stringWithString:@"red"]]; | |
id anObject = [[anArray objectAtIndex:0] retain]; | |
[anArray removeObjectAtIndex:0]; | |
NSLog(@"%@", anObject); |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSArray *keys = [NSArray arrayWithObjects:@"key1", @"key2", @"key3", nil]; | |
NSArray *objects = [NSArray arrayWithObjects:@"value1", @"value2", @"value3", nil]; | |
NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys]; | |
for(id key in dictionary){ | |
NSLog(@"key: %@, value: %@", key, [dictionary objectForKey:key]); |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSArray *keys = [NSArray arrayWithObjects:@"key1", @"key2", @"key3", nil]; | |
NSArray *objects = [NSArray arrayWithObjects:@"value1", @"value2", @"value3", nil]; | |
NSMutableDictionary *dictionary = [NSMutableDictionary dictionaryWithObjects:objects forKeys:keys]; | |
for(id key in dictionary){ | |
NSLog(@"key: %@, value: %@", key, [dictionary objectForKey:key]); |
This file contains hidden or 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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: | |
[NSNumber numberWithInt:63], @"Mathematics", | |
[NSNumber numberWithInt:72], @"English", | |
[NSNumber numberWithInt:55], @"History", | |
[NSNumber numberWithInt:49], @"Geography", |