The answers above are misleading. The docs don't really mention it but paths and file names do have length limits.
You can see here there is a limit to the length a file path or name can take up. You can check these in syslimits.h
.
#define NAME_MAX 255 /* max bytes in a file name */
#define PATH_MAX 1024 /* max bytes in pathname */
You can log them and see for yourself like so:
NSLog(@"PATH MAX VALUE: %i", PATH_MAX)
Paths are limited at 1024 bytes or 1024 characters in UTF-8.
Filenames in paths are limited to 255 bytes or 255 characters in UTF-8.
I ran into this problem trying to deal with files that have encoded Japanese characters (which lengthen the URL/names significantly). My only solution is to crop the name as of right now.
You can see here on this apple support page that they talk about how some languages (like korean or japanese) have characters that take up more bytes and cause problems (they don't really provide a good way to deal with the problem though):
https://support.apple.com/en-is/HT202808