我尝试使用 Arraycontroller 将存储桶的内容加载到 NSTableView 中。我以这个错误结束了uo:
-[__NSCFString objectAtIndex:]: unrecognized selector sent to instance 0x1006da970
这是我用来检查的代码。
- (IBAction)checkCloud:(id)sender {
AmazonS3Client *s3 = [AmazonClientManager s3];
S3ListObjectsRequest* listObjectsRequest = [[S3ListObjectsRequest alloc] initWithName:@"hello-testing"];
NSMutableArray *fileListCloud = [[NSMutableArray alloc] init];
NSMutableArray *fileModifiedList = [[NSMutableArray alloc] init];
@try {
S3ListObjectsResponse* response = [s3 listObjects:listObjectsRequest];
NSMutableArray* objectSummaries = response.listObjectsResult.objectSummaries;
for ( S3ObjectSummary* objSummary in objectSummaries ) {
[fileListCloud addObject:[objSummary key]];
[fileModifiedList addObject:[objSummary lastModified]];
}
}
@catch (NSException *exception) {
NSLog(@"Cannot list S3 %@",exception);
}
[self loadFileListTable:fileListCloud andFileModificationDate:fileModifiedList];
}
-(void)loadFileListTable:(NSMutableArray *)fileListArray andFileModificationDate:(NSMutableArray *)modifiedArray{
NSRange range = NSMakeRange(0, [[_fileListAC arrangedObjects] count]);
[_fileListAC removeObjectsAtArrangedObjectIndexes:[NSIndexSet indexSetWithIndexesInRange:range]];
for(int i = 0 ; i<[fileListArray count];i++){
[_fileListAC addObject:[NSMutableDictionary dictionaryWithObjectsAndKeys:[[fileListArray objectAtIndex:i] objectAtIndex:0],@"Files",[[modifiedArray objectAtIndex:i] objectAtIndex:1],@"Date Modified", nil]];
}
}
数组加载了文件名,但是当我将它添加到数组控制器时,它会引发上述错误。任何帮助都会非常棒。