overriding NSObject initWithCoder/encodeWithCoder category?

  • Are there any reasons not to include these functions in a category on
    NSObject?:

    -(id)initWithCoder:(NSCoder*)decoder
    {
      return [self init];
    }

    -(void)encodeWithCoder:(NSCoder*)coder
    {
      return;
    }

    The compiler always warns that those functions may not be supported,
    but I know if I ever change my superclass I'll forget to update the
    coding routines...

    One obvious reason, I guess, is that Apple may choose to implement
    these methods in the future, causing a conflict...  Who wins a
    conflict like that?
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today