Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cell

NSString *filePath = [[NSBundle mainBundle] pathForResource: studyDetails.detailText ofType:@"html" inDirectory:@"HTMLContent"];
NSAssert(filePath, @"Expecting file \"%@.html\" to be present in the \"HTMLContent\" directory, but didn't find it", studyDetails.detailText);
NSURL *targetURL = [NSURL URLWithString:filePath];
NSURL *targetURL = [NSURL fileURLWithPath:filePath];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed stringByAddingPercentEscapesUsingEncoding:?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@YuanZhu-apple This code is correct, if we use fileURLWithPath: we do not need to use stringByAddingPercentEscapesUsingEncoding :, only fileURLWithPath already does everything.

NSURLRequest *request = [NSURLRequest requestWithURL:targetURL];
[webViewCell.webView loadRequest:request];

Expand Down