6
Mam interfejs:initWithCoder: niewidoczny w NSObject?
#import <Foundation/Foundation.h>
@interface Picture : NSObject;
@property (readonly) NSString *filepath;
- (UIImage *)image;
@end
i realizacja:
#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
otrzymuję błąd: ARC problem - Brak widocznych @interface dla 'NSObject' deklaruje selektor 'initWithCoder:'
Czy jest coś innego na temat NSCoding podczas używania ARC? Dzięki