Re: How to properly dealloc NSDictionary instance
Re: How to properly dealloc NSDictionary instance
- Subject: Re: How to properly dealloc NSDictionary instance
- From: Mark Wade <email@hidden>
- Date: Sat, 21 Jul 2007 13:17:29 -0400
>> How are you allocating the keys and values?
The dictionary and method names are wrong, amongst other
things,should be something to do with invocation but i'm working on
it...
- (void)buildMethodSelectorDictionary
{
modelMethodSelectors = [[NSMutableDictionary alloc]initWithCapacity:6];
InventoryModel *t_model = [[[InventoryModel alloc]init]autorelease];
SEL t_selector = @selector(getIdStr);
NSMethodSignature *t_methodSignature = [[t_model class]
instanceMethodSignatureForSelector:t_selector];
NSInvocation *t_invocation = [NSInvocation
invocationWithMethodSignature:t_methodSignature];
[t_invocation setSelector:t_selector];
[modelMethodSelectors setObject:t_invocation forKey:@"id"];
t_selector = @selector(getName);
t_methodSignature = [[t_model class]
instanceMethodSignatureForSelector:t_selector];
t_invocation = [NSInvocation
invocationWithMethodSignature:t_methodSignature];
[t_invocation setSelector:t_selector];
[modelMethodSelectors setObject:t_invocation forKey:@"name"];
t_selector = @selector(getQuantity);
t_methodSignature = [[t_model class]
instanceMethodSignatureForSelector:t_selector];
t_invocation = [NSInvocation
invocationWithMethodSignature:t_methodSignature];
[t_invocation setSelector:t_selector];
[modelMethodSelectors setObject:t_invocation forKey:@"quantity"];
t_selector = @selector(getLocation);
t_methodSignature = [[t_model class]
instanceMethodSignatureForSelector:t_selector];
t_invocation = [NSInvocation
invocationWithMethodSignature:t_methodSignature];
[t_invocation setSelector:t_selector];
[modelMethodSelectors setObject:t_invocation forKey:@"location"];
t_selector = @selector(getCategory);
t_methodSignature = [[t_model class]
instanceMethodSignatureForSelector:t_selector];
t_invocation = [NSInvocation
invocationWithMethodSignature:t_methodSignature];
[t_invocation setSelector:t_selector];
[modelMethodSelectors setObject:t_invocation forKey:@"category"];
t_selector = @selector(getNotes);
t_methodSignature = [[t_model class]
instanceMethodSignatureForSelector:t_selector];
t_invocation = [NSInvocation
invocationWithMethodSignature:t_methodSignature];
[t_invocation setSelector:t_selector];
[modelMethodSelectors setObject:t_invocation forKey:@"notes"];
}
-- mark wade
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden