Conforming to protocol
suggest changeYou can add protocols to standard classes to extends their functionality:
@protocol EncodableToString <NSObject>
- (NSString *)toString;
@end
@interface NSDictionary (XYZExtended) <EncodableToString>
@end
@implementation NSDictionary (XYZExtended)
- (NSString *)toString {
return self.description;
}
@end
where XYZ your project’s prefix
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents