我想知道“_lastNotificationReceivedBundleIdentifier”的值,它是一个类的实例变量。标头是从 iOS 跳板应用程序中转储的。
@interface SBRemoteNotificationServer : NSObject <APSConnectionDelegate> {
NSMutableDictionary* _bundleIdentifiersToClients;
NSMutableDictionary* _environmentsToConnections;
unsigned _lastPlayedAlertSound;
NSString* _lastNotificationReceivedBundleIdentifier;
}
但以下代码不起作用:
%hook SBRemoteNotificationServer
-(void)noteApplicationFinishedLaunching:(id)launching{
NSLog(@"identifier=%@",_lastNotificationReceivedBundleIdentifier);
%orig;
}
%end
并且编译器错误是:
error: ‘_lastNotificationReceivedBundleIdentifier’ was not declared in this scope
如何访问和记录这个 NSString?