我的问题是关于添加到-postNotificationName:object: userInfo:方法的对象.
NSNotification是否保留对象? (与NSMutableDictionary或Array类似)...意味着我可以在发布通知后释放该对象
下面是一个代码片段,用于帮助描述我的问题......释放对象是否有效.Apple文档的链接可能非常有用.
NSMutableDictionary *teamDictCopy = [self.teamDict mutableCopy];
[teamDictCopy setObject:[NSNumber numberWithInt:self.scrollViewIndex] forKey:@"imageIndex"];
if([self.statusButton.title isEqualToString:@"Completed"]){
[[NSNotificationCenter defaultCenter] postNotificationName:@"UnComplete" object:teamDictCopy userInfo:nil];
}
[teamDictCopy release];
Run Code Online (Sandbox Code Playgroud)