メソッドを使用して通知を投稿する必要があり、反対側で取得できるようにカスタム クラスをpostNotificationName:object:userInfo:
渡しています。このまま使うべきかFileItem
userInfo
autorelease
FileItem *item = [[[FileItem alloc] init] autorelease];
[[NSNotificationCenter defaultCenter] postNotificationName:@"dataReceived" object:self userInfo:item];
[item release];
または、オブジェクトをデフォルトの通知センターに渡した直後にオブジェクトを渡すことはalloc
できますか?release
FileItem *item = [[FileItem alloc] init];
[[NSNotificationCenter defaultCenter] postNotificationName:@"dataReceived" object:self userInfo:item];
[item release];
オブジェクトをメッセージのパラメーターとして別のオブジェクトに渡すたびに、受信オブジェクトは必要に応じて保持を行い、そのパラメーターを安全に解放できると想定しているため、ここで規則を取得しようとしていますか?