In Objective-C, they're simply called id
. It's a principal concept of the language.
The alternative is NSObject
, but this is typically used for subclassing -- id
covers a more broad spectrum as not all (but most) objects inherit from NSObject
.
Ex.
- (void)actionInitWithObject:(id)something
{
if([something isKindOfClass:[UIButton class])
{
UIButton *button = (UIButton *)something;
...
} else if ([something isKindOfClass:[UILabel class]) {
UILabel *label = (UILabel *)something;
...
}
}