ARC: __bridge versus __bridge_retained using contextInfo test case
问题 Consider this ARC code: - (void)main { NSString *s = [[NSString alloc] initWithString:@"s"]; [NSApp beginSheet:sheet modalForWindow:window modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:context:) contextInfo:(__bridge void *)s ]; } - (void)sheetDidEnd:(NSWindow *)sheet returnCode:(NSInteger)returnCode context:(void *)context { NSString *s = (__bridge_transfer NSString *)context; } Question: on line 7, should __bridge be used, or __bridge_retained , or does it not matter,