If you are experiencing an issue please mention the full platform your issue applies to:
IDE: NetBeans
OS: iOS
Device: iPhone 4 (ios 7.1.2), iPhone 5 (ios 9.3.2)
CN1 version: 3.4.3
I found a very rare bug in ios, when an exception occurs when trying to get a substring of an empty string inside a for loop, even when this code is inside a try-catch block, the system breaks the loop. Here is the code to reproduce it:
String[] names = {"Ulises", "John", "", "Alexis", "Willy"};
String resultStr = "";
for (int i = 0; i < names.length; i++){
try{
String firstChar = names[i].substring(0, 1);
resultStr += firstChar;
}catch(Exception ex){
Dialog.show("Error Dialog", "This dialog will show but the for statment should not have to break", "ok", "cancel");
}
}
Dialog.show("Result Dialog", resultStr, "ok", "cancel");
The result string should be "UJAW" but in iOS the result string is "UJ".
I have already submited the issue #1834