1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#import "ClasaPizza.h"

@implementation ClasaPizza
@synthesize image, instructions, name, pret, objectID, oferta, categorie;

- (void)encodeWithCoder:(NSCoder *)encoder
{
//     [super encodeWithCoder:encoder];
    //Encode properties, other class variables, etc
    [encoder encodeObject:self.name forKey:@"name"];
    [encoder encodeObject:self.instructions forKey:@"instructions"];
    [encoder encodeObject:self.pret forKey:@"pret"];
    [encoder encodeObject:self.objectID forKey:@"objectID"];
    [encoder encodeObject:self.oferta forKey:@"oferta"];
     [encoder encodeObject:self.categorie forKey:@"categorie"];
    [encoder encodeObject:self.image forKey:@"image"];
    NSLog(@"enocder cu decoder %@", self.name);
    
    
}
- (id)initWithCoder:(NSCoder *)decoder
{
   // self = [super initWithCoder:decoder];
    self = [super init];
    if( self != nil )
    {
        self.name = [decoder decodeObjectForKey:@"name"];
        self.instructions = [decoder decodeObjectForKey:@"instructions"];
        self.pret = [decoder decodeObjectForKey:@"pret"];
        self.objectID = [decoder decodeObjectForKey:@"objectID"];
        self.oferta = [decoder decodeObjectForKey:@"oferta"];
        self.categorie = [decoder decodeObjectForKey:@"categorie"];
        self.image = [decoder decodeObjectForKey:@"image"];
         NSLog(@"decoder cu decoder");
        
    }
    return self;
}

- (Class)classForCoder
{
    return [self class]; // Instead of NSMutableDictionary
}