我一直在尝试在NSArray上创建一个分类,并查看了NSArray的接口,我假设要添加一个返回ObjectType的方法,应该是:
I've been trying to create a category on NSArray and looking at the interface of NSArray I assume that to add a method that returns an ObjectType is:
// interface
- (nullable ObjectType)giveMeAnObject;
// implementation
- (nullable ObjectType)giveMeAnObject
{
ObjectType object = nil;
return object;
}
然而,这并不起作用,我收到了错误信息“预计‘)’”在返回类型中。