zoukankan      html  css  js  c++  java
  • ObjectiveC Content list

    Objective -c Content

    1、面向对象(OOP)和面向过程、类(Class)和对象(Object)、类的定义

    2、创建对象、self和super关键字、属性以及点语法(nonatomic,assign、retain、copy 、readonly、readwrite)

    3、便利构造器、单例(Singleton)

    4、堆栈、内存管理(alloc、copy、retain,release、autorelease、strong、weak)

    5、键值编码(KVC)、键值监听(KVO)、通知中心(NSNotificationCenter)、通知 (NSNotification)

    6、类目(Category)、延展(Extention)、协议(protocol) 

    1.message:OC允许开发者在运行时动态的创建新的方法和消息。

    2.interface,method define

       #import <Foundation/Foundation.h>  //#import 预处理指命,可以确保同一资源被包含的次数为1次;

       @interface Myclass :NSObject

         {

              BOOL isPower; 

              @private float speed; 

          } 

         +(id)alloc;  //id 通用数据类型,可以用来引用任意类型对象;类方法;

         -(BOOL)powerOn; 实例方法;

         @end 

    3. @implementation //在.m文件中;

    4.setter,getter//@property(coyy) int size;  @synthesize size; 属性被.逶明的调用myclass.size=3;

    5.@protocol//是一组商定的方法;

        @protocol MyclassDelegate

        -(void)reverStr:(NSString *) str;

        @required

        -(void)splictStr:(NSString *)str;

      @end

       @interface Myclass:NSObject

        {

           id delegete;

         } 

        @property(assign) id<MyclassDelegate> delegate;

       @end 

    6.category// file name: Myclass+reverse ,interface name: Myclass (reverse) 在没有源代码的情况下,给基类添加方法;

    7.pose //一个子类可以替位成为其基类之一;

    8.cocoa资源 http://developer.apple.com/reference/cocoa/ 

  • 相关阅读:
    Flink--Table和DataStream和DataSet的集成
    flink-SQL
    Flink的容错
    Flink--基于mysql的sink和source
    Flink--sink到kafka
    Flink在流处理上常见的Source和sink操作
    【计算机网络】-传输层-传输服务的要素
    【计算机网络】-传输层-传输服务
    文件系统-文件的逻辑结构与存取方法
    文件系统-概念
  • 原文地址:https://www.cnblogs.com/csj007523/p/2659845.html
Copyright © 2011-2022 走看看