Silver challenge: what to do with date created


This is my solution.

  • I wanted date created zeroed out, as the challenge asked for init with only name and serial number.
  • Is this (stylishly) correct use of self? (self = [self … ]; return self; )

in BNRItem.m (declared in .h):

[code]//silver chall init

  • (id) initWithItemName:(NSString *)itsName
    serialNumber:(NSString *)itsSNr {

    self = [self initWithItemName:itsName
    dateCreated = nil;
    return self;
    and in main.m:

//create instance with silver init:
   BNRItem *p= [[BNRItem alloc]initWithItemName:@"Champions Cup"
        [items addObject:p];
        for (BNRItem *item in items) {
            NSLog(@"%@", item);

2013-08-13 23:19:00.392 BNR 1 RandomPossesions[87935:303] Champions Cup (UEFA2013): Worth $ 0, recorded on (null)