Hi all,
I'm trying to tell my UITableView to scroll to a specific row, specifically the last row.
When I try this however it crashes.
Code:
int total = [MyTableView numberOfRowsInSection: 0];
if (total > 4) {
NSIndexPath *ip = [NSIndexPath indexPathForRow: total-1 inSection:0];
[MyTableView scrollToRowAtIndexPath: ip
atScrollPosition: UITableViewScrollPositionTop
animated: NO];
[ip release];
}
Sometimes when I scroll to total-2 everything is fine, and sometimes that crashes things too.
The stack after a crash is as follows:
Code:
#0 0x029a4c93 in objc_msgSend
#1 0x04925510 in ??
#2 0x0030b698 in _UIApplicationHandleEvent
#3 0x0310817c in PurpleEventCallback
#4 0x027c489c in CFRunLoopRunSpecific
#5 0x027c38a8 in CFRunLoopRunInMode
#6 0x0310689d in GSEventRunModal
#7 0x03106962 in GSEventRun
#8 0x00309372 in UIApplicationMain
#9 0x00002704 in main at main.m:14
Thanks for any help.