我不断收到此错误:
2013-03-30 19:48:40.029 try[14838:907] -[__NSSetM objectAtIndex:]:无法识别的选择器发送到实例 0x1e8ea660 2013-03-30 19:48:40.030 try[14838:907] * 由于应用程序终止uncaught exception 'NSInvalidArgumentException', reason: '-[__NSSetM objectAtIndex:]: unrecognized selector sent to instance 0x1e8ea660' * First throw call stack: (0x33e523e7 0x3bb43963 0x33e55f31 0x33e5464d 0x33dac208 0xe5bc7 0x35cac569 0x35c91391 0x35ca8827 0x35c648c7 0x35a10513 0x35a100b5 0x35a10fd9 0x35a109c3 0x35a107d5 0x35a10639 0x33e27941 0x33e25c39 0x33e25f93 0x33d9923d 0x33d990c9 0x3797733b 0x35cb52b9 0x7b495 0x3bf70b20) libc++abi.dylib:终止调用抛出异常 (lldb)
// 这是我的代码:
- (void)fetchTweets
{
UIApplication* app = [UIApplication sharedApplication];
app.networkActivityIndicatorVisible = YES;
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSData* data = [NSData dataWithContentsOfURL:
[NSURL URLWithString: @"***.json"]];
NSError* error;
tweets = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:&error];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
});
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return tweets.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"showVideo";
CustomVideoCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if(!cell)
{
cell = [[CustomVideoCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
UIImageView *av = [[UIImageView alloc] initWithFrame:CGRectMake(20, 20, 277, 58)];
av.backgroundColor = [UIColor clearColor];
av.opaque = NO;
av.image = [UIImage imageNamed:@"cell_bg.png"];
cell.backgroundView = av;
UIImage *image = [UIImage imageNamed:@"disclosure_arrow_white.png"];
UIImageView *av2 = [[UIImageView alloc] initWithFrame:CGRectMake(44.0, 44.0, image.size.width, image.size.height)];
av2.backgroundColor = [UIColor clearColor];
av2.opaque = NO;
av2.image = [UIImage imageNamed:@"disclosure_arrow_white.png"];
cell.accessoryView = av2;
NSDictionary *tweet = [tweets objectAtIndex:indexPath.row];
cell.title.text = [tweet objectForKey:@"title"];
NSLog(@"t: %@",[tweet objectForKey:@"title"]);
return cell;
}