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

来源:互联网 发布:node 跨域请求 编辑:程序博客网 时间:2024/06/18 16:54
////  CCInfoPlistFileReader.m//  CCFC////  Created by xichen on 11-12-18.//  Copyright 2011 ccteam. All rights reserved.//#import "CCInfoPlistFileReader.h"static  id      InfoPlistObj;@implementation CCInfoPlistFileReader// not thread safe+ (id)sharedInstance{        if(InfoPlistObj == nil)        {                @synchronized(self)                {                        InfoPlistObj = [[CCInfoPlistFileReader alloc] init];                }        }        return InfoPlistObj;}+ (void)releaseInstance{        [InfoPlistObj release];        InfoPlistObj = nil;}// print all keys and values in Info.plist file+ (void)printAllKeysValues{        NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];        for(id key in [infoDict allKeys])        {                NSLog(@"key is:%@, value is:%@\n", key, [infoDict objectForKey:key]);        }}- (id)init{        self = [super init];        if(self)                _internal = [[[NSBundle mainBundle] infoDictionary] retain];        return self;}- (id)getVersion{        return [_internal objectForKey:@"CFBundleVersion"]; }@end


googlecode链接地址(会有更新):http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCInfoPlistFileReader.m

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