您的位置:首页 > 编程语言 > C语言/C++

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

2017-01-05 15:31 489 查看
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 <Foundation/Foundation.h>

@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 <Foundation/Foundation.h>

@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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息