iOS操作系统的大小

时间:2020-12-25 03:16:19

how can I GET The size of the operating system OF iOS ,Accurate to byte。I want to know exactly the size of the operating system is accurate to byte,if so,I can Identification equipment。

我怎样才能获得iOS操作系统的大小,精确到字节。我想知道操作系统的大小是否准确到字节,如果是这样,我可以识别设备。

1 个解决方案

#1


This should help you out I believe...

这应该会帮助你我相信......

-(float)getFreeSpace{  
float freeSpace = 0.0f;  
NSError *error = nil;  
NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:kSongsFolder error: &error];  

if (dictionary) {  
    NSNumber *fileSystemFreeSizeInBytes = [dictionary objectForKey: NSFileSystemFreeSize];  
    NSLog(@"%d",fileSystemFreeSizeInBytes);
    freeSpace = [fileSystemFreeSizeInBytes floatValue];  
} else { 
    //Handle error
}  
return freeSpace; 

}

#1


This should help you out I believe...

这应该会帮助你我相信......

-(float)getFreeSpace{  
float freeSpace = 0.0f;  
NSError *error = nil;  
NSDictionary *dictionary = [[NSFileManager defaultManager] attributesOfFileSystemForPath:kSongsFolder error: &error];  

if (dictionary) {  
    NSNumber *fileSystemFreeSizeInBytes = [dictionary objectForKey: NSFileSystemFreeSize];  
    NSLog(@"%d",fileSystemFreeSizeInBytes);
    freeSpace = [fileSystemFreeSizeInBytes floatValue];  
} else { 
    //Handle error
}  
return freeSpace; 

}