xcode – iPhone – Objective c

if you have file path and want to get file extension you can use [NSString : pathExtension] “Interprets the receiver as a path and returns the receiver’s extension, if any.” , “myFile.txt” will return “txt”

 

and if you want to delete file extension and get only file name “myFile.txt” will be “myFile” , you can use [NSString : stringByDeletingPathExtension] “Returns a new string made by deleting the extension (if any, and only the last) from the receiver.”

 

Related posts:

  1. objective c get iTunes file sharing folder files with full path xcode – iphone – objective c Hi; the method “function” below show you how to...
  2. Objective-c NSFileHandle get file size XCode – Objective-c Hi, If you use NSFileHandle in your code and you need to...
  3. objective c documents and temp directory Xcode – Objective-c Hi, If you want to get path of documents directory , you...
  4. objective c iOS sqlite3 tutorial with source code sample Xcode – objective-c -iphone source code; Hi, iPhone iOS embedded sqlite3 , first thing you...
  5. Objective-c check if file exists XCode – Objective-C Hi, The simplest way to know or to check if file exists...