Hi everyone,
I'm using Iphone SDK 3. There's some funny thing i've just seen and here's the code :
A.
==> Application crashes.
B.
==> it prints out the current object that we send the someMethod message.
Actually i've tested in some places and sometimes it crashes.
C.
==> it prints out the content of array 'a'
For B and C, i think in any circumstances it could not do that.
For A, i'm not sure but i think it should print out 'null'
Any idea ?
I'm using Iphone SDK 3. There's some funny thing i've just seen and here's the code :
A.
Code:
- (void) someMethod {
NSArray *dumbArray;
NSLog(@"%@", dumbArray)
}
==> Application crashes.
B.
Code:
- (void) someMethod {
NSLog(@"xyz");
NSArray *dumbArray;
NSLog(@"%@", dumbArray)
}
==> it prints out the current object that we send the someMethod message.
Actually i've tested in some places and sometimes it crashes.
C.
- (void) someOtherMethod {
NSArray *a = [NSArray arrayWithObjects : @"1", @"2",nil];
NSArray *dumbArray;
NSLog(@"%@", dumbArray);
}
==> it prints out the content of array 'a'
For B and C, i think in any circumstances it could not do that.
For A, i'm not sure but i think it should print out 'null'
Any idea ?