FROM : Shaun Wexler
DATE : Sat Jan 18 22:06:47 2003
On Saturday, January 18, 2003, at 12:10 PM, Lachlan Deck wrote:
>> - (void) windowWillClose:(NSNotification *)notification
>> {
>> NSWindow *windowAboutToClose = [notification object];
>>
>> if (windowAboutToClose == myWindow)
>
> Shouldn't that be:
> if ([windowAboutToClose isEqual:myWindow])
>
> it is a pointer to an object after all and not a basic data type...
A method messaging call is not necessary in this case. He should
really just write it as:
if ([notification object] == myWindow)
...since he already has a local pointer in myWindow. Pointer
comparisons are fine.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Sat Jan 18 22:06:47 2003
On Saturday, January 18, 2003, at 12:10 PM, Lachlan Deck wrote:
>> - (void) windowWillClose:(NSNotification *)notification
>> {
>> NSWindow *windowAboutToClose = [notification object];
>>
>> if (windowAboutToClose == myWindow)
>
> Shouldn't that be:
> if ([windowAboutToClose isEqual:myWindow])
>
> it is a pointer to an object after all and not a basic data type...
A method messaging call is not necessary in this case. He should
really just write it as:
if ([notification object] == myWindow)
...since he already has a local pointer in myWindow. Pointer
comparisons are fine.
--
Shaun Wexler
MacFOH
http://www.macfoh.com
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Matis Schotte | Jan 18, 18:50 | |
| j o a r | Jan 18, 19:05 | |
| Shaun Wexler | Jan 18, 19:05 | |
| mw | Jan 18, 19:20 | |
| Shaun Wexler | Jan 18, 19:42 | |
| Lachlan Deck | Jan 18, 21:10 | |
| Shaun Wexler | Jan 18, 22:06 | |
| Matis Schotte | Jan 18, 22:29 | |
| Daryn | Jan 19, 04:11 |






Cocoa mail archive

