Hi,
I tried to add a UIImageView to my UIViewController but it doest seems to work. I dont know if what I am doing is the best way to go but what I am trying to achieve is to have a bit f text, a few buttons and an image all displayed on the same screen.
in the .h file I wrote:
#import <UIKit/UIKit.h>
@class HelloUniverseController;
@interface HelloUniverseAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
HelloUniverseController *hvController;
UIImageView *image;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) HelloUniverseController *hvController;
@property (nonatomic, retain) UIImageView *image;
@end
in the .m I wrote:
#import "HelloUniverseAppDelegate.h"
@implementation HelloUniverseAppDelegate
@synthesize window, hvController, image;
- (void)applicationDidFinishLaunchingUIApplication *)application {
HelloUniverseController *hvc = [HelloUniverseController alloc];
hvc = [hvc initWithNibName"HelloUniverse" bundle:[NSBundle mainBundle]];
self.hvController = hvc;
[hvc release];
[window addSubview:[self.hvController view]];
UIImageView *img = [[UIImageView alloc] imageNamed"Picture.png"];
self.image = img;
[img release];
[self.hvController addSubview:[(self.image) view]];
// Override point for customization after application launch
[window makeKeyAndVisible];
}
- (void)dealloc {
[hvController release];
[window release];
[super dealloc];
}
@end
the UIViewController works just fine, I just cant get the picture to work.
Thanks
Yoav.
I tried to add a UIImageView to my UIViewController but it doest seems to work. I dont know if what I am doing is the best way to go but what I am trying to achieve is to have a bit f text, a few buttons and an image all displayed on the same screen.
in the .h file I wrote:
#import <UIKit/UIKit.h>
@class HelloUniverseController;
@interface HelloUniverseAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
HelloUniverseController *hvController;
UIImageView *image;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) HelloUniverseController *hvController;
@property (nonatomic, retain) UIImageView *image;
@end
in the .m I wrote:
#import "HelloUniverseAppDelegate.h"
@implementation HelloUniverseAppDelegate
@synthesize window, hvController, image;
- (void)applicationDidFinishLaunchingUIApplication *)application {
HelloUniverseController *hvc = [HelloUniverseController alloc];
hvc = [hvc initWithNibName"HelloUniverse" bundle:[NSBundle mainBundle]];
self.hvController = hvc;
[hvc release];
[window addSubview:[self.hvController view]];
UIImageView *img = [[UIImageView alloc] imageNamed"Picture.png"];
self.image = img;
[img release];
[self.hvController addSubview:[(self.image) view]];
// Override point for customization after application launch
[window makeKeyAndVisible];
}
- (void)dealloc {
[hvController release];
[window release];
[super dealloc];
}
@end
the UIViewController works just fine, I just cant get the picture to work.
Thanks
Yoav.