How to get a filepath from a directory without file name in iOS Objective c
<p>Good day</p>

<p>How do you get a filePath without fileName from a fullpath.
Lets say I have a path:</p>

<p>NSString *myPath = @"/Users/myName/Library/Developer/CoreSimulator/Devices/.../Library/Caches/Getting Started.pdf";</p>

<p>and I want to just have </p>

<p>NSString *newPath = @"/Users/myName/Library/Developer/CoreSimulator/Devices/.../Library/Caches";</p>

<p>I didnt want to substring it, I hope there is a better solution.</p>

<p>Thank you in advance. </p>