The drawing has to be done inside of a
view. Did you make a
view before drawing the string?
Like maybe in a file ending in .h do...
Code:
@class MyView;
@interface iPhoneTestAppDelegate : NSObject {
UIWindow *window;
MyView *contentView;
}
@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) MyView *contentView;
@end
Code:
#import "iPhoneTestAppDelegate.h"
#import "MyView.h"
@implementation iPhoneTestAppDelegate
@synthesize window;
@synthesize contentView;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Create window
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Set up content view
self.contentView = [[[MyView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
[window addSubview:contentView];
// Show window
[window makeKeyAndVisible];
}
- (void)dealloc {
[contentView release];
[window release];
[super dealloc];
}
@end
Do that first.
Then in another file say MyView.h add:
Code:
#import <UIKit/UIKit.h>
@interface MyView : UIView {
}
@end
...and in MyView.m add...
Code:
#import "MyView.h"
@implementation MyView
@end
And in there add your bits to draw a string?
If not. Sign up to be an iPhone developer - its free. Download the sample code and the SDK. They are also free. Your time, well that's probably not really free, but if you spend enough you might learn something.