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

Use bundleForClass: instead of mainBundle for framework compatibility #63

Merged
merged 1 commit into from
Oct 17, 2015

Conversation

rwickliffe
Copy link

When building Airbrake as a framework, [[NSBundle mainBundle] pathForResource:@"ABNotifier" ofType:@"bundle"] in ABLocalizedString will return nil. To support frameworks and static libraries, this should be changed to [[NSBundle bundleForClass:[ABNotifier class]] pathForResource:@"ABNotifier" ofType:@"bundle"] or something similar.

In the current implementation, there is an assertion failure and crash when building notice alerts.

There is quite a bit more information in the Pod Authors Guide to CocoaPods Frameworks from the CocoaPods folks that may be helpful.

@jocelynlih
Copy link
Contributor

Not sure why this PR is till here. LGTM

jocelynlih added a commit that referenced this pull request Oct 17, 2015
Use bundleForClass: instead of mainBundle for framework compatibility
@jocelynlih jocelynlih merged commit 69b42c3 into airbrake:master Oct 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants