I am doing a shopping cart tutorial: I have an array that collects input from a text field, and then displays it in the NSTableView. You can check an item, and remove it from the list. I want to display a warning only if something is checked. So, I have this:
-(IBAction)removeItemFromShoppingList:(id)sender {
int selectedItemIndex = [shoppingListTableView selectedRow];
if (selectedItemIndex == -1) return;
NSAlert *alert = [[NSAlert alloc] init];
...
[alert runModal];
[alert release];
}
On line 2 here (int selectedItemIndex...) I get a yellow warning: Implicit conversion loses integer precision:’NSInteger’ (aka ‘long’) to ‘int’.
Why?
