2013-10-18 26 views
0

我正在使用此代码为我的下拉列表中选择我的默认索引标题。 当我运行上IOS 6它在别的一部分进入此代码,当我上IOS 7运行它在如果部分进入而它应该别的部分进入。 请帮助我。错误的选择在ios 7中使用相同的代码

-(void)setSelectedIndexPath:(NSIndexPath *)selectedIndexPath 
{ 

_selectedIndexPath = selectedIndexPath; 
if (_selectedIndexPath.row == NSNotFound) { 
    [self.selectedValueLabel setText:self.title]; 
} 
else{ 
    [self.selectedValueLabel setText:[self.dataSource dropDown:self optionTitleForRowAtIndexPath:_selectedIndexPath]]; 
} 

} 
+1

需要更多的代码来帮助你...我们无法猜出它 – AncAinu

回答

0

iOS 7中几乎没有变化,其中使用nil代替标记值。设置一个断点并检查indexPath是否因为某种原因为nil。如果是,[nil row]将返回0而不是NSNotFound