草庐IT

ViewController-Presenter-Interact

全部标签

iphone - 如何从 AppDelegate 中的 TabBarController 获取 ViewController?

我用的是iOS5的storyboard,我的初始viewcontroller是TabBarController,view1&view2&view3&view4有四种关系,那么,如何获取view3的viewcontroller呢?我试过:[[[[self.window.rootViewControllernavigationController]tabBarController]viewControllers]objectAtIndex:2];但它不起作用...... 最佳答案 您说您的初始(根)ViewController是UITa

iphone - 如何从 AppDelegate 中的 TabBarController 获取 ViewController?

我用的是iOS5的storyboard,我的初始viewcontroller是TabBarController,view1&view2&view3&view4有四种关系,那么,如何获取view3的viewcontroller呢?我试过:[[[[self.window.rootViewControllernavigationController]tabBarController]viewControllers]objectAtIndex:2];但它不起作用...... 最佳答案 您说您的初始(根)ViewController是UITa

iphone - Cocoa Touch 中的 MVC : How do the view and the model interact?

我一直认为我了解MVC,但最近,在阅读了大量有关该主题的StackOverflow帖子后,我发现MVC框架做事的方式彼此之间略有不同。更具体地说,在View和模型交互的方式上,似乎有两种思想流派:当用户与View交互时,View会通知Controller,而Controller又会对模型执行某些操作。当模型发生变化时,模型会通知Controller,而Controller又会更新View。View订阅模型。当模型改变时,View似乎被直接通知它需要更新自己。所以我的问题是:在CocoaTouch(iOS)中,实现MVC的最佳方式是什么?最近我主要为iOS编写代码,并且对这个平台的最佳实

iphone - Cocoa Touch 中的 MVC : How do the view and the model interact?

我一直认为我了解MVC,但最近,在阅读了大量有关该主题的StackOverflow帖子后,我发现MVC框架做事的方式彼此之间略有不同。更具体地说,在View和模型交互的方式上,似乎有两种思想流派:当用户与View交互时,View会通知Controller,而Controller又会对模型执行某些操作。当模型发生变化时,模型会通知Controller,而Controller又会更新View。View订阅模型。当模型改变时,View似乎被直接通知它需要更新自己。所以我的问题是:在CocoaTouch(iOS)中,实现MVC的最佳方式是什么?最近我主要为iOS编写代码,并且对这个平台的最佳实

iphone - 在 Storyboard 中隐藏一个 ViewController 的 NavigationBar

找了很多帖子,还是没有解决办法。我试图在初始UIViewController上隐藏NavigationBar,但我仍想在第二个UIViewController上显示它。这是我的Storyboard:当我关闭主视图Controller的推断顶部栏时,它会在Storyboard中消失,但在我运行应用程序时它仍然会显示。当我对NavController中的NavigationBar执行相同操作时,它对所有三个都消失了(因为它们都继承了无导航栏)。我想在ScrollViewVViewController中显示NavBar,但将其隐藏在MainViewController中。所有Controll

iphone - 在 Storyboard 中隐藏一个 ViewController 的 NavigationBar

找了很多帖子,还是没有解决办法。我试图在初始UIViewController上隐藏NavigationBar,但我仍想在第二个UIViewController上显示它。这是我的Storyboard:当我关闭主视图Controller的推断顶部栏时,它会在Storyboard中消失,但在我运行应用程序时它仍然会显示。当我对NavController中的NavigationBar执行相同操作时,它对所有三个都消失了(因为它们都继承了无导航栏)。我想在ScrollViewVViewController中显示NavBar,但将其隐藏在MainViewController中。所有Controll

objective-c - iOS:警告:在演示过程中尝试在 <ViewController> 上呈现 <ModalViewController>

我试图在从图像选择器中选择图像后创建模态视图Controller。我使用代码:-(void)imagePickerController:(UIImagePickerController*)pickerdidFinishPickingMediaWithInfo:(NSDictionary*)info{NSLog(@"Pickerhasreturned");[selfdismissModalViewControllerAnimated:YES];//TODO:makethisallthreaded?//croptheimagetotheboundsprovidedimg=[infoobje

objective-c - iOS:警告:在演示过程中尝试在 <ViewController> 上呈现 <ModalViewController>

我试图在从图像选择器中选择图像后创建模态视图Controller。我使用代码:-(void)imagePickerController:(UIImagePickerController*)pickerdidFinishPickingMediaWithInfo:(NSDictionary*)info{NSLog(@"Pickerhasreturned");[selfdismissModalViewControllerAnimated:YES];//TODO:makethisallthreaded?//croptheimagetotheboundsprovidedimg=[infoobje

ios - 单个 Viewcontroller 中的多个 UITableview

我有一个viewcontroller,我想显示3个tableviews(因为内容和表格属性不同)。我如何在一个viewcontroller中为3个表添加这些委托(delegate)方法?-(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView{return1;}-(NSInteger)tableView:(UITableView*)tableViewnumberOfRowsInSection:(NSInteger)section{return[array1count];}-(UITableViewCell*)tabl

ios - 单个 Viewcontroller 中的多个 UITableview

我有一个viewcontroller,我想显示3个tableviews(因为内容和表格属性不同)。我如何在一个viewcontroller中为3个表添加这些委托(delegate)方法?-(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView{return1;}-(NSInteger)tableView:(UITableView*)tableViewnumberOfRowsInSection:(NSInteger)section{return[array1count];}-(UITableViewCell*)tabl