I have a custom object: Vendor
that extends NSObject
. I am initiating it like so:
NSDictionary *vendorObj = [vendors objectAtIndex:i];
Vendor *vendor = [[Vendor alloc] initWithVendorInfo:vendorObj];
NSLog(@"VendorObj: %@", vendorObj);
NSLog(@"Vendor: %@", vendor);
Here is what the class looks like:
@interface Vendor : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *description;
- (id)initWithVendorInfo:(NSDictionary *)vendorDetails;
@end
@implementation Vendor
- (id)initWithVendorInfo:(NSDictionary *)vendorDetails
{
self = [super init];
if(self)
{
_name = [vendorDetails[@"company_name"] copy];
_description = [vendorDetails[@"description"] copy];
}
return self;
}
If I NSLog vendorObj
all the details are there. Once I initiate the Vendor
object and NSLog it, the log shows:
2013-11-21 22:22:44.769 [48202:a07] Vendor:
I cannot seem to figure out why my object is nothing, no memory address, not even a null. What am I doing wrong here?