Article View: comp.sys.next.programmer
Article #116Re: PopUpList Question
From: Gregory H. Anderson
Date: Mon, 02 Nov 1992 19:40
Date: Mon, 02 Nov 1992 19:40
31 lines
1634 bytes
1634 bytes
In article <1992Oct27.153629.16802@pencom.com> msanford@finn (Mike
Sanford) writes:
>
> This is the deal. I want to remove the items from a popuplist and put
in
> new items. The following method does not work correctly.
>
> - deleteAllItems:aPopUpList
> {
> while ([aPopUpList count])
> [aPopUpList removeItemAt:0];
> return self;
> }
>
> Execution does leave the method making me think that aPopUpList is
> empty, however, the item that is selected when this methods is invoked
> is not removed.
>
No, the item that was selected *is* removed by your method, but it gets
put right back when you click the cover button. The docs say that if the
title of the sender (cover button) does not exist on the PopUpList, an
item is created automatically. I think that's what is happening here.
You'd have to change the cover button title to one of your desired values,
or blank it, to get the behavior you want.
--
Gregory H. Anderson | "We're very tolerant around here,
Benevolent Dictator-for-Life | being only amateurs ourselves."
Anderson Financial Systems | - Tortoise (Godel, Escher, Bach)
greg@afs.com (Nextmail OK) |
Technical Details
Message-ID:
<1992Nov2.194054.1373@afs.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!news.Brown.EDU!qt.cs.utexas.edu!yale.edu!spool.mu.edu!agate!doc.ic.ac.uk!uknet!mcsun!sunic!psinntp!psinntp!afs!gregReferences:
<1992Oct27.153629.16802@pencom.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!noc.near.net!news.Brown.EDU!qt.cs.utexas.edu!yale.edu!spool.mu.edu!agate!doc.ic.ac.uk!uknet!mcsun!sunic!psinntp!psinntp!afs!greg From: greg@afs.com (Gregory H. Anderson) Newsgroups: comp.sys.next.programmer Subject: Re: PopUpList Question Message-ID: <1992Nov2.194054.1373@afs.com> Date: 2 Nov 92 19:40:54 GMT References: <1992Oct27.153629.16802@pencom.com> Sender: greg@afs.com Reply-To: greg@afs.com Lines: 31