草庐IT

ios - 无法从我的协议(protocol)类调用委托(delegate)方法

我在一个类中有一个协议(protocol):@protocolDataStorageManager-(void)saveFile;@end@interfaceDataManager:NSObject{iddelegate;}@property(nonatomic,assign)iddelegate;//methods@end及其实现:@implementationDataManager@synthesizedelegate;@end我还有另一个类,它是第一个和第三个之间的适配器:#import"DataManager.h"#import"DataPlistManager.h"@inte

ios - 将不兼容的类型分配给委托(delegate)

环境:运行iOS8.0SDK的Xcode版本6.0(6A254o)我正在尝试将主UIViewController(呈现Controller)作为委托(delegate)分配给呈现的弹出式UIViewController:#import"MainViewController.h"#import"OrangeViewController.h"#import"MessageViewController.h"@interfaceMainViewController(){OrangeViewController*orangeVC;MessageViewController*msgVC;}@pro

ios - 为什么我的委托(delegate)变成零?

这个委托(delegate)模式我已经做过一百万次了。在第一百万次我得到一个零委托(delegate):CatViewController*vc=[[UIStoryboardstoryboardWithName:@"Cat"bundle:nil]instantiateInitialViewController];vc.delegate=self;[selfpresentViewController:vcanimated:YEScompletion:^{DDLogWarn(@"[%@%@]delegate:%@",THIS_FILE,THIS_METHOD,vc.delegate);//

ios - 带有模态表单的自定义委托(delegate)不起作用

我已经浏览了之前的大部分相关帖子,但尽管我已经正确地遵循了它们(据我所知),但我根本无法为下面的代码触发委托(delegate)方法。目的:ModalView生成字符串*SQL_String。按DONE关闭ModalView并触发父View中的委托(delegate)方法以获取*SQL_String。SearchModalViewController.h@protocolSearchControllerDelegate-(void)didDismissModalView:(NSString*)SQL_String;@end@interfaceSearchModalViewControl

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

这是我的代码:classFetchResultControllerDataProvider:NSObject,NSFetchedResultsControllerDelegate{privateletfetchedResultController:NSFetchedResultsControllerprivatevardelegate:TodayViewController!init(fetchedResultController:NSFetchedResultsController,delegate:TodayViewController){self.fetchedResultCon

iOS WKWebView.scrollView 委托(delegate)导致 BAD_ACCESS

我的viewController有一个包含WKWebView的UIView属性。我将WKWebViewscrollView委托(delegate)设置为我的viewController,这是我的UIView子类的公共(public)函数,并在我的viewController中调用。问题是当我调用[viewControllerpopViewControllerAnimated]时,它会在[UIScrollViewsetDelegate:]上崩溃。我通过在viewController的dealloc中添加viewController.UIView.WKWebView.scrollView.

ios 委托(delegate) Objective-c 数据从第二个 View Controller 发送到第一个 View Controller

我有2个ViewController。第一个是UIviewController,第二个是TableViewController。我想在选择第二个ViewController的行后将第二个数据(TableViewController)发送到第一个(uiviewController)。为此,我编写了一个委托(delegate)协议(protocol)。但是我的委托(delegate)协议(protocol)不起作用...我想出了问题。我正在创建的第二个ViewController的对象。address=[[second_viewcontrolleralloc]init];address.d

ios - 为什么 UICollectionViewFlowLayout 子类没有委托(delegate)属性?

Apple提供了UICollectionViewFlowLayout类,以及一个UICollectionViewDelegateFlowLayout协议(protocol),方法如下funccollectionView(collectionView:UICollectionView,layoutcollectionViewLayout:UICollectionViewLayout,minimumLineSpacingForSectionAtIndexsection:Int)->CGFloat和funccollectionView(collectionView:UICollectionV

ios - 更改 Storyboard后未调用 Tabbar 委托(delegate)方法

我在登录Storyboard中有登录和注册ViewController,而不是在主Storyboard中。一旦注册或登录成功,我就会将登录Storyboard更改为Main。以下代码有效,但是当我选择任何选项卡时,它不会调用AppDelegate中的选项卡委托(delegate)方法但是,如果用户已经成功注册或登录,则会调用以下标签栏委托(delegate)方法。LoginViewController.mif(isLoginSuccess){UIStoryboard*mainStoryboard=[UIStoryboardstoryboardWithName:@"Main"bundle

ios - Facebook iOS SDK - 自定义委托(delegate)

我正在开发一个与Facebook集成的新项目。该应用程序必须向facebook发出不同的请求。SDK提供一个委托(delegate)来处理每个相同的请求。现在我需要有一个自定义委托(delegate)来处理某些不同的请求。有人可以提示我如何完成此操作吗? 最佳答案 Facebook类公开了许多返回FBRequest*对象的方法,并且每个方法都有一个委托(delegate)参数,委托(delegate)可以是您喜欢的任何对象,只要它符合FBRequestDelegate协议(protocol)即可。因此,只要有一个自定义类即可为每种类