我想从 iphone 以编程方式最后拨打的号码(或当前呼叫)。我试过了
以下代码。但它产生一个空值。
-(NSString*)lastDialledNumber {
NSString *path = @"/var/mobile/Library/Preferences/com.apple.mobilephone.plist";
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
NSString *lastDialed = [NSString stringWithFormat:@"%@", [dict valueForKey:@"DialerSavedNumber"]];
return (([lastDialed isEqualToString:@""])?@"":lastDialed);
}
How can I solve this?