
09-05-2009, 06:18 PM
|
|
What's Jailbreak?
|
|
Join Date: Nov 2008
Device + Firmware: iPod Touch 8GB 1G 3.0 w/Pwnage
Operating System: Ubuntu 9.04 "Jaunty"
Posts: 22
Thanks: 0
Thanked 1 Time in 1 Post
|
|
|
Simple app to display an image
|
I just want to make a simple app to display my college schedule contained in a PNG when I tap the icon. The file is in the folder and called "s.png". My code does not display the image; the program compiles but does notihng when launched, it just sits there at a black screen until i hit the home button. Can anyone tell me what I'm doing wrong? My experiencw with ObjC is limited and thus, I'm using an existing HelloWorld app as a template to accomplish my goal. (I do not intend to publicly release the program in the interest of code originality.)
#import "HelloWorldApp.h"
@implementation HelloWorldApp
- (void) applicationDidFinishLaunching: (id) unused
{
UIWindow *window;
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
myImage = [UIImageView alloc];
initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 480.0f);
[myImage setImage:[UIImage imageNamed:@"s.png"]];
mainView = [[UIView alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
[mainView addSubview:myImage];
[window makeKeyAndVisible];
[window addSubview: mainView];
}
@end
|
|