获取手机内存

-(NSString *) freeDiskSpaceInBytes{//#include//#includestruct statfs buf;

long long freespace = -1;

if(statfs("/var", &buf) >= 0){

freespace = (long long)(buf.f_bsize * buf.f_bfree);

}

return [NSString stringWithFormat:@"手机剩余存储空间为:%qi MB" ,freespace/1000/1000];

}

你可能感兴趣的:(获取手机内存)