Mac-每次获取新的值

    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,可以用来做很多操作.

你可能感兴趣的:(Mac-每次获取新的值)