我正在学习 Objective-C,现在我被类别困住了。这是代码
#import <Foundation/Foundation.h>
@interface NSMutableArray (NSMutableArrayCategory)
-(NSMutableArray *)removeLastObject;
@end
#import "NSMutableArrayCategory.h"
@implementation NSMutableArray (NSMutableArrayCategory)
-(NSMutableArray *)removeLastObject
{
return [self removeObjectAtIndex:[self count] - 1];
}
@end
问题是我得到
Returning void from a function with incompatible result type 'NSMutableArray' *
这里有什么问题?