I am working on a macOS tool that uses the Apple Safari framework. When working on macOS 10.13, the tool binds and loads it from
/System/Library/PrivateFrameworks/Safari.framework
and everything is working fine. But when working on macOS 10.12.6, some types of behavior are missing. Based on some research with DTrace, I think this is because my tool should load the latest Staged structure here, which is located here:
/System/Library/StagedFrameworks/Safari/Safari.framework
This, apparently, is what Safari does, because if I join Safari with lldb and run image list, in 10.13 the list includes only the old path, and in 10.12.6 only the last.
I tried the following:
NSBundle* stagedBundle = [NSBundle bundleWithPath:@"/System/Library/StagedFrameworks/Safari/Safari.framework"];
nil 10.13, . 10.12.6 a stagedBundle, :
NSBundle* privateBundle = [NSBundle bundleForClass:[BookmarksController class]];
[privateBundle unload];
[stagedBundle load];
, -, , , -description , Private bundle (), Staged bundle ( ), .
. (1) -bundleForClass:, , , , , . (2) -respondsToSelector:, , , , Staged framework, NO.
_CFBundleFlushBundleCaches(), , .
FRAMEWORK_SEARCH_PATHS Staged framework Mac , , , , .
?
UPDATE
. Apple Framework Programming Guide, , , . :
- NSBundle
-load -unload - ,
- > , Safari, .
- >
-weak_framework Safari - > Staged path , , macOS 10.12.6, .
, 10.13, 10.12.6, , -, - 10.12.6. NSLog , , , , Staged framework.
?