ITeye博客

大锐哥的iOS开发教程(3)用代码实现HelloWorld工程

prevention · 2014-02-03 15:46 · iOS教程 · 移动开发 · Markdown

iOS Dev (3) HelloWorld with codes

  • 作者:爱欧艾斯鸟

删除

  • 删除 HelloWorldViewController.xib文件
  • 删除 HelloWorldViewController.m 中的 viewDidLoad

添加

  • 添加 loadView 到 HelloWorldViewController.m
      - (void)loadView
  • {
  • UIView *view =
  • [[UIView alloc] initWithFrame: [UIScreen mainScreen].applicationFrame];
  • self.view = view;
  • UILabel *label2 = [[UILabel alloc] initWithFrame: CGRectMake(0, 110, 150, 100)];
  • label2.text = @"Hello World 2";
  • [self.view addSubview: label2];
  • [label2 release];
  • }
  • UIScreen: UIKit.framework component;
  • UILabel: UIKit.framework component;
  • CGRectMake: CoreGraphics.framework component;

Run it!

(THE END)

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。