草庐IT

delegating-constructor

全部标签

ios - 在自定义 UIview 中设置 UItableview 的委托(delegate)和数据源

我有一个自定义的UIView,它有几个不同的View,还有一个UITableview。我创建了一个自定义类,它是UITableViewController的子类。这将控制UITableview和UITableView的Prototype单元格。如果我将delegate和datasource设置为父View,我会收到以下错误:-[RoadSafetyAppViewControllertableView:numberOfRowsInSection:]:unrecognizedselectorsenttoinstance0x10c92f190其中RoadSafetyAppViewContro

ios - NSURLSession 下载重新启动而不调用任何委托(delegate)

我注意到我的应用程序中有一个与NSURLSession相关的奇怪行为。我使用带有后台配置的NSURLSession开始下载,下载开始没有任何问题,但在某些时候,显然是随机的,它停止了几秒钟,然后重新启动而不调用除之外的任何委托(delegate)-URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:重置字节数。谁能告诉我发生了什么事?这是我初始化session的方式if([[[UIDevicecurrentDevice]systemVersion]compare:@"8.0"o

ios - 未调用自定义委托(delegate)方法

我正在尝试将Apple的TableViewUpdates(扩展TableView单元格)示例改编为我自己的应用程序,但我似乎无法让它工作。我试着缩小问题的范围,我想我现在知道问题出在哪里了。Apple使用UITableViewController作为View的基本Controller,但我有一个UIViewController,它具有UITableViewDelegate和DataSource作为委托(delegate)方法。我像这样向其中添加了HeaderViewDelegate:@interfaceSearchViewController:UIViewControllerIngre

ios - App Delegate的应用:didReceiveLocalNotification: not called

在我的应用程序中,永远不会调用方法-(void)application:(UIApplication*)applicationdidReceiveLocalNotification:(UILocalNotification*)notification。这是我创建通知的方式:UILocalNotification*notification=[[UILocalNotificationalloc]init];//setUUID,whichwewillstoreinuserDefaultsforlaterNSMutableDictionary*myUserInfo=[[NSMutableDic

ios - AFHTTPSessionManager 委托(delegate)问题

这是我的问题:我有一个AFHTTPSessionManager文件,它也是一个单例文件,用于管理我对服务器的所有API请求。当我使用responseObject从服务器获得答案后,​​我将它传回给使用委托(delegate)请求它的UIViewController。我的问题是:由于我的经理是单例,如果同时由另一个UIViewController发出另一个API请求,委托(delegate)将设置为此Controller,并且当我的第一个请求responseObject已收到,我无法再将其传回第一个UIViewController。我希望它很容易理解。解决这个问题的正确方法是什么?这是我

c# - 在没有参数的情况下难以绑定(bind) iOS 委托(delegate)方法

为Xamarin绑定(bind)iOSlib.a时,出现以下错误:btouch:ThedelegatemethodDevice.SomeDeviceDelegate.CaptureCompleteneedstotakeatleastoneparameter(BI1003)绑定(bind)已生成ObjectiveSharpie.namespaceDevice{//@protocolSomeDeviceDelegate[Protocol,Model,Preserve][BaseType(typeof(NSObject))]interfaceSomeDeviceDelegate{//@opt

ios - RACDelegateProxy 与 Common Delegate 实现

我正在研究ReactiveCocoa(我不擅长FRP,也不擅长纯函数式编程)并且我看到了RacDelegateProxy类,它可以抽象具有void返回值的委托(delegate)方法的实现。我没有弄清楚的是使用它的好处是什么,当我们与传统实现进行比较时,即实现每个方法并获得调用。那么,使用RACDelegateProxy而不是以传统方式实现的主要区别和好处是什么?代码示例(使用ReactiveCocoa):self.deselectDelegate=[[RACDelegateProxyalloc]initWithProtocol:@protocol(UITableViewDelegat

ios - 我在创建委托(delegate)时收到警告

我正在使用MPGTextField.在.h文件中,我收到以下警告:Autopropertysynthesiswillnotsynthesizeproperty'delegate',itwillbeimplementedbyitssuperclass,use@dynamictoacknowledgeintention代码如下:#import@protocolMPGTextFieldDelegate;@interfaceMPGTextField:UITextField//HereiswhereIgetthewarning:@property(nonatomic,weak)iddelegat

ios - 在 ViewController 之间切换后,如何重置导航委托(delegate)

导航开始,所有委托(delegate)方法都已设置,一切都按预期进行。但是,如果用户切换到另一个ViewController,而导航仍处于打开状态,并返回到导航ViewController,则导航委托(delegate)会发生一些事情,并且所有导航委托(delegate)方法都没有响应。我当然尝试再次设置它们[SKRoutingServicesharedInstance].navigationDelegate=self;甚至尝试先将它们设置为nil然后再将它们设置为self[SKRoutingServicesharedInstance].navigationDelegate=nil;[

ios - 如何弱链接 iOS 应用程序委托(delegate)方法?

我想在我的iOS8应用程序中添加对iOS9中引入的新3DTouchQuickActions的支持。我知道我需要使用弱链接方法,但问题是我不知道为应用程序委托(delegate)方法执行此操作的正确语法。要处理快速操作,我的应用委托(delegate)需要实现新的application:performActionForShortcutItem:completionHandler:方法,但是以一种不会在iOS8上崩溃的弱链接方式执行此操作的语法是什么?我做到了这一点://iOS9only...if([UIApplicationDelegateinstancesRespondToSelect