send message to multiple objects at once (objective-c)

后端 未结 4 395
忘掉有多难
忘掉有多难 2021-01-15 05:52

(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];
<         


        
4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-15 06:39

    There are a couple methods in NSArray that can help with this:

    • (void)makeObjectsPerformSelector:(SEL)aSelector

    and

    • (void)makeObjectsPerformSelector:(SEL)aSelector withObject:(id)anObject

提交回复
热议问题