Why does fast enumeration not skip the NSNumbers when I specify NSStrings?

前端 未结 8 1279
慢半拍i
慢半拍i 2021-01-14 02:27

I thought that I knew how to use fast enumeration, but there is something I don\'t understand about it. If I create three NSString objects and three NSNum

8条回答
  •  滥情空心
    2021-01-14 02:38

    Every object that descends from NSObject implements the method - (NSString)description, %@ in Objective-C formate string will take the corresponding argument for the %@ and call its description method, Most subclasses of NSObject will implement there own version of - (NSString)description. The same thing happens when you type

    > po anObject
    

    in the debugger.

提交回复
热议问题