zoukankan      html  css  js  c++  java
  • Object-C初体验

       前几周,看了书,标记了要Coding的例子。(书是写博客,CSDN送的,也可以用C币买)


       周末,来搞几个例子。


       2015年春,刚刚买Mac的时候,就搞了1Object-CHelloWorld,毕竟新手。


      总的来说,MacXCodeObject-C,用起来特别的不习惯啊。


      操作系统、快捷键、IDE的用法,难受的要死,毕竟用了10多年Windows,一下子很难切换到Mac


      买的Mac,键盘也比较小,搞起来不是很方便,没有Hp电脑那么习惯。


      今天,亲自Coding了几个小例子,里程碑,表明我真的开始动手了。


      //
    //  main.m
    //  switch
    //
    //  Created by fansunion on 15/11/15.
    //  Copyright (c) 2015年 demo. All rights reserved.
    //
    
    #import <Foundation/Foundation.h>
    
    int main(int argc, const char * argv[]) {
        @autoreleasepool {
            // insert code here...
            NSLog(@"Hi, FansUnion!");
        }
        return 0;
    }


    2015-11-15 11:36:44.984 switch[1410:50516] Hi, FansUnion!

    Program ended with exit code: 0


    //
    //  main.m
    //  for
    //
    //  Created by fansunion on 15/11/15.
    //  Copyright (c) 2015年 demo. All rights reserved.
    //
    
    #import <Foundation/Foundation.h>
    
    int main(int argc, const char * argv[]) {
        @autoreleasepool {
            // insert code here...
            int n =0;
            int sum=0;
            for(n=1;n<=10;n=n+1){
                sum += n;
            }
            NSLog(@"The sum is %i",sum);
        }
        return 0;
    }
    


    2015-11-15 11:08:42.517 for[1242:40319] The sum is 55

    Program ended with exit code: 0


    Mac很有艺术感,但是多个软件之间切换真的很难用。

    Windows是主流,真的是这样啊。


  • 相关阅读:
    P1182 数列分段`Section II` 二分
    洛谷 P1025 数的划分
    深浅拷贝
    数据的内置方法
    控制流程-if/while/for
    python的基本运算符
    花式赋值
    python的注释
    Python的垃圾回收机制
    变量与常量
  • 原文地址:https://www.cnblogs.com/qitian1/p/6462590.html
Copyright © 2011-2022 走看看