get the row number from table view
- by Faizan Tanveer
i am new in iphone development, i am using table view to list name of the student, what i want to do is i want to get the row number of the cell the user pressed , currently i can get the name(string) of the cell,
//code in didSelectRowAtIndexPath
//the obj.name where is a string, it works fine
obj.name=[obj.studentname objectAtIndex:indexPath.row];
//if i try obj.num , where num is nsinteger .i am getting errors of type i dnt understand
obj.num=[[obj.studentname objectAtIndex:indexPath.row]count];
i even tried
but i cant get the number. example if faizan lies on 12th cell. what i want to do is,is save 12 in a number and show it on the next view label.i cant put it in the variable
thanks for your help in advance