So I’m a little confused. I have an NSURL like this
https://something/something/test#4.html
I want to remove the last path of this. I tried using URLByDeletingLastPathComponent method but then it results in this.
https://something/something/#4.html
I want the end result to be the following.
https://something/something
2
Answers
First you have to remove the fragment. Then the last path using
deletingLastPathComponent()
.A smart way to remove the fragment is
URLComponents