How to get the indexpath based on sections in uitableview?
<p>Hi i am working with Tableview i am facing one issue.My table like number of sections with in that number of rows now in my cellForRowAtIndexPath when i fetch my array like below </p>

<pre><code>NSInteger rowNumber = 0;

    for (NSInteger i = 0; i &lt; indexPath.section; i++) {
        rowNumber += [self tableView:tableView numberOfRowsInSection:i];
    }

    rowNumber += indexPath.row;
NSString *messageStatus = [[_messageArray1 objectAtIndex:rowNumber] chatStatus];
NSString *messageID1=[[_messageArray1 objectAtIndex:rowNumber] messageID];
    NSString *messageString=[[_messageArray1 objectAtIndex:rowNumber] msg];
</code></pre>

<p>but it is showing suppose section 2 row 2 but in rownumber it is showing 2 only but i need like section 1 rows +section 2 row number.in case if i give indexpath.row it is showing same like rownumber.
how to acheive it please help me</p>