Questions tagged [loadview]
90 questions
28
votes
4 answers
Force viewDidLoad to fire on iOS
I have two window app and while I present first window I would like the view in second window to load and prepare content for later in background.
I've tried to use method loadView but Apple says you should not call this method directly.
So far I've…

Borut Tomazin
- 8,041
- 11
- 78
- 91
27
votes
4 answers
Is it ok to call [super loadView]?
I thought that I should never call [super loadView] but something is confusing me.
In description of loadView (UIViewController Class Reference) it is said that "Your custom implementation of this method should not call super.",
but in…

Aleksa
- 529
- 4
- 16
23
votes
4 answers
Determine the correct size in loadView
How to consistently determine the correct size to layout your view in loadView?
I have different cases where a UIViewController is pushed to a UINavigationController, or a UITabBarController is present, or both. These elements changes the available…

RickiG
- 11,380
- 13
- 81
- 120
16
votes
7 answers
viewDidLoad(), LoadView()
What is the difference between viewDidLoad() and LoadView()? In what way are they different from each other?
Which one is better when we develop applications without using XIB ?
Thanks .

iOS
- 423
- 1
- 6
- 15
8
votes
1 answer
loadView: functions in UIView iOS
I don't understand the mechanism of loadView: function (this function is in UIView).
I created a project as below:
First, I created a iPhone's window-based project.
Then, I created a UIView subclass
Next, I created a UIViewController subclass,…

vietstone
- 8,784
- 16
- 52
- 79
7
votes
3 answers
Best practice to calculate view size within loadView method
What is the best practice to calculate the view size in the loadView method (in an UIViewController) without a XIB file?
Here is my solution:
- (void)loadView {
//Calculate Screensize
BOOL statusBarHidden = [[UIApplication sharedApplication]…

CarlJ
- 9,461
- 3
- 33
- 47
7
votes
2 answers
Replacing a UIViewController root view with my own view
I'm trying to replace a UIViewController root view with a subclassed UIView.
In the iPhone SDK's UIViewController Class Reference, within it's Overview section, this is stated:
You use each instance of UIViewController to manage a full-screen view.…

Spanky
- 4,980
- 7
- 36
- 37
6
votes
2 answers
overriding loadView in a UITableViewController subclass
I am trying to setup a UITableViewController so that its tableView belongs to my custom subclass. My loadView method currently looks like this:
- (void) loadView {
MyTableViewSubclass* tv = [[[MyTableViewSubclass alloc]initWithFrame: CGRectZero…

William Jockusch
- 26,513
- 49
- 182
- 323
5
votes
3 answers
Infinite loop when using loadView
Very interesting problem when using loadView in UIViewController.
Usually we used like this way
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
NSLog(@"loadview");
[super…

Forrest
- 122,703
- 20
- 73
- 107
5
votes
3 answers
viewDidLoad not called when using loadView
Can anyone explain why viewDidLoad does not get called when loadView is used? It's my understanding that viewDidLoad should still get called.
- (void)loadView
{
CGRect currentFrame = [[UIScreen mainScreen] applicationFrame];
UIView* myView…

sol
- 6,402
- 13
- 47
- 57
4
votes
2 answers
How to implement loadView?
I've created a custom view called GraphView. All I get is a blank black screen when the view is loaded. Here is my code:
in GraphViewController.m:
@synthesize graphView, graphModel;
- (void)loadView
{
GraphView *aGraphView = [[GraphView…

ladookie
- 1,343
- 4
- 21
- 24
4
votes
2 answers
How to reload a view controller when back from another view using tab bar
I have a common view used when the user opens the app (VC1). With a tab bar controller, I load another view (VC2) that can be used to update data visible in the previous one. When I go back on VC1 (which is stack), it does not reload with updated…

Bastien
- 117
- 1
- 1
- 7
4
votes
3 answers
Loading view before Data is loaded into Recycler view
I want to display a Loading view i.e., an indeterminate Progress bar until I load my recycler view with data fetched from Firebase. I need to know the event which would be triggered as soon as the Recycler View is loaded with the data.
I extended…

Mohammad Aasif
- 328
- 2
- 3
- 15
4
votes
4 answers
Error "Application windows are expected to have a root view controller" (iOS)
I've created a blank iPhone app project and would like to show a full-screen advertisement during app launch.
I tried to install the ad by following this guideline: https://github.com/mopub/mopub-ios-sdk/wiki/Interstitial-Integration-For-iOS
That's…

Kit Ng
- 993
- 4
- 12
- 24
4
votes
2 answers
What are the side effects of calling [super loadView]
In the docs for loadView, Apple states:
Your custom implementation of this method should not call super.
So I tried calling [super loadView] in my loadView method. Nothing bad seemed to happen and there was no warning. I'm using a view created…

nevan king
- 112,709
- 45
- 203
- 241