iOS Development First Experience Demo

Source: Internet
Author: User

I've been looking at the OC Foundation for two days before I started to get the demo on iOS. Now more study materials are xcode4.x, found that xCode6.1 still changed a lot of things, a lot of functions need to understand, probably is the pain and happy, the big God can directly ignore me, all the time is the development, concrete look at the figure analysis:

1. Create a new single view file:

2. New project name, language selection OC:

3. This is to drag two controls on the view above, one of which is better than Android is not necessary to create a new simulator, cancel the auto layout and auto size classes, otherwise the page is very large:

4. If you simply write a Hello world, the program is over, but for the first time, it's an event:

5. The novice error is the ' not ' key value coding-compliant for the key result, which is connected too much, even wrong, the result of the connection there is no deletion, the specific changes are as follows:

6. The operating effect is as follows:

7. The code is as follows:

Code in ViewController.h:
  viewcontroller.h//  demo01////  Created by Keso on 15/1/12.//  Copyright (c) 2015 Keso. All rights reserved.//#import <UIKit/UIKit.h> @interface viewcontroller:uiviewcontroller@property (Weak, nonatomic) Iboutlet UIView *name; @property (weak, nonatomic) Iboutlet Uitextfield *realname; @property (weak, nonatomic) I Boutlet UILabel *result; @end

Code in VIEWCONTROLLER.M:
  viewcontroller.m//  demo01////  Created by Keso on 15/1/12.//  Copyright (c) 2015 Keso. All rights reserved.//#import "ViewController.h" @interface Viewcontroller () @end @implementation viewcontroller-(void ) Viewdidload {    [super viewdidload];    Do any additional setup after loading the view, typically from a nib.} -(void) didreceivememorywarning {    [super didreceivememorywarning];    Dispose of any resources the can be recreated.} -(Ibaction) ShowName: (ID) Sender {    nsstring *textname=[_realname text];    [_result settext:textname];} @end

iOS Development First Experience Demo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.