gpt4 book ai didi

iphone - 如何在我的方法中获取 objectAtIndex?

转载 作者:行者123 更新时间:2023-11-28 20:28:13 27 4
gpt4 key购买 nike

如何在我的方法中获取 objectAtIndex

例如,如果我使用 didSelectRowAtIndexPath:(NSIndexPath *)indexPath

我可以得到它

 NSLog(@"%@", [currentCourses objectAtIndex:indexPath.row]);

我怎样才能用这样的其他方法做同样的事情?

-(void)longPress : (UILongPressGestureRecognizer *)rec {
if (rec.state == UIGestureRecognizerStateBegan) {
// NSIndexPath *myPath = [NSIndexPath indexPathForRow:0 inSection:0];
/*NSArray *currentCourses = [self currentCourses:myIP0.section];
billContent *bc = [currentCourses objectAtIndex:myIP0.section];
NSLog(@"title - %@", bc.billTitle);*/
// NSLog(@"%@", myPath.row);

//NSLog(@"did selected - %d", indexPath.row);

}
}

最佳答案

-(void)longPress : (UILongPressGestureRecognizer *)rec {
CGPoint swipeLocation = [rec locationInView:self.tableView];
NSIndexPath *swipedIndexPath = [self.tableView indexPathForRowAtPoint:swipeLocation];
UITableViewCell *swipedCell = [self.tableView cellForRowAtIndexPath:swipedIndexPath];
}

关于iphone - 如何在我的方法中获取 objectAtIndex?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13265744/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com