YIem`s Blog -心比天高命比纸薄-链接找不到的请在站内搜索内容!

2015-12-04 // OC_9练习

//
// main.m
// OC_9练习
//
// Created by YIem on 15/12/4.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <Foundation/Foundation.h>

import "Person.h"

import "ARCMOdel.h"

int main(int argc, const char * argv[]) {

@autoreleasepool {
    

// 创建对象

    Person *p1 = [[Person alloc] initWithName:@"qwe" arr:@[@"asd"] age:10];
    [p1 release];
    // 遍历构造器
    Person *p2 = [Person personWithName:@"zxc" arr:@[@"rty"] age:20];
    // ARCModel
    ARCMOdel *m = [[ARCMOdel alloc] init];
    [m release];
    
   
    
    
    
    
}
return 0;

}



//
// ARCMOdel.h
// OC_9练习
//
// Created by YIem on 15/12/4.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <Foundation/Foundation.h>

// ARC/MRC 混编
// ARC下使用MRC: -fno-objc-arc
// MRC下使用ARC: -fobjc-arc

@interface ARCMOdel : NSObject

@property (nonatomic, copy)
NSString *string;
@property (nonatomic, retain)
NSDictionary *dic;

@end


//
// ARCMOdel.m
// OC_9练习
//
// Created by YIem on 15/12/4.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "ARCMOdel.h"

@implementation ARCMOdel

pragma mark - ARCsetter方法重写

@end



//
// Person.h
// OC_9练习
//
// Created by YIem on 15/12/4.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import <Foundation/Foundation.h>

@interface Person : NSObject
@property (nonatomic, copy)
NSString *name;
@property (nonatomic, retain)
NSArray *arr;
@property (nonatomic, assign)
NSInteger age;
/// 初始化


//
// Person.m
// OC_9练习
//
// Created by YIem on 15/12/4.
// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.
//

import "Person.h"

@implementation Person

pragma mark - dealloc方法

pragma mark - 初始化

pragma mark - 遍历构造器

pragma mark - 重写setter

@end

当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »