6
tengo una interfaz:initWithCoder: no visible en NSObject?
#import <Foundation/Foundation.h>
@interface Picture : NSObject;
@property (readonly) NSString *filepath;
- (UIImage *)image;
@end
e implementación:
#import "Picture.h"
#define kFilepath @"filepath"
@interface Picture() <NSCoding> {
NSString *filepath;
}
@end
@implementation Picture
@synthesize filepath;
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
return self;
}
- (void)encodeWithCoder:(NSCoder *)aCoder {
[aCoder encodeObject:filepath forKey:kFilepath];
}
- (UIImage *)image {
return [UIImage imageWithContentsOfFile:filepath];
}
@end
me sale error: tema ARC - No se @interface visibles para 'NSObject' declara el selector 'initWithCoder:'
¿Hay algo diferente acerca de NSCoding cuando se usa ARC? Gracias