라벨이 available인 게시물 표시

[iOS] How to get Storage Available

how to get storage available -(NSNumber *)getStorageAvailable {     NSNumber *availableGiga = [NsNumber numberWithFloat:0.0f];     NSError *error = nil;     NSArray *paths = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);     NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:[paths lastObject] error:&error];     // 소수 2자리까지 표시     NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];     formatter.roundingIncrement = [NSNumber numberWithFloat:0.01];     formatter.numberStyle = NSNumberFormatterDecimalStyle;     if (dictionary) {         NSNumber *availableByte = [dictionary objectForKey:NSFileSystemFreeSize];         availableGiga = [NSNumber numberWithFloat:((([availableByte floatValue] / 1024) / 1024) / 1024)];         NSLog(@"%@G", [f...