2
사용자 정의 객체가 있습니다. Vendor
은 NSObject
입니다. 그래서처럼 시작하고있다 : 나는 vendorObj
모든 세부 사항이있는 NSLog 경우생성 후 사용자 정의 객체가 비어 있음
@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;
}
:
여기NSDictionary *vendorObj = [vendors objectAtIndex:i];
Vendor *vendor = [[Vendor alloc] initWithVendorInfo:vendorObj];
NSLog(@"VendorObj: %@", vendorObj);
NSLog(@"Vendor: %@", vendor);
클래스의 모습이다. 나는 Vendor
객체와 NSLog를 시작하면, 로그를 보여줍니다
2013-11-21 22:22:44.769 [48202:a07] Vendor:
내 객체가 아무것도없고 메모리 주소, 심지어 널없는 이유를 알아낼 수 없습니다. 여기서 내가 뭘 잘못하고 있니?
우수! 나는 그것을보아야 만했다. 정말 고맙습니다 – brenjt