Mac-每次获取新的值
2016-12-12 本文已影响16人
dev_wave
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,可以用来做很多操作.