如何以编程方式找到我的iPhone应用程序的大小? [英] How to find size of my iPhone app programmatically?

查看:65
本文介绍了如何以编程方式找到我的iPhone应用程序的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力寻找iphone应用程序的大小以及框架,但是我没有找到一种方法来做到这一点.有人可以为我提供代码吗?我得到了在运行时查找应用程序当前内存使用情况的代码.

I'm working on finding size of iphone app along with frameworks but I didn't find a way how to do this.can anyone provide me code for this? I got the code of finding current memory usage of my app while running.

链接在此处

推荐答案

NSString *folderPath = [[NSBundle mainBundle] bundlePath];
NSArray *filesArray = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath:folderPath error:nil];
NSEnumerator *filesEnumerator = [filesArray objectEnumerator];
NSString *fileName;
unsigned long long int fileSize = 0;

while (fileName = [filesEnumerator nextObject]) {
    NSDictionary *fileDictionary = [[NSFileManager defaultManager] fileAttributesAtPath:[folderPath stringByAppendingPathComponent:fileName] traverseLink:YES];
    fileSize += [fileDictionary fileSize];
}

NSLog(@"App size : %lld",fileSize);

这篇关于如何以编程方式找到我的iPhone应用程序的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆