小编wol*_*ine的帖子

如何在xcode 4.2中的Supporting Files文件夹中获取文件?

我已经完成了以下步骤.1.创建了一个xcode项目,并在Supporting Files中创建了一个名为"Images"的文件夹.

  1. 将4张图片拖放到其中.试图使用以下代码访问这些文件

    NSString *pathString = [[NSBundle mainBundle] pathForResource:@"Images" ofType:nil];
    NSArray *fileList = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:pathString error: nil];
    NSLog(@"the fileList is %d",[fileList count]);
    
    Run Code Online (Sandbox Code Playgroud)

计数总是0.我现在该怎么办?里面有文件,我可以在图像视图中使用它.

那我犯的错是什么?

filesystems iphone nsbundle xcode4.2

1
推荐指数
1
解决办法
5605
查看次数

我们如何检查对象属于哪个类?

我在scrollView中有很多不同类的对象.在做一些操作时,我想打印每个对象的父类.我该怎么做?

iphone uiview ipad

0
推荐指数
1
解决办法
461
查看次数

标签 统计

iphone ×2

filesystems ×1

ipad ×1

nsbundle ×1

uiview ×1

xcode4.2 ×1