草庐IT

AnuncioV2ViewController

全部标签

iphone - 应该从父 ViewController 还是子 ViewController 调用 popViewController?

我可以通过从实例化它的父ViewController调用[self.navigationControllerpopViewControllerAnimated:YES];从UINavigationController的堆栈中弹出一个ViewController,或来自subviewController本身。哪种方式更可取? 最佳答案 我想答案是“最有意义的”;如您所说,您可以从父级、子级或什至其他持有对导航Controller的引用的类中调用popViewControllerAnimated:。对于大多数应用程序,subview将包

iphone - 锁定 ViewController 的方向

我的应用程序支持所有类型的方向,但我希望某些viewController仅支持横向,很少有人锁定Potrait模式。我该怎么做,我试过下面的代码但没有任何效果。-(BOOL)shouldAutorotate{returnNO;}-(NSUInteger)supportedInterfaceOrientations{returnUIInterfaceOrientationMaskPortrait;}//pre-iOS6support-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfa

当ViewController移动时,TAB栏和导航栏将不会显示

我需要在一个故事板中移动到另一个ViewController(带有标签栏和导航栏)中的情节提要中有一个ViewController(无标签栏和导航栏)。问题是我能够移至ViewController,但它不会显示标签栏和导航栏。这是我这样做的方式:letstoryboard=UIStoryboard(name:"Main",bundle:nil)letfeedTableViewController=storyboard.instantiateViewController(withIdentifier:"Feed")as!FeedTableViewControllerself.navigation

iphone - 在加载另一个 ViewController 时呈现模态视图 Controller

在用户可以使用我的应用程序之前,他必须先登录。他登录后,数据库就建立好了,因为我需要服务器的信息来建立它。因此,我的根ViewController是LoginViewController,它在成功登录时以模态方式呈现实际应用程序(navigationController堆栈)。如果用户已经在应用程序启动时登录(我将凭据存储在NSUserDefaults中),则LoginViewController应该立即显示该应用程序。因此我重写了方法:-(void)viewDidAppear:(BOOL)animated{[superviewDidAppear:animated];NSInteger

ios - 我怎样才能为一个 viewController iOS 禁用横向

我的项目有UITabbar、UınavigationBar和UIViewContoller。-UITabbar—UINavigationController—UIViewController问题:我怎样才能横向禁用一个viewController?我只想纵向View,但只有一个View。 最佳答案 disableautorotateonasingleUIViewControlleriniOS6将此添加到您的应用委托(delegate)-(NSUInteger)application:(UIApplication*)applicati

ios - 创建 ViewController 时,无法删除 "also create a xib"

这个问题在这里已经有了答案:CannotcreateaniPhonexibfilewithXcode6(4个答案)关闭6年前。上周,它运作良好。.m文件中没有类似“viewDidLoad”的内容。我的xCode版本是7.1.1。怎么了。

iphone - 如何从 NSObject 获取 NSString 变量值到 ViewController

我正在尝试设置一个对象来控制我的所有数据,这样它就可以在后台进行设置,使我的表格View加载速度比现在快等等。这就是我想要达到的目标。当像这样选择tableviewcell时,我在secondVC的NSObject中设置一个变量:-(void)tableView:(UITableView*)tableViewdidSelectRowAtIndexPath:(NSIndexPath*)indexPath{//Accessselectedcellscontent(cell.textLabel.text)UITableViewCell*cell=[tableViewcellForRowAtI

ios - 单点触控。从 ViewController 中移除特定的 UIImage subview

如何快速地从ParentViewController.View.Subviews集合中查找和删除UIImageView?现在我正在比较Image.Size,但它运行缓慢,有时会闪烁。比较图像对象失败。更新...闪烁的原因原来是我搞砸了一些其他东西。我修好了。尽管如此,通过Image.Size进行比较似乎并不是一个好主意 最佳答案 你可以试试这个:向您的UIImageView添加一个唯一的标记属性(int):myImageView.Tag=100;然后,使用这个标签,您可以将它从父View中删除:ParentViewControlle

objective-c - 如何在 Storyboard中设置初始 ViewController 的委托(delegate)

我有一个这样的Storyboard:--initial-->[PictureListViewController]---->[PictureDetailViewController]现在我想设置我的ViewControllerPictureListViewController的委托(delegate)。因为它是第一个ViewController,所以我不能在-(void)prepareForSegue:...方法中执行此操作,因为我的初始ViewController是由Storyboard框架创建的。为了可重用性,我也不想要PictureListViewController,因此将其设

ios - ViewController_iPad.xib 与 ViewController~ipad.xib

我正在编写一个教程,一些有趣的东西引起了我的注意。我刚刚创建了一个单View应用程序项目,我注意到两个.xib文件,一个名为ViewController_iPhone.xib,一个名为ViewController_iPad.xib。在我的项目中,如果我想为iPhone和iPad使用不同的.xib,我会为iPhone使用ViewController.xib,为iPad使用ViewController~ipad.xib。我有点理解这可能是一个新的命名约定,但是如果我的目标是旧的iOS版本,我可以使用这个命名约定事件吗?这也发生在xCode4.6中谢谢。 最佳答案