Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert NSIndexPath to NSInteger?

I have searched and found a previous answer for this question here. The problem is that the answer marked as a solution does not work. Inside my tableView:didSelectRowAtIndexPath: method, I have

NSInteger *currentRow = indexPath.row;

and it gives me the warning 'Incompatible integer to pointer conversion initializing 'NSInteger *'(aka 'int *') with an expression of type 'NSInteger' (aka 'int').

Any help is appreciated!

like image 819
tarheel Avatar asked Dec 18 '11 06:12

tarheel


1 Answers

NSInteger is not a class, so it doesn't need an asterisk:

NSInteger currentRow = indexPath.row;
like image 142
Isabel Avatar answered Sep 30 '22 10:09

Isabel