问了一些问题后,我学会了如何将命令从一个ViewController发送到另一个ViewController,并设法编写了可以正常工作的代码,但没有任何反应......在我的项目中,我有两个名为sayfa1和sayfa23的ViewController。单击sayfa1上的按钮时,它会打开sayfa23并在标签上书写(随机打招呼,请参阅下面的代码)但它没有发生。在模拟器上,该按钮只会打开sayfa23并且标签没有任何变化。如果您查看代码,您会更好地理解它。sayfa1.h#import@protocolsayfa1Delegate-(void)dealWithButton1;@end@
我使用Martin的tutorial创建了一个自定义UITabBarController.我的子类FSTabBarController在ViewController之间切换,并且在我看来正常运行。问题是,当我将tabBarContoller更改为我的子类时,它不会响应我的委托(delegate);-(void)tabBarController:(UITabBarController*)tabBarControllerdidSelectViewController:(UIViewController*)viewController如果我将它改回UITabBarController-当我使
我有一个对象作为我的ViewController和我的网络服务之间的连接层。该对象接受一个委托(delegate),并在从服务器返回数据时通知该委托(delegate)。我遇到了一个问题,即委托(delegate)在运行http请求时被解除分配。当请求返回时,我的对象尝试调用委托(delegate)上的方法并且应用程序崩溃。处理此问题的最佳方法是什么。我在几个地方读到你不应该保留你的委托(delegate),因为他们经常也保留对象,导致循环依赖。因此,如果我不能保留我的委托(delegate),我如何在调用方法之前检查它是否已被解除分配?@property(nonatomic,assi
我想了解使用–initWithRequest:delegate:和委托(delegate)方法和+sendAsynchronousRequest:queue:completionHandler:之间的区别。是否存在基于请求数量或任何其他标准的一些性能差异? 最佳答案 sendAsynchronousRequest:queue:completionHandler调用起来更容易。initWithRequest:delegate让您可以更好地控制缓存、重定向、下载大量或增量数据、取消请求等。
我在表格View的单元格上添加了一个按钮,就像这样-UIButton*checkBoxBtn=[UIButtonbuttonWithType:UIButtonTypeCustom];[checkBoxBtnsetBackgroundImage:[UIImageimageNamed:@"check_normal.png"]forState:UIControlStateNormal];[checkBoxBtnaddTarget:selfaction:@selector(checkBoxAction:)forControlEvents:UIControlEventTouchUpInside]
我有一个应用程序,我在其中使用像facebook应用程序一样的侧边菜单Controller。它基本上是一个UITableViewController。当我使用[self.tableViewreloaddata]时该View将首次显示方法正常工作。由于某些要求,我需要从另一个ViewController重新加载此TableView。所以我这样做了:SideMenuViewController*second=[[SideMenuViewControlleralloc]init];[secondviewWillappear:YES]我在哪里重新加载数据。但是当我这样做时,reloaddata
我正在构建一个类似于iPhone照片应用程序的应用程序。我可以使用PSUICollectionView在类似View的网格中显示图像。当我点击CollectionView的网格单元格时,应该会出现一个复选框图像。我的问题是当我使用以下代码时,我看到多个随机单元格中填充了复选框图像。-(void)collectionView:(PSUICollectionView*)collectionViewdidSelectItemAtIndexPath:(NSIndexPath*)indexPath{NSLog(@"%@-%d",NSStringFromSelector(_cmd),indexPa
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visitthehelpcenter.关闭9年前。我是iOS的新手,拥有C#/Java背景。我读过一些讨论委托(delegate)模式及其重要性的文章。一旦我开始使用它,我就注意到它实际上只是设计接口(interface)并使用定义的方法传递数据。这个说法是真的吗?对于了解.net或java的iOS高手,我可以说委托(delegate)模式只是接口(interface)设计,并使用方法在实现该接口(interface)的类之间传递数据吗?还是Ob
我在一个类中有一个协议(protocol):@protocolDataStorageManager-(void)saveFile;@end@interfaceDataManager:NSObject{iddelegate;}@property(nonatomic,assign)iddelegate;//methods@end及其实现:@implementationDataManager@synthesizedelegate;@end我还有另一个类,它是第一个和第三个之间的适配器:#import"DataManager.h"#import"DataPlistManager.h"@inte
环境:运行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