如何以编程方式查找我的iphone应用程序的大小? [英] how to find size of my iphone app programatically?

查看:95
本文介绍了如何以编程方式查找我的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天全站免登陆