• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to properly dealloc NSDictionary instance
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Multiple Views, one NSScrollView
  • Next by Date: Re: How to properly dealloc NSDictionary instance
  • Previous by thread: Re: How to properly dealloc NSDictionary instance
  • Next by thread: Issues with LSOpenFromRefSpec
  • Index(es):
    • Date
    • Thread