What\'s the best way to check if a Nib or Xib file exists before trying to load it using initWithNibName:bundle:
or similar?
There are two solutions I see here.
You could just call initWithNibName:bundle: and catch an exception if it fails (I like this idea, it feels robust). You will probably want to verify that the exception is in fact a "file not found" exception rather than, say, an "out of memory" exception.
Alternatively, you could check the existence of the nib first, using NSBundle's pathForResource:ofType:, which returns nil for files that don't exist.