草庐IT

delegators

全部标签

iphone - 未调用区域委托(delegate)方法的 CLLocationManger

我有要求,我必须为CLLocation设置radius。我在viewDidLoad方法中编写代码如下:-(void)viewDidLoad{[superviewDidLoad];//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.locationManager=[[CLLocationManageralloc]init];[locationManagersetDelegate:self];[locationManagersetDesiredAccuracy:kCLLocationAccuracyBest];[locat

iOS,UIPickerView 以编程方式创建,空 View ,委托(delegate)工作

@大家好,我在使用UIPickerView时遇到了问题。我打算创建一个ViewController,它应该允许用户指定第二天。PickerView应显示诸如“wed,1Dec”、“thu,2dec”等字符串问题是PickerView是空的(PickerView不显示任何字符串)。尽管委托(delegate)方法返回必要的字符串计数和字符串本身。空PickerView的图像-LINK下面是我的代码。.h@interfaceOMSDatePickerViewController:UIViewController@property(nonatomic)NSIntegeramountOfDay

iOS 推送通知 : How to get the "Notification identifier" within the delegate

当我通过APNs向我的iOS应用程序发送推送通知时,大多数情况下一切正常。将收到通知,我可以从application:(UIApplication*)applicationdidReceiveRemoteNotification:(NSDictionary*)userInfofetchCompletionHandler:(void(^)(UIBackgroundFetchResult)的userInfo字典中读取负载))completionHandler方法。但是userData不包含NotificationIdentifier,它是自iOS7以来新的NotificationForma

ios - 当 Exchange 和 iCloud 电话号码在同一个条目中时,ABPeoplePicker 委托(delegate)返回不正确的标识符

我遇到一个问题,即ABPeoplePickerNavigationController似乎为电话号码从Exchange和iCloud同步的联系人返回了错误的标识符。我的应用程序在iOS7.1上运行并使用iOS7.1SDK编译。TL;DR-在人员选择器委托(delegate)回调中,当我有一个联系人将Exchange和iCloud的电话号码合并在一起时,我得到了错误的标识符。抢先回答:是的,我正在调用ABMultiValueGetIndexForIdentifier。只有当我有一个联系人同时使用Exchange和iCloud的电话号码时,才会出现此问题。我运行了使用iOS6.1SDK编译

iOS - 如何获得委托(delegate)类

我怎样才能得到我的委托(delegate)的类别?我想调用类似self.delegate.class的东西,但它不存在。我的目标是调用2种不同的方法,具体取决于哪个类发起了具有协议(protocol)的类。 最佳答案 您可以(并且应该)使用respondsToSelector来检查该委托(delegate)是否能够响应该选择器,而不是试图找出类。例子:if([self.delegaterespondsToSelector:@selector(method1:)]){[self.delegatemethod1:self];}elsei

ios - UIDocumentPickerViewController 委托(delegate) : startAccessingSecurityScopedResource always returns NO

知道为什么startAccessingSecurityScopedResource在以下UIDocumentPickerViewController回调中总是返回NO:-(void)documentPicker:(UIDocumentPickerViewController*)in_documentPickerViewControllerdidPickDocumentAtURL:(NSURL*)in_pickedDocumentAtURL{BOOLl_bStartAccessingWorked=[in_pickedDocumentAtURLstartAccessingSecurityS

ios - 警告 : Application delegate received call to

我正在实现本地通知方法,但我收到了该警告Warning:Applicationdelegatereceivedcallto-application:handleActionWithIdentifier:forLocalNotification:withResponseInfo:completionHandler:butthecompletionhandlerwasnevercalled.这是我在didfinishlaunchmethod中的代码if([applicationrespondsToSelector:@selector(registerUserNotificationSett

ios - 永远不应触发嵌套优化。这可能是由于自动布局工作发生在 NSISVariable 委托(delegate)回调中

应用程序崩溃,日志给了我这条消息:“永远不应触发嵌套优化。这可能是由于自动布局工作发生在NSISVariable委托(delegate)回调中,这是不允许的。”如何解决这个问题? 最佳答案 以为我是在后台线程中更新UI。尝试放置:if([NSThreadisMainThread]){NSLog(@"isMainThread");}else{NSLog(@"isNotMainThread");在UI更新行旁边,以便在后台线程中找到UI更新。例子:if([NSThreadisMainThread]){NSLog(@"isMainThre

ios - UIDocumentPickerViewController - 未调用委托(delegate)方法

我正在使用UIDocumentPickerViewController从文件中选择文档并将其上传到服务器。我能够成功访问文件,但在单击文件后不会调用委托(delegate)方法。我使用了以下代码来调用文档选择器:classUploads:UIViewController{overridefuncviewDidLoad(){super.viewDidLoad()//Doanyadditionalsetupafterloadingtheview.}overridefuncdidReceiveMemoryWarning(){super.didReceiveMemoryWarning()//D

iPhone:模态视图和委托(delegate)中的僵尸对象

我的应用程序有时会发生崩溃,我在启用僵尸的情况下进行了测试,发现此方法是僵尸,此方法通常可以正常工作,但在某些情况下,例如在某些时候来回导航很多,它会崩溃。我在@property中保留了datepickerView,在deaaloc中释放了它。 最佳答案 在dealloc中将datePickerDelegate设置为nil。如果它在第一次实例化后有一个保留属性,委托(delegate)中可能会有一个死引用,并且会在启用Zombies时随机导致创建和崩溃。崩溃的发生是因为保留属性释放了以前的值,如果它是死引用,崩溃就会随之而来——随机