我正在尝试将一个UIViewController (AddProjectViewController)添加到一个导航控制器(navigationController),它有一个tableView设置为root,但它不起作用.
这就是我设置文件的方式:http://d.pr/y8rt
代码在ProjectsController.m- 请帮助:(
我有一个viewcontroller,它包含一个包含带有一堆数据的字典对象的实例变量.视图相当复杂,包含几个子视图,我从单独的视图文件中实例化和嵌入(为了避免在实际的viewcontroller中有一千行UI代码) - 但是这些子视图如何存在于他们自己的文件中,可以访问来自viewcontroller的我的字典对象?因此,当我编辑DescriptionView.m文件时 - 如何从ViewController访问locationData字典对象的内容?
希望你明白我的意思.
这是ViewController的一个片段:
CaseViewController.h
#import "DescriptionView.h"
@interface CaseViewController : UIViewController {
NSDictionary *locationData;
DescriptionView *descriptionView;
}
@property (nonatomic, retain) NSDictionary *locationData;
@property (nonatomic, retain) DescriptionView *descriptionView;
@end
Run Code Online (Sandbox Code Playgroud)
CaseViewController.m
- (void)loadView {
UIView *view = [[UIView alloc] init];
descriptionView = [[DescriptionView alloc] initWithFrame:CGRectMake(0, 130, 320, 237)];
descriptionView.hidden = NO;
[view addSubview:descriptionView];
self.view = view;
[view release];
}
Run Code Online (Sandbox Code Playgroud) 我有几个ViewControllers的故事板,通过按钮相互连接.
现在,如果特定条件为真,我需要加载另一个UIViewController.我设法创建了一个新的子类,但我想避免它.我只是想
if(condition == true){
// load viewcontroller located in the storyboard, not connected with anything else
}
Run Code Online (Sandbox Code Playgroud)
有帮助吗?
我创建了一个带有串行视图的应用程序(A,B,C,D,...),我需要将D弹回到B.有人可能会说为什么不使用:
[self.navigationController popToViewController:[[self.navigationController viewControllers] objectAtIndex:1] animated:YES];
Run Code Online (Sandbox Code Playgroud)
但是,这不是一个好的解决方案.因为这个方法需要你得到我们"B"存储的索引.
问题:如何在viewControllers中获取"B"的索引?
格式UIViewControllers应为:
"<A:0x6e70710>","<C:0x6e30370>","<B:0x6988a70>","<D:0x6ea8950>","<E:0x6eaaad0>"
我已经尝试过并且未能使用rangeOfString并hasPrefix获得"B"视图的索引.
我有一个带有许多视图控制器的故事板项目,我创建了一个名为"connecter.h,connector.m"的类,现在可以将此类连接到一个.xib文件吗?
请帮我.
我正在创建一个iOS应用程序,其中我有以下要求:应用程序应该在第一次启动时显示登录屏幕,并且当应用程序从后台到前台时也必须显示该屏幕,以防它具有在运行时被发送到后台.
我已经处理过两种情况下的屏幕显示.但是,当我这样做并且应用程序来自后台时,我单击texfield键入我的密码,应用程序被冻结,并且它在一个我不知道它意味着什么的线程中失败.
当应用程序来自这样的背景时,我在AppDelegate的applicationWillEnterForeground中调用屏幕显示:
self.window=[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
RoomRootViewController* room = [[RoomRootViewController alloc] init];
[[self window] setRootViewController:room];
[self.window makeKeyAndVisible];
Run Code Online (Sandbox Code Playgroud)
这是正确的方法吗?
非常感谢提前!我完全迷失了这个,因为我是iOS的新手,所以任何帮助都将非常感激.
附加在图像中,您可以看到应用程序失败的位置. 

我有两个ViewController:
1)ViewController
2)TestAppViewController
在ViewController.h,我定义了一个标签,我希望从第二个viewController发送其文本,即`TestAppViewController.
为此,我@property NSString *在ViewController.h中定义了一个,并在我的第二个Controller中创建了一个ViewController的对象.然后将值传递给此属性,但ans仍然是零.
以下是我的代码:
@property (nonatomic, retain) NSString *lableName;*
Run Code Online (Sandbox Code Playgroud)
视图控制器
#import "ViewController.h
#import "TestAppView1.h"
#import "TestAppViewController2.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
// [self addView1];
}
- (void)viewWillAppear:(BOOL)animated
{
[self addView1];
NSLog(@"Label name is %@",self.lableName);
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can …Run Code Online (Sandbox Code Playgroud) 我的故事板中的一些元素没有出现,因为我将viewcontroller大小更改为4.7inch.但是,如果我创建另一个viewcontroller并将一些对象放入其中,它们就会出现.这些viewcontrollers有什么问题?
我想检查用户是否登录,如果用户已登录,则将他带到主屏幕,或显示欢迎屏幕.
I have a UIDocumentBrowser based app which opens a specific type of files. The default transition for opening a file is sliding from bottom, which is not the nicest transition user can expect. Before iOS 12 with this piece you could get a zoom transition, it does work now too, but the compiler is complaining about using transitionController(forDocumentURL:) which is deprecated. How can I have this effect in iOS 12 way?
func presentDocument(at documentURL: URL) {
let storyBoard = UIStoryboard(name: …Run Code Online (Sandbox Code Playgroud) viewcontroller ×10
ios ×8
iphone ×2
objective-c ×2
storyboard ×2
swift ×2
xcode ×2
appdelegate ×1
callback ×1
controller ×1
sdk ×1
subview ×1
tableview ×1
view ×1
xcode4.6 ×1
xib ×1