Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 从iOS中的plist文件读取int_Iphone_Ios_Objective C_Plist_Nsdictionary - Fatal编程技术网

Iphone 从iOS中的plist文件读取int

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 {

我需要一些帮助来读取plist文件。 这是我的代码,但它不起作用,我也没有想法了。我想构建一个动态库,读取这个plist com.mi.pp1.plist的整数

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;
}