iOS

All posts tagged iOS

A somewhat specific problem that occurs often when developing for iOS and using SVN, is the need to escape the @ character.  The @ character is used with iOS and XCode to specify assets used for retina displays, by appending “@2x” to the end of the filename.  If you have ever tried to use a filename that contains an @ character with SVN, you likely would have encountered some trouble.  As soon as SVN sees the “@” in the filename, it seemingly ignores it and everything after it, cutting your filename short and causing an error.

Notice in the example above that everything past the “@” is missing in the warning message.  The problem is the @ character has special meaning to SVN; it expects everything after the @ to specify a revision number, so when it sees it in your path, it parses it out.  It gets trickier though, because escaping your path in the normal ways wont work, including surrounding it with quotes or using a backslash.

The workaround for this problem is simple and clever.  When parsing the filename, SVN only looks for the last occurrence of the @ character.  So if you add another @ character to the end of your filepath, the first one will stay intact.

Credit for the solution goes to gg1 at xappsoftware.com.