Issit possible to load a UIVIewcontroller from uiview of another UIViewController
Posted
by
chako89
on Stack Overflow
See other posts from Stack Overflow
or by chako89
Published on 2011-01-13T05:36:13Z
Indexed on
2011/01/13
5:54 UTC
Read the original article
Hit count: 558
Guys, need your advise here.
I have:
- an UIViewController A
- UIView B: I added subview which is a UIView to the UIViewController A
- an UIViewController C
What I did is:
in UIViewController A's viewDidLoad's method, I call this:
UIView *subviewB = [[Subview alloc] initWithFrame:CGRectMake(0, 0, 1024, 768)];
[subviewB subviewBMethod]; //
[self.view addSubview:rsubviewB];
SubviewBMethod code is to create an view, inside this view have a button. Once this button is clicked, it will change to UIViewController C.
I tried this:
[self presentModalViewController:self.UIViewControllerC animated:YES];
And I got this error message:
warning: incompatible Objective-C types 'struct UIViewControllerC *', expected 'struct UIViewController *' when passing argument 1 of 'presentModalViewController:animated:' from distinct Objective-C type
When I run the app, it terminates immediately when I click the button, I opened the console bug, there is no any error message. My method must be wrong, thus my question is:
Issit possible to load a UIVIewcontroller from uiview of another UIViewController? If:
- Yes: How to do it?
- No: What should I do?
THank you =)
© Stack Overflow or respective owner