草庐IT

delegators

全部标签

iOS - 在 didFinishLaunchingWithOptions 委托(delegate)之前调用 viewDidLoad?

我有一个按预期运行的应用程序。但是,我在rootViewController的viewDidLoad方法的第一行放置了一个断点,在委托(delegate)的didFinishLaunchingWithOptions的第一行放置了另一个断点,令我惊讶的是,应用程序进入了viewDidLoad方法,然后转到didFinishLaunchingWithOptions,然后又执行了一次viewDidLoad方法。这是怎么回事?我认为这种行为是完全错误的。提前致谢!#已编辑这是我的iPad委托(delegate)didFinishLaunchingWithOptions方法:-(BOOL)app

iphone - 委托(delegate)方法协议(protocol)不工作 - Objective-C

我正在为我的iPad开发一个splitView应用程序。我实现了一个名为Upload的UIButton。单击它时,UITableView会出现在UIPoverController中。单击任何内容后,我想在UIDetailView中的UIwebView中显示一些相应的站点。为此,我实现了一个委托(delegate)方法协议(protocol)。我在UploadTableViewController.h文件中使用了以下代码行::@protocolUploadTableViewDelegate@required-(void)selected:(NSString*)his;@end@inter

ios - 返回值对 UI TextField 委托(delegate)方法 textFieldShouldReturn :? 意味着什么

苹果文档提供:Asksthedelegateifthetextfieldshouldprocessthepressingofthereturnbutton.-(BOOL)textFieldShouldReturn:(UITextField*)textFieldParameterstextFieldThetextfieldwhosereturnbuttonwaspressed.ReturnValueYESifthetextfieldshouldimplementitsdefaultbehaviorforthereturnbutton;otherwise,NO.DiscussionThet

ios - 无法在 NSURLSession 委托(delegate)方法中更新用户界面

-(void)URLSession:(NSURLSession*)sessiondownloadTask:(NSURLSessionDownloadTask*)downloadTaskdidWriteData:(int64_t)bytesWrittentotalBytesWritten:(int64_t)totalBytesWrittentotalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite{floatprogress=(float)((float)totalBytesWritten/(float)totalBytesE

iOS 我可以将所有委托(delegate)方法放在另一个类上吗?将委托(delegate)继承到 View Controller 中

我想要的是将我所有的委托(delegate)方法集中到一个类中。我可以在其中使用其默认值或重写委托(delegate)方法。例如:ViewController.m#import@interfaceViewController:UIViewController@endViewController.h#import"ViewController.h"#import"TableDelegateContainers.h"@interfaceViewController()@end@implementationViewController-(void)viewDidLoad{[superview

ios - 在实现 mapView :didTapMarker: delegate method implemented 时在 google maps iOS sdk 中点击标记时显示信息窗口

好的,这是一个很长的标题。我在使用googlemapsiOSsdk时遇到了问题。我想显示一个关于用户点击的标记的信息窗口。根据文档,如果GMSMarker的snippet和title属性都被选中,则当用户点击该标记时,将显示信息窗口。但我还实现了mapView:didTapMarker:GMSMapViewDelegate协议(protocol)中的方法。如果我注释掉该方法信息窗口可见,否则信息窗口不可见。那么,当该方法实现时,我该如何显示信息窗口呢? 最佳答案 实现GMSMapViewDelegate的mapView:didTap

ios - NSFetchedResultsController 委托(delegate)方法调用谓词更改

我有一个简单的应用程序,其中有国家有城市,而城市又有人。我想在表格View中显示国家列表。我使用NSFetchedResultsController来获取所有数据。这是设置:-(void)initializeFetchedResultsController{NSFetchRequest*fetchRequest=[[NSFetchRequestalloc]initWithEntityName:@"Country"];fetchRequest.sortDescriptors=@[[NSSortDescriptorsortDescriptorWithKey:@"name"ascending

ios - UITableView 中的多个委托(delegate)/数据源

Objective-cdelegates一次接受一个instance就像我有两个viewcontrollers并且都实现相同的委托(delegate),但只是目前呈现的viewcontroller接收回调。如果我在同一个viewcontroller中有两个uitableviews两个uitableview'sdelagatesdatasource设置为tb1.datasource=self;tb2.datasource=self;tb1.delegate=self;tb2.delegate=self;uitableview如何与同时定义的委托(delegate)一起工作?

ios - map View :didDeselectAnnotationView: delegate method getting called before the annotation view is actually deselected

我正在使用填充有自定义图钉的mapView。当用户点击map上的某处取消选择一个图钉时,我想实现map,以便该图钉不会被取消选择(即用户无法在不选择其他图钉的情况下取消选择图钉,因此始终至少选择一个图钉).这是我对didDeselectAnnotationView方法的实现:-(void)mapView:(MKMapView*)mapViewdidDeselectAnnotationView:(MKAnnotationView*)view{[mapViewselectAnnotation:view.annotationanimated:NO];}本质上,我正在尝试重新选择注释。然而,经

ios - 使用 MKAnnotationView 委托(delegate)时引脚消失

我的MKAnnotationView委托(delegate)方法已被调用,因为我可以看到我的NSLog输出。但是,图钉没有出现在map上。我在这里遗漏了什么吗?MapViewController.h#import#import@interfaceMapViewController:UIViewController@property(weak,nonatomic)IBOutletMKMapView*nearbyMapView;@endMapViewController.m#import"MapViewController.h"#import"AppDelegate.h"@interfac