Skip navigation.
 
mlRe: Turn off duplicate method warning
FROM : Uli Kusterer
DATE : Sat Jul 22 19:46:51 2006

Am 21.07.2006 um 14:09 schrieb Trygve Inda:

> I have two methods:
>
> -(void)generate:(NSMutableDictionary *)dict
>
> This is in my main AppController (and in AppController.h), and it 
> calls
>
> -(QTMovie *)generate:(NSMutableDictionary *)dict


  This might be a good choice to consider the naming of your methods. 
If you have a method name that works just fine for several different 
return types, it should either return a more generic type (e.g. 
"id"), or it should have a more specific name. If you have control 
over both classes, I'd suggest renaming the second to

-generateMovieFromInfoDictionary:

(Instead of InfoDictionary you may want to use some more suitable 
name based on what your app actually does and what the dictionary 
contains). I'd also suggest a name that contains more information 
about what kind of a dictionary it takes for the first method, but I 
can't make any useful guesses from what little information you provided.

  Objective C lends itself to writing self-documenting code, Xcode's 
autocompletion makes it easy to type those long names. Take advantage 
of that and you'll automatically avoid the naming conflict and your 
code will be easier to maintain because you won't have to look up 
what kind of a dictionary this method expects when you come back to 
it a year later.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de

Related mailsAuthorDate
mlTurn off duplicate method warning Trygve Inda Jul 21, 14:09
mlRe: Turn off duplicate method warning Rob Ross Jul 21, 16:38
mlRe: Turn off duplicate method warning Trygve Inda Jul 21, 22:51
mlRe: Turn off duplicate method warning Mike Blaguszewski Jul 21, 23:22
mlRe: Turn off duplicate method warning Uli Kusterer Jul 22, 19:46