0

What are the consequences of not declaring inheritance from NSObject?

I know this has been answered, kinda, in other answers such as here and here etc etc.

But none of the answers really go into the consequences of not inheriting from NSObject.

So specifically, if I do not subclass from NSObject for a critical class in my app, will I find out later on that this introduces a fundamental flaw into my app? Assume for whatever reason I would not be able to just subclass from NSObject later on.

thanks

Community
  • 1
  • 1
mfc
  • 3,018
  • 5
  • 31
  • 43
  • It will also mean you'll have to implement all NSObject's methods (e.g: alloc), at least the one listed in the NSObject protocol (e.g: retain/release). What would be the benefit for you? – Macmade Apr 18 '14 at 01:16
  • @Macmade, memory. I know NSObject isn't that big but every bit, nibble and byte is going to count in what i'm trying to do. – mfc Apr 18 '14 at 01:28
  • Lots of methods does not mean a lot of memory per instance... Actually, the size of an NSObject instance is 16 bytes... – Macmade Apr 18 '14 at 01:32

0 Answers0