Ios 无法识别的选择器(NSMutableArray+;NSString)

Ios 无法识别的选择器(NSMutableArray+;NSString),ios,nsstring,nsmutablearray,unrecognized-selector,Ios,Nsstring,Nsmutablearray,Unrecognized Selector,一个非常基本但令人费解的错误 NSString *selectedCategory = @"Rock"; if (self.quoteOpt.selectedSegmentIndex == 1) { selectedCategory = @"Programming"; } //filter array by ti tle using predicate NSPredicate *predicate = [NSPredicate predicateWithFormat:@"G

一个非常基本但令人费解的错误

NSString *selectedCategory = @"Rock";

if (self.quoteOpt.selectedSegmentIndex == 1) 
{
        selectedCategory = @"Programming";
}

//filter array by ti tle using predicate
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"Genre == %@", selectedCategory];
NSArray *filteredArray = [self.movieQuotes filteredArrayUsingPredicate:predicate];

int array_tot = [filteredArray count];

if(array_tot > 0)
{
   int index = (arc4random() % array_tot);
   NSMutableArray *a = [filteredArray objectAtIndex:index];
   NSString *s = [a objectAtIndex:1];
   self.quoteText.text = [NSString stringWithFormat:@"Genre \n\n %@",s];
}
else
{
   self.quoteText.text = [NSString stringWithFormat:@"No quotes to display."];
}
我对它的行为方式感到困惑,大量产生的错误来自

NSString *s = [a objectAtIndex:1];
我做了一个po六地址,看起来是int,但它是从哪里来的

将*a和*s结果分别发送至

*a:

*s:

我不明白,我一直在寻找,但错误是非常普遍/模糊的性质,没有具体的答案可以获得。(我的两分钱)


TIA

如果你把你的过滤数据记录下来,输出是什么?(NSArray*)$2=0x06a6c1c0({Genre=Rock;Name=carry;Title=government;},{Genre=Rock;Name=Creed;“New item”=Higher;})嗯,你确定这是索引1中的NSString吗?正如geraldWilliam所说,它看起来像数组中的NSDictionary,而不是字符串..self.movieQuotes是PropList中的NSDictionary,然而,我似乎很困惑,您是指这行代码NSArray*filteredArray=[self.movieQuotes filteredArray使用谓词:谓词];不是隐式地说它是一个数组吗?它是一个数组-NSLog证明了这一点。只是不确定它是否包含字符串。尝试使用id而不是NSString并设置一个断点-然后在将其从数组中取出时查看它是什么类型。意思是id s=[a objectAtIndex:1]
(NSMutableArray *) $3 = 0x088941f0 {
  Genre = Rock;
  Name = Creed;
  "New item" = Higher;
 }
(int) $4 = 143213040 {
  Genre = Rock;
  Name = Creed;
  "New item" = Higher;
}