0
votes

Hi i am getting this error! i am using NSNumber in indexpath.row but it giving Warning,what is wrong in my code please help.

 NSNumber *num=[NSNumber numberWithInt:indexPath.row];
        [HUD showWhileExecuting:@selector(callingMethod:) onTarget:self  withObject:num animated:YES];
2

2 Answers

5
votes

indexPath.row is returning NSInteger value not int value. Try this

NSNumber *num=[NSNumber numberWithInteger:indexPath.row];
2
votes

you can use boxed expression. here how you can do :

NSNumber *num = @(indexPath.row]);
    [HUD showWhileExecuting:@selector(callingMethod:) onTarget:self  withObject:num animated:YES];

this will convert your number with the right format;

Let me know if this help you :)