之前写过的一个好友信息的单利

//

//  FriendBuddyList.h

#import <Foundation/Foundation.h>

#import "FriendBuddyModel.h"

@interface FriendBuddyList : NSObject

+ (id)sharedFriendBuddyList;

@property (nonatomic , strong) NSArray *friend

 

Array;

-(void)getFriendArrayWithArray:(NSArray*)array;

@end

//

//  FriendBuddyList.m

#import "FriendBuddyList.h"

#import "FriendBuddyModel.h"

static FriendBuddyList *sharedFriendBuddyList = nil;

@implementation FriendBuddyList

+ (FriendBuddyList *) sharedFriendBuddyList

{

    if (sharedFriendBuddyList == nil) {

        sharedFriendBuddyList = [[super allocWithZone:NULL] init];

    }

    return sharedFriendBuddyList;

}

+ (id) allocWithZone:(struct _NSZone *)zone

{

    return [self sharedFriendBuddyList];

}

- (id) copyWithZone:(NSZone *) zone

{

    return self;

}

-(void)getFriendArrayWithArray:(NSArray*)array

{

    self.friendArray = array;

}

@end