标签:interface property import 信息
之前写过的一个好友信息的单利
//
// 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
本文出自 “每天一点点” 博客,谢绝转载!
标签:interface property import 信息
原文地址:http://huaxiazwd.blog.51cto.com/9738221/1621684