home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / programm / 8055 < prev    next >
Encoding:
Text File  |  1993-01-10  |  2.4 KB  |  60 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!stanford.edu!enterpoop.mit.edu!micro-heart-of-gold.mit.edu!news.media.mit.edu!wave
  3. From: wave@media.mit.edu (Michael B. Johnson)
  4. Subject: weirdness: wave's or IB? 
  5. Message-ID: <1993Jan10.234916.10685@news.media.mit.edu>
  6. Sender: news@news.media.mit.edu (USENET News System)
  7. Organization: MIT Media Laboratory
  8. Date: Sun, 10 Jan 1993 23:49:16 GMT
  9. Lines: 49
  10.  
  11. Hi folks.  I would swear this was working a few weeks ago, but now it's not...
  12.  
  13. I'm writing some IB palettes which contains subclasses of Object, not View.
  14. The objects are actually proxies for other full fledged processes running
  15. on some arbitrary computer on the net.  If you do the obvious thing, i.e.
  16. each time your ObjC object init's it starts up the companion process, you
  17. end up with a bunch of "extra" processes.  For example, when you load your
  18. palette into IB, IB init's each of the objects in your palette.  Then when
  19. you drag an object from your palette into the Files Window, IB inits another
  20. one.  So far, for each object on your palette you've got two processes 
  21. floating out on the net that you don't want.  
  22.  
  23. You then go in to test mode.  At this point, you do want that process to
  24. start up.  So what to do?
  25.  
  26. Well, IB is nice enough to declare a bunch of protocols that should help
  27. you.  Jean-Marie has subclassed NXApp for IB and made it respond to a few
  28. new messages.  So, in your init and awake msgs, if you put the following
  29. code:
  30.  
  31. if ([NXApp resondsTo:@selector(isTestingInterface)])
  32. {  // we're in IB
  33.    if (![NXApp isTestingInterface]}
  34.    {  // building interface, not testing
  35.       return self;
  36.    }
  37.    //we're testing the interface, really exec the process
  38. }
  39. else
  40. {  //we must be in an app (not IB), really exec the process
  41. }
  42.  
  43. [self initWholeThang];
  44.  
  45. So, if you have some routine initWholeThang that actually starts up the 
  46. associated process, you should be golden.  Unfortunately, I seem to be
  47. getting NO back from [NXApp isTestingInterface] both when I'm building
  48. the interface (i.e.just frobbing around in IB) and when I'm testing the
  49. interace (command-r).  I would swear this was working fine a few weeks
  50. ago, and I even diff'ed my current code against that version, and nothing
  51. is different in that part.  Any ideas, please...  E-mail, and I'll summarize
  52. if anyone points out my foolishness.  Thanks.
  53.  
  54.  
  55. -- 
  56.  
  57. -->  Michael B. Johnson
  58. -->  MIT Media Lab      --  Computer Graphics & Animation Group
  59. -->  (617) 253-0663     --  wave@media-lab.media.mit.edu
  60.