文章出處
首先在工程中加入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 |
全站熱搜
留言列表