码迷,mamicode.com
首页 > 其他好文 > 详细

NSBundle/其他Bundle的获取

时间:2015-07-18 12:14:36      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:

#define D_SharkItOffViewControllerBundleName @"SharkItOffViewController.bundle"     //套装名称

//其他nsbundle都是在[[NSBundle mainBundle] resourcePath]目录下
        NSString *path = [[NSBundle mainBundle] resourcePath];
        NSString *path2 = [NSString stringWithFormat:@"%@/%@",path, D_SharkItOffViewControllerBundleName];
        NSBundle *bundle = [NSBundle bundleWithPath:path2];
        NSString *str = [bundle pathForResource:@"dance.mp3" ofType:nil];
        self.musicData = [NSData dataWithContentsOfFile:str];

 

NSBundle/其他Bundle的获取

标签:

原文地址:http://www.cnblogs.com/apem/p/4656363.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!