我刚开始学习IOS开发.每次运行此程序时,控制台都不会始终显示我的NSLog.
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
NSMutableArray *items = [[NSMutableArray alloc] init];
[items addObject:@"One"];
[items addObject:@"Two"];
[items addObject:@"Three"];
[items insertObject:@"zero" atIndex:0];
NSLog(@"Object at 0 is %@", [items objectAtIndex:0]);
NSLog(@"Object at 1 is %@", [items objectAtIndex:1]);
NSLog(@"Object at 2 is %@", [items objectAtIndex:2]);
NSLog(@"Object at 3 is %@", [items objectAtIndex:3]);
for (int i = 0; i < [items count]; i++) {
NSLog(@"%@", [items objectAtIndex:i]);
}
items = nil;
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我每次运行时都应该在控制台中获取它:
2012-04-11 …Run Code Online (Sandbox Code Playgroud)