In Mac OSX 10.6, the NSErrorFailingURLStringKey userInfo dictionary key is deprecated in favor of NSURLErrorFailingURLStringErrorKey. I am trying to write my program to be portable to both Mac OSX 10.5 and 10.6. For the time being, I'm just using the old key--but my compiler is giving me annoying deprecated warnings.
// The following causes deprecation warnings
[[error userInfo] objectForKey:NSErrorFailingURLStringKey]
// But this one won't work on OSX 10.5
[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]
What is the best way to write portable code to handle deprecated userInfo dictionary keys?