我的问题涉及到通过-postNotificationName:object: userInfo:
方法添加的对象。
NSNotification是否会retain这个对象? (类似于NSMutableDictionary或Array),这是否意味着我可以在发布通知后释放该对象?
下面是一个代码片段,用于说明我的问题...释放对象是否有效。附上苹果文档链接将非常有帮助。
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];