Answer

To get the filename with extension from a given path do the following:

NSString *thePath = @"/tmp/test/result.log";

NSString *fname = [thePath lastPathComponent];

// result in fname = result.log