Why "id"?


#1

On the first sample right after Fig 18.2, was wondering why you suggested using id instead of Person for the alloc/init message while demonstrating the unrecognized selector condition?


#2

If you leave it Person *, the compiler throws an error. I wanted the reader to see a runtime error.


#3

Got it.

But then with a clean build, you don’t get to see the warning that you refer to in the following paragraph… :wink: Person * did give me a warning for [person count] instead of error, so was still able to experience the NSException, as I first overlooked the “id” change. Until the next code block that I saw “Person *” turned bold, so I looked back…

Anyways, all good. Thanks for the reply.