send message to multiple objects at once (objective-c)
问题 (or set multiple objects with one value) Is there a way to send multiple objects one message in one line. So like [someObject, otherObject reset]; like in LUA scripts (which I believe is C?) you can set mutliple objects: someThing, otherThing = 1 , 0 回答1: In short, no, neither Objective-C nor C support this feature. As an extreme measure, you can use -[NSArray makeObjectsPerformSelector:] and -[NSArray makeObjectsPerformSelector:withObject:] , such as [[NSArray arrayWithObjects:someObject,