Tag: 行动

表行操作使用indexPath行继续

所以我有一个表格视图和自定义VC。 那么我有一个对象与detailImage属性练习。 我怎样才能从表行操作indexPath.row到我的prepareForSegue函数? 这返回nil : self.tableView.indexPathForSelectedRow override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "detailsSegue" { if let indexPath = self.tableView.indexPathForSelectedRow { let destinationController = segue.destinationViewController as! DetailViewController print(self.exercises[indexPath.row].image) destinationController.detailImage = self.exercises[indexPath.row].image print ("send") } } }

如何使一个button做多个动作xcode

好了所以在我的Xcode项目我有一个button,我需要做两次相同的方法,但与不同的图像PLZ帮助 码: UIImage * toImage = [UIImage imageNamed:@"CharacterBackwards.png"]; [UIView transitionWithView:self.view duration:0.01f options:UIViewAnimationOptionTransitionNone animations:^{ self->Guy.image = toImage; } completion:NULL]; sleep(0.4);