From The NSString reference, you can use :
NSString* theFileName = [[string lastPathComponent] stringByDeletingPathExtension]
The lastPathComponent call will return "thefile.ext", and the stringByDeletingPathExtension will remove the .ext from the end.