简体   繁体   中英

How can I programmatically get the row at which a new UITableViewCell is created?

Because my UITableView gets sorted by a date (not the current date), most of the time, when I tap a UIButton called: Add a new entry to a NSMutableArray gets added [cellList addObject:managedObject] which is the UITableView 's datasource, then the UITableView gets reloaded so that the new UITableViewCell is displayed. I want to get the indexPath of that new cell. But Like I said, since my UITableView gets sorted by a date, the cellList 's indexes doesn't always correspond to the UITableView 's.

So how can I get the indexPath of the cell that was just created by reloading the table's data?

Any idees would be much appreciated!

Look for documentation of NSIndexPath. It has properties like row & sections. I hope it should solve your needs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM