문제

I need to pass an NSDictionary with a couple of options to

NSAlert - (void)beginSheetModalForWindow:(NSWindow *)window modalDelegate:(id)modalDelegate didEndSelector:(SEL)alertDidEndSelector contextInfo:(void *)contextInfo

The docs don't say anything about if the contextInfo has to be retained or not. Right now I'm retaining it before showing the alert and releasing it in alertDidEnd:, but it would be nice to know for sure if that is necessary.

도움이 되었습니까?

해결책

Since contextInfo is considered to be a "raw" C pointer (void *) and can be anything, it's your responsibility to manage memory (if you're passing an Objective-C object: to retain it).

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top