Possible Duplicate:
Declared but unset variable evaluates as true?
Why does this code work on Mac OS
int main (int argc, const char * argv[]) 
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    NSString *str;
    NSLog(@"%@", [str length]);
    NSLog(@"Hello, World!");
    [pool drain];
    return 0;
}
and console output is
2011-09-23 15:37:17.481 Untitled1[80021:903] (null) 
2011-09-23 15:37:17.495 Untitled1[80021:903] Hello, World!
but crashes on iPhone ?
 
     
     
     
     
     
    