small medium large xlarge

Generic-user-small
11 Jan 2012, 03:11
janeh (4 posts)

At the top of page 208, when I enter the code:

-(IBAction)removeItemFromShoppingList:(id)sender {
   int selectedItemIndex = [shoppingListTableView selectedRow];
   if (selectedItemIndex == -1) return;
   ...

I get a yellow warning on line 2:

“Implicit conversion loses integer precision:’NSInteger’ (aka ‘long’) to ‘int’.” I get the same warning in the sample files provided.

Why?

Generic-user-small
11 Jan 2012, 03:48
janeh (4 posts)

It looks like selectedRow method returns a value of type NSInteger, so selectedItemIndex should not be an int… ?

You must be logged in to comment