WEB开发网
开发学院手机开发iPhone 开发 一个简单的iPhone项目及代码 阅读

一个简单的iPhone项目及代码

 2010-08-26 11:04:00 来源:WEB开发网   
核心提示://2. 右键单击 或者CTRL+左键单击 "File's Owner",在Received Actions一栏中可以看到sayHello的动作//3. 拖动sayHello右边的空心圈至View界面上的按钮即可//4. 实现你的sayHello方法吧-(IBAction) sayHello

//2. 右键单击 或者CTRL+左键单击 "File's Owner",在Received Actions一栏中可以看到sayHello的动作

//3. 拖动sayHello右边的空心圈至View界面上的按钮即可

//4. 实现你的sayHello方法吧

-(IBAction) sayHello : (id) sender;

@end

Contoller的实现:

Cpp代码

//

// HelloUserViewController.m

// HelloUser

//

// Created by sin francis on 10-8-26.

// Copyright __MyCompanyName__ 2010. All rights reserved.

//

#import "HelloUserViewController.h"

@implementation HelloUserViewController

/*

// The designated initializer. Override to perform setup that is required before the view is loaded.

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {

if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil])) {

// Custom initialization

}

return self;

}

*/

/*

// Implement loadView to create a view hierarchy programmatically, without using a nib.

- (void)loadView {

}

*/

/*

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.

- (void)viewDidLoad {

[super viewDidLoad];

}

*/

/*

// Override to allow orientations other than the default portrait orientation.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

// Return YES for supported orientations

return (interfaceOrientation == UIInterfaceOrientationPortrait);

}

*/

//sayHello的实现方法

-(void) sayHello:(id)sender{

NSString *userName = nameField.text;

NSString *helomessage = [[NSString alloc]

上一页  1 2 3 4 5 6 7  下一页

Tags:一个 简单 iPhone

编辑录入:coldstar [复制链接] [打 印]
赞助商链接