草庐IT

BugTest_ViewController

全部标签

iphone - 将坐标从 appDelegate 中的 locationManager 传递到 viewController

我试图在viewController出现时获取用户的坐标。我需要几个viewController中的位置,所以我将locationManager放在appDelegate中。我的问题是,在第一个viewDidAppear上,尚未找到坐标。我应该如何改变这个?谢谢大家!!!我的AppDelegate有这个:-(NSString*)getUserCoordinates{NSString*userCoordinates=[NSStringstringWithFormat:@"latitude:%flongitude:%f",locationManager.location.coordinat

iOS - 弹出到上一个 viewController 后未调用 viewController dealloc 方法

在iOS中,我从当前的viewController弹出到前一个,但它没有进入dealloc。这是因为有另一个指向当前viewController的指针,要么在不同的viewController中,要么在当前的viewController中?这是我弹出到上一个View的地方:-(IBAction)fileUploadCancelTouched:(UIButton*)sender{[self.fileToUploadcancel];[self.viewhideToastActivity];[self.greenprogressBarremoveFromSuperview];[self.su

ios - 如何在 modaly swift 4 中呈现 ViewController

我如何在模态中呈现viewController。我是ios的新手,正在使用swift4我试试这个letuserVC=mainStoryboard.instantiateViewController(withIdentifier:"menuC")as!MenuControlleruserVC.modalPresentationStyle=UIModalPresentationStyle.overCurrentContextuserVC.navigationController?.modalPresentationStyle=UIModalPresentationStyle.overCur

ios - 如何在 Cocos2d V3 中模态或呈现 viewController?

如何从Cocos2dV3场景中呈现或模态化ViewController?我正在尝试将一个LoginInViewController添加到我在Cocos2dV3.x中创建的游戏中,该游戏从传统的helloWorldScene加载,但到目前为止我搜索和尝试的所有内容都没有奏效。(openGLView,AppController)我已经放弃并尝试通过添加以下两行来添加View-LoginViewController*myView=[[LoginViewControlleralloc]init];[[[[CCDirectorsharedDirector]view]window]addSubvi

ios - 如何在其 ViewController 的 viewDidAppear 之前确定 UIView 大小

试图解决我现在遇到的一个问题背景假设我尝试计算一个应该完全适合UIImageView的UIImage,该UIImageView在Storyboard中使用约束进行布局。imageView的内容不应该被填充/纵横比适合……但应该完全适合框架。因此我的viewController中有一个方法-(UIImage*)calculatedImageForRect:(CGRect)imageRect问题我想确保一旦View可见,imageView就已经包含正确的图像,在简单的推送转换期间也是如此。此外,我不想多次生成UIImage,因为它相对昂贵。对于像iPhone6plus这样具有不同屏幕分辨率

ios - 如何在单独的 ViewController 中在 iOS 中制作弹出/对话框 View ?

我正在做一个iOS游戏,我想实现这样的效果:我知道如何使用一个ViewController来做到这一点,但我的ViewController类已经充斥着大量代码,而且该屏幕的Storyboard一团糟(实际上我有比上图更多的View,为了清楚起见,我只是隐藏了它们原因)。所以我的问题是:有没有办法通过使用单独的ViewController来管理这个暂停弹出窗口来实现这一点?我需要一个不会关闭先前显示的屏幕的segue。我想用Storyboard来做到这一点。我尝试了“popover”segue,但它出现了一个我不想要的奇怪边框。我还需要所有不受暂停ViewController管理的控件停

ios - 选项卡栏 Controller 项目中 2 个 ViewController 之间的通信

我在我的项目中使用了一个选项卡栏Controller,其中FirstViewController有一个MapboxmapView,而SecondViewController有按钮,当按下这些按钮时会向mapView添加一个图block层。这是我试过的。它会产生错误***在SecondViewController.m中使用未声明的标识符“_mapView”//FirstViewController.h#import#import#import"SecondViewController.h"#import"SecondViewController.m"@interfaceFirstView

ios - 拖到 viewcontroller 的导出不起作用

我到处找这个问题。我知道放松场景是如何运作的。我在AVC中实现了以下代码-(IBAction)returned:(UIStoryboardSegue*)segue{try.text=@"ReturnedfromScene1";}但是当我转到我的BVC(我想从哪个VC返回到AVC)并按住ctrl键将一个按钮拖到底部的导出时,它不允许我这样做。并且exits选项中没有弹出任何功能。还有其他人遇到过这个问题或可以提供帮助吗? 最佳答案 要设置展开转场,您应该使用标准模态设置您的两个场景或在它们之间推送segue:将这两个场景的自定义类定义

ios - 在 SKScene 上呈现一个 viewController

我试图在SkView上显示UIActivityViewController但xcode给我这个错误:Novisible@interfacefor'GameOver'declarestheselector'presentViewController:animated:completion:'-(void)shareScore{//addviewUIView*Sview=[[UIViewalloc]initWithFrame:CGRectMake(0,0,512,512)];UIImageView*image=[[UIImageViewalloc]initWithImage:[UIImag

iphone - 在 UIPageControl 上加载 ViewController 的替代方法

在我的项目中,我使用UIPageControl作为容器UIViewController进行滚动。我使用了本教程(使用ARC和Storyboard):http://www.wannabegeek.com/?p=168和源代码:https://github.com/wannabegeek/PageViewController如您所见,项目中有3个ViewControllers,它们被添加为CustomPagerViewController的子项。在那个项目中,只添加了3个ViewControllers,但在我的项目中,我得到了3个以上的ViewControllers,我还将它们与另一个文本