草庐IT

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

在我的应用程序中,我有一个RootViewController(UIPageViewController)、一个FirstController(UIViewController)和一个SecondController(UIViewController)。两个UIViewController中的两个View在RootViewController上滚动。在我的RootViewController.h中:@interfaceRootController:UIPageViewController但是当我在不同的View之间滚动时,委托(delegate)方法如下:-(void)pageView

iphone - CLLocationManager 从不调用委托(delegate)方法

这个问题在这里已经有了答案:WhytheCLLocationManagerdelegateisnotgettingcallediniPhoneSDK4.0?(5个答案)关闭7年前。您好,我在iPhone上玩弄位置,从一开始我就遇到了问题。我已经定位了我的问题并确定是CLLocationManager困扰着我。所以我开发了非常简单的应用程序。我只有一个带有CLLocationManager的ViewController。在View加载时,我初始化了CLLocationManager并开始更新。我还实现了两种方法didFailWithError和didUpdateToLocation。我已

ios - 加载委托(delegate)时警告窗口层次结构

今天我更新了我的Xcode,并开始为新的iPhone5屏幕更新我的应用程序。我突然注意到,每次从屏幕A转到屏幕B时,我都会收到此警告:Warning:Attempttopresentonwhoseviewisnotinthewindowhierarchy!//ThisdelegatemethodpreparestheseguefromScreenA(DilemmaViewController)toScreenB(OptionsViewController)-(void)prepareForSegue:(UIStoryboardSegue*)seguesender:(id)sender{

ios - 无法配置数据源和委托(delegate)

所以我将Xcode和GitHub项目代码升级到swift3.0(我的项目在ObjC中,我从GitHub使用的一些pod在Swift中)。我遇到了一堆错误,现在我被困在这些错误上了。出于某种原因,我的数据源和floatingActionButton(githere)的委托(delegate)现在不起作用。我尝试以编程方式和Storyboard上设置dataSource和delegate,但没有成功。错误:Property'dataSource'notfoundonobjectoftype'LiquidFloatingActionButton*'Property'delegate'notf

ios - 正确访问 segue 的目标 View Controller 以分配协议(protocol)委托(delegate)

在实现选择列表时,我在集成segue和协议(protocol)时遇到了一些问题。在我的选择列表.h中我有:#import@protocolSelectionListViewControllerDelegate@required-(void)rowChosen:(NSInteger)row;@end@interfaceSelectColor:UITableViewController-(IBAction)saveSelectedColor;@property(nonatomic,strong)iddelegate;@end在我的选择列表.m中,我有:@implementationSele

c# - Xamarin 表单 DisplayAlert 在从委托(delegate)调用的函数调用时不显示

当我从size函数内部调用Greet时,DisplayAlert会按预期显示警报但是,当在事件发生后从委托(delegate)中调用它时,它将使用正确的名称(GreetHasbeenCalled)记录到输出,但DisplayAlert不会节目。publicclassCustomPage:ContentPage{...protectedoverridevoidOnValidSizeAllocated(doublewidth,doubleheight){...Greet("Test");app.FB.GetName();app.FB.NameRecieved+=(s,e)=>{Greet(

IOS:两个tableview的tableview委托(delegate)方法

我在一个类中有一个TableView的委托(delegate)方法:-(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView{return1;}-(NSInteger)tableView:(UITableView*)tableViewnumberOfRowsInSection:(NSInteger)section{return[array1count];}-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndex

iphone - 将在 Interface Builder 中创建的 UITabBarController 设置为委托(delegate)

我使用TabBar模板创建了我的iOS应用程序,所以这里是带有条形按钮的UITabBarController。一个问题是如何将其设置为委托(delegate)。我在SO发现它必须在AppDelegate中以编程方式设置,但我认为这是不可能的,因为我无法访问TabBarController作为导出。我为@interface添加了正确的值(包括ViewController和AppDelegate),但不知道下一步该做什么。@interfaceViewController:UIViewController我希望我不必摆脱整个应用程序模板,并且可以将在IB中创建的TabBarControlle

ios - 从应用程序委托(delegate)获取当前 View Controller (模态是可能的)

我知道要从应用委托(delegate)获取当前ViewController,我可以使用为我的应用设置的navigationController属性。但是,在我的应用程序的许多地方,模态导航Controller可能已经呈现。有什么方法可以从应用程序委托(delegate)中检测到这一点,因为当前的导航Controller将不同于应用程序委托(delegate)持有引用的导航Controller? 最佳答案 基于gisthere,我创建了一个类别来获取最顶层的ViewController,这样调用[[UIApplicationshare

ios - 我的 iOS 委托(delegate)方法是否应该始终在主线程上返回?

这是一个“最佳实践”问题,我似乎无法在网上找到好的答案。我正在创建一个静态代码库,它提供了几个用于进度反馈的委托(delegate)方法。库管理它自己的队列,所以下载之类的事情显然不是在主线程上完成的,但我的问题是我应该确保我的委托(delegate)方法总是在主线程上调用,还是从我正在使用的排队线程?如果他想在我的委托(delegate)方法中进行UI更新,是否依赖于使用该库的开发人员检查他是否在主线程上?干杯,山姆 最佳答案 您可以采用任何一种方式;您只需要将其记录下来即可。有些API会在主线程上回调您,有些会在您用来开始工作的