文章出處

首先在工程中加入XXX  plist 配置文件。 然后在key 輸入名字比如allsdk  value 里填寫.a 文件的名字

 

NSString *plistPath = [[NSBundle mainBundle]pathForResource:@"Pc_sdk" ofType:@"plist"];
    NSLog(@"plistPath:%@",plistPath);
    
    NSMutableDictionary *data = [[NSMutableDictionary alloc]initWithContentsOfFile:plistPath];
    NSLog(@"data:%@",data);
    
    id aa= [data objectForKey:@"SdkArray"];
    NSLog(@"aaff:%@",aa);
    
    //aa = [self pcinit];
    
    //把從配置文件里讀到的string 轉化成類名
    Class class = NSClassFromString([data objectForKey:@"SdkArray"]);
    Pctest *ctest = [(Pctest*)[class alloc]init];
    //[ctest pc_init];
    NSLog(@"ctesttt:%@",ctest);
    
    //Pctest 里的方法名要與配置文件里的.a 方法名要一致
    [ctest pcInit];

 

 


不含病毒。www.avast.com
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 AutoPoster 的頭像
    AutoPoster

    互聯網 - 大數據

    AutoPoster 發表在 痞客邦 留言(0) 人氣()