Domanda

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.

È stato utile?

Soluzione

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).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top