现在的位置: 首页 > 综合 > 正文

iphone-common-codes-ccteam源代码 CCPlistFileWritter.m

2013年10月03日 ⁄ 综合 ⁄ 共 1370字 ⁄ 字号 评论关闭
//
//  CCPlistFileWritter.m
//  CCFC
//
//  Created by xichen on 11-12-18.
//  Copyright 2011 ccteam. All rights reserved.
//


#import "CCPlistFileWritter.h"




@implementation CCPlistFileWritter


- (void)initWritterObjOnce
{
        if(_writterObj == nil)
        {
                _writterObj = [[NSMutableDictionary alloc] initWithDictionary:_internal 
                                                                                                                        copyItems:YES];
                [_internal release];
                _internal = nil;
        }
}


- (void)removeObjectForKey:(id)key
{
        [self initWritterObjOnce];
        [_writterObj removeObjectForKey:key];
}


- (void)setObject:(id)object forKey:(id)key
{
        [self initWritterObjOnce];
        [_writterObj setObject:object forKey:key];
}




- (void)addObject:(id)object
{
        [self initWritterObjOnce];
        [_writterObj addObject:object];
}


- (void)insertObject:(id)object atIndex:(NSUInteger)index
{
        [self initWritterObjOnce];
        [_writterObj insertObject:object atIndex:index];
}


- (void)removeLastObject
{
        [self initWritterObjOnce];
        [_writterObj removeLastObject];
}


- (void)removeObjectAtIndex:(NSUInteger)index
{
        [self initWritterObjOnce];
        [_writterObj removeObjectAtIndex:index];
}


- (void)replaceObjectAtIndex:(NSUInteger)index withObject:(id)object
{
        [self initWritterObjOnce];
        [_writterObj replaceObjectAtIndex:index withObject:object];
}


- (void)dealloc
{
        [_writterObj release];
        [super dealloc];
}


@end

可能有更新:

googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCPlistFileWritter.m

github地址:

https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCPlistFileWritter.m

抱歉!评论已关闭.