Iphone 从iOS中的plist文件读取int
我需要一些帮助来读取plist文件。 这是我的代码,但它不起作用,我也没有想法了。我想构建一个动态库,读取这个plist com.mi.pp1.plist的整数Iphone 从iOS中的plist文件读取int,iphone,ios,objective-c,plist,nsdictionary,Iphone,Ios,Objective C,Plist,Nsdictionary,我需要一些帮助来读取plist文件。 这是我的代码,但它不起作用,我也没有想法了。我想构建一个动态库,读取这个plist com.mi.pp1.plist的整数 Bux = [[[NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.mi.pp1.plist"]valueForKey:@"kBux"]intValue]; %hook PPPlayerData - (int)bux {
Bux = [[[NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.mi.pp1.plist"]valueForKey:@"kBux"]intValue];
%hook PPPlayerData
- (int)bux
{
return Bux;
}
%end
works这是针对越狱设备的吗?在普通设备上运行的普通应用程序无法访问此类文件。是。我不确定是否可以为非越狱者创建DYLIB。@RamyAlZuhouri使用它,您可以连接到进程。您应该调用
objectForKey:
,而不是valueForKey:
。
int Bux;
Bux = [[[NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences /com.mi.pp1.plist"]objectForKey:@"kBux"]intValue];
%hook PPPlayerData
- (int)bux
{
return Bux;
}