NSBundle的用法

1> 一个NSBundle代表一个文件夹,利用NSBundle能访问对应的文件夹

2> 利用mainBundle就可以访问软件资源包中的任何资源

  

       // 利用mainBundle就可以访问软件资源包中的任何资源

        NSBundle *bundle = [NSBundle mainBundle];

       //  获得某文件的全路径

        NSString *path = [bundle pathForResource:filename ofType:nil];

        UIImage *image = [UIImage imageWithContentsOfFile:path];

posted @ 2014-03-26 23:29  lanchong910  阅读(98)  评论(0编辑  收藏  举报