インスタンス化され、いくつかのロジックを実行し、UIAlertView を表示するかどうかを決定するために呼び出される NSObject (MyCustomObject) のサブクラスがあります。MyCustomObject は UIAlertViewDelegate プロトコルを実装して、追加のロジックを実行し、alertView: clickedButtonAtIndex: でいくつかの NSUserDefaults を設定します。myCustomObject を解放するのはどこが適切ですか? ユーザーがアラート ビューのいずれかのボタンをクリックした後に myCustomObject が不要になった場合、myCustomObject は alertView: didDismissWithButtonIndex: ? でそれ自体を解放しても問題ありません。
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
NSLog(@"I'm UIAlertView's Delegate and I'm releasing myself");
[self release];
}