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

Replacing URLWithString: by fileURLWithPath: #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

LucianoTurrini
Copy link
Contributor

Thus managed to avoid problems like build the URL with null values if the string contains spaces or special character.

@@ -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];
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.

Erin-Mounts added a commit to Erin-Mounts/AppCore that referenced this pull request Oct 18, 2016
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