为indexPath swift循环

时间:2016-06-17 13:53:34

标签: ios uitableview

我有问题我不知道写循环 问题在于UITableView我尝试写入条件,如果选择相同的字符串

,则检查indexPath行
  

// show error Type' NSIndexPath!'不符合协议   '序列类型'

 func autoCompleteTextField(_ textField: MLPAutoCompleteTextField!, didSelectAutoCompleteString selectedString: String!, withAutoCompleteObject selectedObject: MLPAutoCompletionObject!, forRowAtIndexPath indexPath: NSIndexPath!) {
       if ((selectedObject) != nil){

           print("selected object from autocomplete menu \(selectedString) with string \(selectedObject.autocompleteString())")
       }
       else {  

           for i in indexPath {
             if (indexPath.row == selectedString){
                /// to do
              }
            }       
         print("selected string \(selectedString) from autocomplete menu")
      }
 }

0 个答案:

没有答案