Hi,

I'm a newbie in programming for iPhone. This is the first time I work on Toolchain + Cygwin on Windows and for iPhone.

I had write a Helloworld application. My iPhone firmware version is: 1.1.4

The simple source:

Code:
    UIWindow *window;
    struct CGRect rect = [UIHardware fullScreenApplicationContentRect];
    rect.origin.x = rect.origin.y = 0.0f;

    window = [[UIWindow alloc] initWithContentRect: rect];
    mainView = [[UIView alloc] initWithFrame: rect];
    textView = [[UITextView alloc]
        initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
    [textView setEditable:YES];
    [textView setTextSize:14];

    [window orderFront: self];
    [window makeKey: self];
    [window _setHidden: NO];
    [window setContentView: mainView];
    [mainView addSubview:textView];

    [textView setText:@"Hello World"];
Very simple and the compiled application runs smooth.

But I want to modify something:

Code:
    UIWindow *window;
    struct CGRect rect = [UIHardware fullScreenApplicationContentRect];
    rect.origin.x = rect.origin.y = 0.0f;

    window = [[UIWindow alloc] initWithContentRect: rect];
    mainView = [[UIView alloc] initWithFrame: rect];
	
    [window orderFront: self];
    [window makeKey: self];
    [window _setHidden: NO];
    [window setContentView: mainView];

	_counterTextLabel = [[UITextView alloc] initWithFrame:CGRectMake(10.0f, 20.0f, 300.0f, 40.0f)];
	[_counterTextLabel setEditable:YES];
//	[_counterTextLabel setCentersHorizontally:YES];
//	[_counterTextLabel setBackgroundColor:[UIView colorWithRed:1.0f green:1.0f blue:0.0f alpha:1.0]];
//	[_counterTextLabel setColor:[UIView colorWithRed:1.0f green:0.0f blue:0.0f alpha:1.0]];
//	GSFontRef font = GSFontCreateWithName("Tahoma", 0, 32.0f);
//	[_counterTextLabel setFont:font];
//	CFRelease(font);
	[_counterTextLabel setText:@"Hello iPhone!"];

	[mainView addSubview: _counterTextLabel];
The same as original source. But if I uncomment any line above, the compiled application can not run on iPhone.

Other way, I want to add one more control: UITextField.

Code:
	_editingTextView = [[UITextField alloc] initWithFrame:CGRectMake(10.0f, 60.0f, 300.0f, 30.0f)];
	
	GSFontRef tfont = GSFontCreateWithName("Tahoma", 0, 16.0f);
	[_editingTextView setFont: tfont];
	CFRelease(tfont);
	
	[_editingTextView setText:@"type here"];
	[_editingTextView setBackgroundColor:[UIView colorWithRed:1.0f green:0.0f blue:1.0f alpha:0.0]];
	[_editingTextView setTextColor:[UIView colorWithRed:0.0f green:0.0f blue:0.0f alpha:1.0]];
	[_editingTextView setCaretColor:[UIView colorWithRed:1.0f green:0.0f blue:0.0f alpha:1.0]];
	[_editingTextView setTextSize:18.0f];
	[_editingTextView setDelegate:self];
	[_editingTextView setMarginTop:0];
	[_editingTextView setBottomBufferHeight:0.0f];
	
	[mainView addSubview:_editingTextView];
But compiled application can not run too.

Too hard to understand, because I'm a newbie...

I post it here and hope that someone can help me. Thank you very much!

Best Regards,
MARRING