initWithCoder :не отображается в NSObject?

У меня есть интерфейс:

#import <Foundation/Foundation.h>

@interface Picture : NSObject;

@property (readonly) NSString *filepath;
- (UIImage *)image;

@end

и реализация:

#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

Я получаю сообщение об ошибке:Проблема с ARC -Нет видимого @interface для 'NSObject' объявляет selector' initWithCoder :'

Есть ли что-то другое в NSCoding при использовании ARC? Спасибо

6
задан 0xSina 28 April 2012 в 11:16
поделиться

0 ответов