Documentation error: [NSAlert setDelegate:] retains the delegate, but @property declaration claims otherwise

Originator:mblsha
Number:rdar://21873271 Date Originated:2015-07-17
Status:Open Resolved:
Product:OS X SDK Product Version:10.10.4
Classification: Reproducible:
 
Summary:
NSAlert's delegate is declared as following:
@property(assign) id< NSAlertDelegate > delegate

But in reality, decompiled source code reveals that it's actually retained inside:
void -[NSAlert setDelegate:](void * self, void * _cmd, void * arg2) {
    rdi = self->_delegate;
    [rdi autorelease];
    rax = [arg2 retain];
    objc_assign_ivar(rax, self, *_OBJC_IVAR_$_NSAlert._delegate);
    return;
}

Steps to Reproduce:


Expected Results:
I guess the delegate declaration should be updated to be "retain" instead of "assign":
@property(retain) id< NSAlertDelegate > delegate


Actual Results:


Version:
Mac OS X 10.10.4 (14E46)

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!