In if (indexPath.row < (isFiltered?searchResults.count:originalTable.count)) is working, but in delegate compiler show 2 errors:
Is bug or I cannot use ?: in my example?
[EDIT}
Forget it, it’s my mistake But it show that compiler do not warn for problem. Problem is that originalTable is generic NSMutableArray table, so it have my member like id. searchResults is NSArray. So simple trying to get id member from NSArray show this error.
private NSArray searchResults;
...... fill table with any values
int _id = searchResults[indxb].id;
Trying to reproduce on clean project and it correctly show that array do not contain id. Will try to use most of code from my project to reproduce it (cannot send full project).
Okay did something, but project do not show error. Anyway it should not compile, but it this do. Probably with larger project reported error happen. Please check comments in code.
NSLog(searchResults[indxb].id.stringValue); // this should not compile
Put cursor in .id, click F12 and see where it bring us, to public class testItem and it id property. searchResults is defined as private NSArray searchResults; so how compiler knows what object is stored in that array to bring us to testItem class? If this will be NSArray<testItem> then all will be okay. Probably You mean that EVERY object have .id property and that’s why it should compile, right?
As I said, it my project (bigger as this example attached), it cause LPUSH error. In this example it compile without any error. I think, problematic line is:
Ah the way it works with ‘id’ is that it lets you call any known property/method. NSArray (non gen) returns id so it does let you call anything on it. This matches the objc behavior.
Okay it’s clear, but if VS point that id to my class which is not related with NSArray, then in my project (bigger) it probably cause LPUSH bug. I Changed it to generic array and it’s okay, but I just report, because it can be hard to spot by somone else or with simple project as I upload.