I have an instance of NSNumber * did inside a class called Reservation.
Below myres is an instance of Reservation
myres.did = [[NSNumber alloc] initWithInt:[[[data objectForKey:@"discount"] did] intValue]];
When I do this everything works just fine. However the code is ugly, and when I do:
myres.did = [data objectForKey:@"discount"] did];
My code breaks down.. I know that [[data objectForKey:@"discount"] did] returns an object, which is an NSNumber.
Can some explain to me why is this? and what do I need to change in my code if I want to assign a NSNumber with another NSNumber?