First example produce a error in code


The first example of the chapter give me a error on line

error says - conversion specific type ‘unsigned int’ but the argument has type ‘NSUInteger’ (aka 'unsigned long)

The example works, but xcode suggest I use token %1lu, instead of %1u

Has anyone encountered this error?

I’m using excode v 4.2.1


I don’t have the book handy, but I think you’ve misinterpreted lower-case L for a 1 in the book.

The book probably says “%lu”


error is gone in the second code example , due to

So in the first example count is not explicitly defined as a integer, that why xcode is complaining.