一个类可以在Objective-C中有多个类别吗?

kir*_*ran 3 objective-c

例如:

@interface ClassToAddMethodsTo (category1,category2,category3) 
  ...methods go here
@end
Run Code Online (Sandbox Code Playgroud)

tit*_*coy 9

一个类可以有多个类别但它们必须是分开的:

@interface MyClass (FirstCategory) 
...
@end

@interface MyClass (SecondCategory) 
...
@end
Run Code Online (Sandbox Code Playgroud)

等等.