NSBundle/其他Bundle的获取

#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];

 

posted @ 2015-07-18 10:41  apem  阅读(313)  评论(0编辑  收藏  举报