From 0141666e25135e2950e60223ebe50ade8c1b855e Mon Sep 17 00:00:00 2001 From: LucianoTurrini Date: Thu, 10 Sep 2015 21:16:24 -0300 Subject: [PATCH] Encoding NSString from file Path HTML Content, if any errors in String from file Path HTML, the file does not load. --- .../UI/Onboarding/APCStudyOverviewCollectionViewController.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/APCAppCore/APCAppCore/UI/Onboarding/APCStudyOverviewCollectionViewController.m b/APCAppCore/APCAppCore/UI/Onboarding/APCStudyOverviewCollectionViewController.m index afcc1399..553eec4e 100644 --- a/APCAppCore/APCAppCore/UI/Onboarding/APCStudyOverviewCollectionViewController.m +++ b/APCAppCore/APCAppCore/UI/Onboarding/APCStudyOverviewCollectionViewController.m @@ -238,7 +238,8 @@ - (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]; + NSString *encodingFilePath = [filePath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; + NSURL *targetURL = [NSURL URLWithString:encodingFilePath]; NSURLRequest *request = [NSURLRequest requestWithURL:targetURL]; [webViewCell.webView loadRequest:request];