草庐IT

delegating

全部标签

objective-c - .delegate=self 是什么意思?

谁能解释一下someViewController.delegate=self和self.delegate的含义?他们在哪里帮助我们? 最佳答案 委托(delegate)向您发送消息。例如:如果您使用加速度计委托(delegate),您将收到有关加速度计的消息。如果您使用新的中微子检测委托(delegate),您将收到有关在该区域检测到的任何中微子的消息。如果您使用PopUps,PopUps会向您发送消息。完成的方式是使用PopUp的委托(delegate)。有很多很多的例子。所以,委托(delegate)发送消息。就这么简单。您可能

iphone - 获取对 UIApplication 委托(delegate)的引用

我正在编写我的第一个iPhone应用程序,但在切换View时遇到了问题。我在AppDelegate(UIApplicationDelegate的一个实例)中有2个View和对每个View的引用。我在applicationDidFinishLaunching中创建了这两个实例并立即显示第一个View。这工作正常。问题是对另一个View的引用在AppDelegate中,我不知道如何获取对它的引用,因此我可以切换到另一个View。有没有办法获得对主要UIApplication或UIApplicationDelegate对象的引用? 最佳答案

iphone - 获取对 UIApplication 委托(delegate)的引用

我正在编写我的第一个iPhone应用程序,但在切换View时遇到了问题。我在AppDelegate(UIApplicationDelegate的一个实例)中有2个View和对每个View的引用。我在applicationDidFinishLaunching中创建了这两个实例并立即显示第一个View。这工作正常。问题是对另一个View的引用在AppDelegate中,我不知道如何获取对它的引用,因此我可以切换到另一个View。有没有办法获得对主要UIApplication或UIApplicationDelegate对象的引用? 最佳答案

ios - 使用 UIViewControllerInteractiveTransitioning 委托(delegate)协议(protocol)实现自定义 UIViewController 交互式过渡的正确方法

我对如何创建实现UIViewControllerInteractiveTransitioning协议(protocol)以管理两个UIViewControllerNSObject子类的简洁示例感兴趣s。理想情况下响应滑动手势。类似于现在随UINavigationController提供的iOS7默认交互式滑动,但这是一个自定义/手动实现示例。我已阅读文档:UIViewControllerContextTransitioningUIPercentDrivenInteractiveTransitionUIViewControllerInteractiveTransitioningUIVie

ios - 使用 UIViewControllerInteractiveTransitioning 委托(delegate)协议(protocol)实现自定义 UIViewController 交互式过渡的正确方法

我对如何创建实现UIViewControllerInteractiveTransitioning协议(protocol)以管理两个UIViewControllerNSObject子类的简洁示例感兴趣s。理想情况下响应滑动手势。类似于现在随UINavigationController提供的iOS7默认交互式滑动,但这是一个自定义/手动实现示例。我已阅读文档:UIViewControllerContextTransitioningUIPercentDrivenInteractiveTransitionUIViewControllerInteractiveTransitioningUIVie

ios - 无法关闭 MFMailComposeViewController,未调用委托(delegate)

我正在从UITableViewController调用MFMailComposeViewController。问题是当我在邮件撰写窗口中选择Cancel或Send按钮时,从不调用委托(delegate)方法:mailComposeController:(MFMailComposeViewController*)controllerdidFinishWithResult这是表格View类:@implementationDetailsTableViewController-(void)tableView:(UITableView*)tableViewdidSelectRowAtIndexP

ios - 无法关闭 MFMailComposeViewController,未调用委托(delegate)

我正在从UITableViewController调用MFMailComposeViewController。问题是当我在邮件撰写窗口中选择Cancel或Send按钮时,从不调用委托(delegate)方法:mailComposeController:(MFMailComposeViewController*)controllerdidFinishWithResult这是表格View类:@implementationDetailsTableViewController-(void)tableView:(UITableView*)tableViewdidSelectRowAtIndexP

ios - 委托(delegate)如何在 Objective-C 中工作?

有谁知道我在哪里可以找到关于应用程序委托(delegate)在objective-C中的工作原理和工作原理的良好解释/教程?我所拥有的两本书对delegates的论述不够深入,也没有很好地解释它们,让我无法真正理解它们的力量和功能。 最佳答案 如有疑问,请查看docs!基本上,委托(delegate)是一种允许对象相互交互而不会在它们之间创建强相互依赖关系的方式,因为这会降低应用程序的设计灵active。与其让对象相互控制,它们可以有一个向其发送(或委托(delegate))消息的委托(delegate),并且委托(delegate

ios - 委托(delegate)如何在 Objective-C 中工作?

有谁知道我在哪里可以找到关于应用程序委托(delegate)在objective-C中的工作原理和工作原理的良好解释/教程?我所拥有的两本书对delegates的论述不够深入,也没有很好地解释它们,让我无法真正理解它们的力量和功能。 最佳答案 如有疑问,请查看docs!基本上,委托(delegate)是一种允许对象相互交互而不会在它们之间创建强相互依赖关系的方式,因为这会降低应用程序的设计灵active。与其让对象相互控制,它们可以有一个向其发送(或委托(delegate))消息的委托(delegate),并且委托(delegate

ios - Objective C 的 iPhone 开发中的 "delegate"是什么?

这个问题在这里已经有了答案:HowdoIcreatedelegatesinObjective-C?(19个回答)关闭9年前。ObjectiveC的iPhone开发中的“委托(delegate)”是什么? 最佳答案 委托(delegate)是一个指向具有一组方法的对象的指针,委托(delegate)持有者知道如何调用。换句话说,它是一种一种从后来创建的对象启用特定回调的机制。一个很好的例子是UIAlertView。您创建一个UIAlertView对象来向用户显示一个短消息框,可能让他们选择两个按钮,如“确定”和“取消”。UIAlert