Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

crazyapple777

macrumors newbie
Original poster
May 19, 2010
5
0
Hi, I'm a new member and I've just started getting used to Objective-C after being proficient with Java (huge difference!). So far I've gone through this tutorial:
http://www.iphonesdkarticles.com/2008/07/first-iphone-application.html

My problem is that whatever I do, I can't get the view to display on the window-based application. I've looked through all the steps in the above tutorial a thousand times, and I'm not getting an error either. Specifically, I think the problem is with the part where you're supposed to create a subview from passing the ViewController object which contains the controller for all the UI objects. Can anyone help? (If you need more specifics, just ask) Thanks in advance.
 

Svinja

macrumors newbie
Oct 27, 2008
27
0
In you appDelegate.applicationDidFinishLaunching use something like this:
Code:
MyViewController *viewController=[[MyViewController alloc] init];
[self.window addSubview:viewController.view];
dont forget to import "MyViewController.h"...
this is without using ib...i never use it...
 

crazyapple777

macrumors newbie
Original poster
May 19, 2010
5
0
Code:
MyViewController *viewController=[[MyViewController alloc] init];
[self.window addSubview:viewController.view];

Yeah, it was something like this. Unfortunately, I don't have a Mac, so I have to use the ones at my school (which is why this is so frustrating). I'll post the code when I can, but I think it was something like that above. Everything seems fine, no errors, but there's just a black screen when I simulate it. (I've tried a different HelloWorld tutorial with a drawRect method, and I can get text to display on a screen, but that's about it.)

Everything seems to work in the window-based section and in the view-based part of the code, it's just the passing of the controller containing the view that's my problem...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.