0

ディレクトリから画像を表示したいと思います。ディレクトリに、写真を保存するためのフォルダーを作成しました。Use of undeclared identifier 'NSFileManagerdefaultManager' and Use of undeclared identifier '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;
}
4

1 に答える 1