-
Notifications
You must be signed in to change notification settings - Fork 721
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
TSMessageView ios9 crash #257
Comments
+1 |
Here, in better markdown: + (NSMutableDictionary *)notificationDesign
{
if (!_notificationDesign)
{
NSString *path = [[NSBundle mainBundle] pathForResource:TSDesignFileName ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:path];
NSAssert(data != nil, @"Could not read TSMessages config file from main bundle with name %@.json", TSDesignFileName);
_notificationDesign = [NSMutableDictionary dictionaryWithDictionary:[NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:nil]];
}
return _notificationDesign;
} This results in a direct crash on iOS9:
iOS9 can't find the right bundle probably :s |
I was able to work around the issue by adding the TSMessagesDefaultDesign.json to the "copy bundle resources" section in project Build Phases |
I think it's something related to the new CocoaPods version |
I got the same issue and it was caused by I used first https://github.com/CocoaPods/cocoapods-deintegrate to deintegrate the complete cocoapods integration and afterwards i run |
use framework's bundle instead of app's bundle NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:TSDesignFileName ofType:@"json"]; |
The fix by @max-potapov works. Thank you! May we have a PR? |
g *path = [[NSBundle bundleForClass:[self class]] pathForResource:TSDesignFileName ofType:@"json"]; is not helpful for me |
@Brian-Chen049 Change that line in TSMessageView.m in |
I know it's been a while, but here's a fork by @svlaev with the fix @max-potapov mentions: https://github.com/svlaev/TSMessages/blob/master/Pod/Classes/TSMessageView.m#L148 |
(NSMutableDictionary *)notificationDesign
{
if (!_notificationDesign)
{
NSString *path = [[NSBundle mainBundle] pathForResource:TSDesignFileName ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:path];
NSAssert(data != nil, @"Could not read TSMessages config file from main bundle with name %@.json", TSDesignFileName);
}
return _notificationDesign;
}
The text was updated successfully, but these errors were encountered: