首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

获取iphone手机内存以及硬盘存储空间大小的有关问题

2012-08-31 
获取iphone手机内存以及硬盘存储空间大小的问题请问谁知道获取iphone手机内存以及硬盘存储空间大小的方法,

获取iphone手机内存以及硬盘存储空间大小的问题

请问谁知道获取iphone手机内存以及硬盘存储空间大小的方法,,紧急求救啊。。。 小弟这里先谢谢了。。

?

?

?

?

问题已解决。

?

- (NSString *)commasForNumber:(long long) num?

?{

//Produce a peroperly formatted number string

//Alternatively use NSNumberFormatter

if(num < 1000) return [NSString stringWithFormate:@"%d",num];

return [[self commasForNumber:num/1000] stringByAppendingFormat:@",%03d",(num % 1000)];

}

?

- (void) action:(UIBarButtonItem *)bbi

{

NSFileManager *fm = [NSFileManager defaultManager];

NSDictionary *fattributes = [fm fileSystemAttributesAtPath:NSHomeDirectory()];

NSLog(@"System space: %@",[self commasForNumber:([[fattributes objectForKey:NSFileSystemSize] longLongValue])]);

NSLog(@"System free space: %@",[self commasForNumber:([[fattributes objectForKey:NSFileSystemFreeSize] longLongValue])]);

}

热点排行