home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5244 < prev    next >
Encoding:
Text File  |  1992-07-26  |  1.5 KB  |  54 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!psgrain!hippo!shannon!pc86.ee.wits.ac.za!colo
  3. From: colo@odie.ee.wits.ac.za (Illan Colombick)
  4. Subject: Re: freeing an object--when?
  5. Message-ID: <colo.21@odie.ee.wits.ac.za>
  6. Sender: news@shannon.ee.wits.ac.za
  7. Organization: Wits Electrical Engineering (Novell Users).
  8. References: <1992Jul24.180535.18214@MITL.COM>
  9. Distribution: na
  10. Date: Sun, 26 Jul 1992 13:18:41 GMT
  11. Lines: 41
  12.  
  13. In article <1992Jul24.180535.18214@MITL.COM> edlau@mitl.com (Ed Lau) writes:
  14.  
  15.  
  16.  
  17. >Here's my problem: I want to free my document object when the user closes its  
  18. >respective window. To do this, I have the following code in my windowWillClose:  
  19. >method in Document.m:
  20.  
  21. >- windowWillClose:sender
  22. >{
  23. >    [controller rmDoc:self];
  24.  
  25. >        ...
  26. >}
  27.  
  28. [stuff deleted]
  29.  
  30. >However, since my document object is freed, its window is left without a  
  31. >delegate. What to do?
  32.  
  33. >--Edward Lau
  34. >edlau@chaos.mitl.com
  35.  
  36. Surely it does not matter that the window is without a delegate? The Window 
  37. is about to close. Unless you have setFreeOnClose: NO (default is YES), so 
  38. that the window just disappears from the screen, but remains in existence. 
  39. In that case, have windowWillClose check  the dontFreeOnClose value to 
  40. decide whether or not to free the Document. 
  41.  
  42. If I have missed something here about doomed delegateless windows, please do 
  43. tell me, I am (very) far from being an expert NeXT programmer.
  44.  
  45. Bye.
  46. Illan
  47.  
  48.    ......
  49.   \\\\\///
  50.   C o l o     {textmail, NeXTmail} to colo@{odie, TuRInG}.ee.wits.ac.za
  51.    %% - %
  52.     ~%%%~
  53.  
  54.