Normally I do something like this (below) to get value I need:
NSDictionary *state = [notification.userInfo objectForKey:@"state"];
[self.tabBarItem setBadgeValue:[state objectForKey:@"short"]];
But does it worth开发者_如何学C to do retain/release for values taken from NSDictionary? Something like this:
NSDictionary *state = [[notification.userInfo objectForKey:@"state"] retain];
[self.tabBarItem setBadgeValue:[state objectForKey:@"short"]];
[state release];
Is it more memory friendly? Or I shouldn't bother and just trust to autorelease pool to do its job?
No, there's no point in doing that. The result of [notification.userInfo objectForKey:@"state"] is always an autoreleased object; if you add an extra retain and release, that won't change anything.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论