我想从目录中显示图像。在目录中,我创建了文件夹来存储图片。我收到一条错误消息,提示使用未声明的标识符“NSFileManagerdefaultManager”和使用未声明的标识符“documentsDirectory”;你的意思是“NSDocumentDirectory”吗?和错误的接收器类型'NSUInteger'(又名'unsigned int')。我无法摆脱这一点。我正在尝试,但它不起作用。
-(void)viewDidLoad
{
[super viewDidLoad];
//configure carousel
imageArray1 = (NSMutableArray *)[[NSFileManager defaultManager] directoryContentsAtPath: fPath];
NSString *location=@"Tops";
NSString *fPath = [documentsDirectory stringByAppendingPathComponent:location];
NSArray *directoryContent = [[NSFileManager defaultManager] directoryContentsAtPath: fPath];
imageArray1 = [directoryContent mutableCopy];
imageArray2 = [[NSMutableArray alloc] init];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
location=@"Bottoms";
fPath = [documentsDirectory stringByAppendingPathComponent:location];
directoryContent = [[NSFileManager defaultManager] directoryContentsAtPath: fPath];
imageArray2 = [directoryContent mutableCopy];
carousel1.type = iCarouselTypeLinear;
carousel2.type = iCarouselTypeLinear;
}