XCode: Extract filename from path

To get the filename from a given NSString containing the path you can call lastPathComponent

NSString *fileName = [myPathString lastPathComponent];

And if you need the filename without extention you call stringByDeletingPathExtension

NSString *pureFileName = [fileName stringByDeletingPathExtension];

Werbung



comments powered by Disqus

Copyright Dunkel & Iwer GbR | Datenschutzerklärung | Impressum