NSString *bundlePath = [NSBundle mainBundle].bundlePath;
NSError *error = nil;
NSDictionary *dict = [[NSFileManager defaultManager] attributesOfItemAtPath:bundlePath error:&error];
NSUInteger number = [dict fileSystemFileNumber];
NSLog(@"%tu",number);
NSAlert *alert = [[NSAlert alloc] init];
alert.messageText = [NSString stringWithFormat:@"%tu",number];
[alert runModal];
每次安装都会获取一个新的value,可以用来做很多操作.
网友评论