gpt4 book ai didi

ios - 访问转储 header 的实例变量(iOS)

转载 作者:行者123 更新时间:2023-11-29 10:56:22 29 4
gpt4 key购买 nike

我想知道类的实例变量“_lastNotificationReceivedBundleIdentifier”的值。 header 是从 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?

最佳答案

您可能会使用 objective-c 运行时功能并查看方法 object_getInstanceVariable(the_object, "_lastNotificationReceivedBundleIdentifier", (void**)&yourPointer);

关于ios - 访问转储 header 的实例变量(iOS),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18124451/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com