Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NSBundle bundleForClass:] gives incorrect bundle path for frameworks #490

Closed
ahyattdev opened this issue Mar 22, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@ahyattdev
Copy link
Member

commented Mar 22, 2019

The following code fragment demonstrates the issue. It calls the method for NSString and should return the path to Foundation.framework.

#import <Foundation/Foundation.h>

int main()
{
	NSBundle *bundle = [NSBundle bundleForClass:[NSString class]];
	NSLog(@"%@", [bundle bundlePath]);
	return 0;
}

Output on macOS: /System/Library/Frameworks/Foundation.framework

Output in Darling: /System/Library/Frameworks/Foundation.framework/Versions/C

As a result of this issue, Xcode determines a developer path that is two directory levels too deep.

Our implementation should be modified to return the root of a bundle in this case.

@ahyattdev ahyattdev added this to the Xcode milestone Mar 22, 2019

@ahyattdev ahyattdev closed this in 13d71fb Mar 23, 2019

ahyattdev added a commit to darlinghq/darling-foundation that referenced this issue Mar 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.