get the row number from table view

Posted by Faizan Tanveer on Stack Overflow See other posts from Stack Overflow or by Faizan Tanveer
Published on 2011-11-26T09:45:33Z Indexed on 2011/11/26 9:53 UTC
Read the original article Hit count: 288

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c