0
可以在下面的for循環中執行segue,或者我正在設置自己的麻煩嗎?可以在for循環中執行segue嗎?
或者它只是簡單地執行segue,其餘的代碼永遠不會執行?
for(symbol in results) {
if ([symbol.data hasPrefix:@"--"]) {
actualBarCodeStr = [symbol.data substringFromIndex:2];
[self performSegueWithIdentifier:@"trListViewToTrSearchView" sender:self];
} else {
createTransactionResult = [NWBarCodeHelper createTransactionRowFromBarCode:symbol.data];
if ([NWTillHelper isDebug] == 1) {
NSLog(@"Zbar delegate holds barcode: %@", symbol.data);
if(createTransactionResult != 0) {
NSLog(@"TransactionListView:ZBarDelegate:createTransactionFrombarCode failed with errorCode %i", createTransactionResult);
}
}
}
}
如果賽格沒有動畫,它可能會很好。通過動畫,控制器可能會以未定義的狀態結束。仍然不是你應該做的。 – Sulthan
那麼我在這裏有什麼選擇?我必須運行for循環才能獲取數據,在performSegue後可以直接斷開嗎?或者我該做些什麼,設置一個標誌並在方法中進一步執行下一步?一旦我清除了for循環? –