蓝鸥iOS从零基础到精通就业-OC语言入门 类目和延展1

  • iOS从零基础到精通就业 Objective-C

  • CSDN观看地址:http://edu.csdn.net/course/detail/3347
  • 类目和延展
  •  NSMutableArray+AddTwoObject.h
  • //
    //  NSMutableArray+AddTwoObject.h
    //  类目和延展
    //
    //  Created by 蓝鸥 on 16/8/3.
    //  Copyright © 2016年 luanbin. All rights reserved.
    //
    
    #import 
    
    @interface NSMutableArray (AddTwoObject)
    
    -(void)addTwoObject:(NSString *)str1 str2:(NSString *)str2;
    
    @end
    NSMutableArray+AddTwoObject.m
  • //
    //  NSMutableArray+AddTwoObject.m
    //  类目和延展
    //
    //  Created by 蓝鸥 on 16/8/3.
    //  Copyright © 2016年 luanbin. All rights reserved.
    //
    
    #import "NSMutableArray+AddTwoObject.h"
    
    @implementation NSMutableArray (AddTwoObject)
    
    -(void)addTwoObject:(NSString *)str1 str2:(NSString *)str2
    {
        [self addObject:str1];
        [self addObject:str2];
    }
    
    @end
  • NSString+OtherMethod.h
  • //
    //  NSString+OtherMethod.h
    //  类目和延展
    //
    //  Created by 蓝鸥 on 16/8/3.
    //  Copyright © 2016年 luanbin. All rights reserved.
    //
    
    #import 
    
    @interface NSString (OtherMethod)
    
    -(NSString *)addSix;
    
    @end
    
    NSString+OtherMethod.m
  • //
    //  NSString+OtherMethod.m
    //  类目和延展
    //
    //  Created by 蓝鸥 on 16/8/3.
    //  Copyright © 2016年 luanbin. All rights reserved.
    //
    
    #import "NSString+OtherMethod.h"
    
    @implementation NSString (OtherMethod)
    
    -(NSString *)addSix
    {
       return  [self stringByAppendingString:@"666"];
    }
    @end






你可能感兴趣的:(iOS学习笔记)