草庐IT

Controller-FlightRecorder

全部标签

ios - 按下另一个 View Controller 时, Root View Controller 的 View 消失

我正在尝试在我的UINavigationController的RootViewController上推送一个UIViewController。我正在使用自定义转换来执行此操作,以使其看起来像模态演示。CATransition*trans=[CATransitionanimation];trans.type=kCATransitionMoveIn;trans.subtype=kCATransitionFromTop;trans.duration=0.4f;trans.timingFunction=[CAMediaTimingFunctionfunctionWithName:kCAMedi

ios - isMovingToParentViewController 总是为导航堆栈的 Root View Controller 返回 FALSE?

确定导航堆栈的RootView(顶层)Controller是作为最初呈现还是未被发现的结果出现的正确方法是什么?iOS文档建议在viewWill/DidAppear:中使用isMovingToParentViewController:来做出决定。这适用于压入堆栈的ViewController,但似乎总是为堆栈RootViewController返回FALSE。感谢您的帮助。 最佳答案 看起来其他人已经回答了同样的问题:iOS:isMovingToParentViewControllerisnotworkingasexpected.虽

ios - 当界面方向颠倒时呈现 View Controller

我的iPhone应用程序支持颠倒的界面方向:当用户将手机上下颠倒(使主页按钮位于顶部)时,整个用户界面将垂直翻转。但是,当尝试从我的ViewControllerA中呈现一些ViewControllerB时出现问题(在此示例中,我呈现标准邮件编辑器ViewController):-(IBAction)buttonTapped:(id)sender{MFMailComposeViewController*mailVC=[MFMailComposeViewControllernew];mailVC.mailComposeDelegate=self;[selfpresentViewContro

ios - 如何将菜单按钮添加到选项卡栏 Controller

大家好,我正在制作一个应用程序,它使用带有三个选项卡的选项卡栏Controller以及一个滑出式抽屉导航。我的问题是如何在左上角放置一个条形按钮项目。当我运行我的应用程序时它不显示,但它显示在常规ViewController中。这是我的代码。#import"FirstViewController.h"#import"SWRevealViewController.h"@interfaceFirstViewController()@end@implementationFirstViewController-(void)viewDidLoad{[superviewDidLoad];[[UIT

ios - 当拆分 Controller 详细信息 View 指向导航 Controller 时测试目标 View Controller

我想在我的SplitViewController的详细View中添加一个导航Controller级别,但是当我这样做时,我不能使用我知道的方法来测试类类型:例如,如果我在细节方面没有导航Controller级别,我可以成功地做到这一点:-(void)tableView:(UITableView*)tableViewdidSelectRowAtIndexPath:(NSIndexPath*)indexPath{iddetail=self.splitViewController.viewControllers[1];if([detailisKindOfClass:[myDetailTVCc

ios - 容器 View Controller 无法处理 Unwind Segue 操作

我在尝试使用自定义segue从作为subviewController添加到另一个ViewController的ViewController中放松时遇到问题。这是MyCustomSegue.m:-(void)perform{if(_isPresenting){//PresentFirstVC*fromVC=self.sourceViewController;SecondVC*toVC=self.destinationViewController;toVC.view.alpha=0;[fromVCaddChildViewController:toVC];[fromVC.viewaddSub

ios - GKPeerPicker Controller 中出现重复的对等名称

如果我在我的两个ios设备上多次连接和断开蓝牙,我会得到重复的对等名。有没有办法在gkpeerpickercontroller中为蓝牙聊天应用程序获取唯一对等点的单一名称。同时附上截图。我使用下面的代码来显示GKPeerPickerController。-(IBAction)btnConnectClicked:(id)sender{[selfopenPeerPickerController];}-(IBAction)btnDisconnectClicked:(id)sender{[currentSessiondisconnectFromAllPeers];}-(void)openPee

用于 uinavigationcontroller 的 iOS 开源智能 Controller 推送/弹出库?

我有一个应用程序,用户可以在其中无限深入View(插入导航堆栈)。在某些时候,会有内存警告。我想从导航Controller中删除ViewController并释放它们。如果用户返回到那些ViewController,我想重新创建ViewController并将它们推回到堆栈中的正确位置。这是思考这个问题的正确方式吗?是否有一个开源项目可以做到这一点?这似乎不是一个罕见的问题,我不想重新发明轮子。 最佳答案 曾经有一段时间您需要确保对viewDidLoad和viewDidUnload的调用正确匹配,以便可以通过这种方式处理内存警告。从

ios - 如何从第一个 View iOS 初始化第二个 View Controller

我找到了一个带有可扩展表格View单元格的项目,而且效果很好。ViewController在AppDelegate.m中初始化如下:self.window=[[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]]autorelease];AccordionTableViewController*vc=[AccordionTableViewControllernew];self.window.rootViewController=vc;[self.windowmakeKeyAndVisible];我有带有一些内容的Inbox

ios - 从另一个 View Controller 停止 dispatch_async 内的无限循环

我正在构建一个简单的聊天室应用程序,其中有一个NSURLConnectionsendSynchronousRequest:通过长轮询向服务器发送请求。我想显示一个在后台运行时不断向我的用户更新聊天提要的流。我的应用程序还允许用户更改他们的聊天室,因此我需要关闭一个NSURLConnection并为相应的提要打开另一个。我目前的实现如下://inViewController.mdispatch_queue_tconcurrentQueue=dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0);dispatch_async