• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Populate a NSPopupButton with ascii
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Populate a NSPopupButton with ascii


  • Subject: Re: Populate a NSPopupButton with ascii
  • From: Bruce Truax <email@hidden>
  • Date: Wed, 27 Oct 2004 19:17:28 -0400

Can this also be done by populating an NSArray or an NSMutable Array? I
tried this using

popupList = [[NSArray alloc] initWithObjects: @"A", @"B", @"C", nil];

When I tried to populate the NSArray (or an NSMutableArray) programmatically
it would not work without the nil terminator. If I tried to add a nil
pointer at the end of the array I got a runtime error.

Bruce


On 10/27/04 3:30 PM, "Nick Zitzmann" <email@hidden> eloquently wrote:

>
> On Oct 27, 2004, at 1:17 PM, Peter Karlsson wrote:
>
>> Dear list!
>>
>> Can someone please tell me how to programatically populate a
>> NSPopupButton
>> with ascii characters?
>>
>> Example: A B C D E F and so on...
>
> Dear Peter!
>
> What about something like this? (note - written in Mail, untested, use
> at your own risk, etc.)
>
> unichar aChar;
> NSPopUpButton *button; // assume this was already initialized somewhere
> else
>
> for (aChar = 'A' ; aChar <= 'Z' ; aChar++)
> {
> [button addItemWithTitle:[NSString stringWithCharacters:&aChar
> length:1]];
> }
>
> Nick Zitzmann
> <http://www.chronosnet.com/>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Cocoa-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Populate a NSPopupButton with ascii (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Next by Date: Re: [OT] Re: [ANN] Cocoa Style for ObjC: 1 and 2
  • Previous by thread: Re: Populate a NSPopupButton with ascii
  • Next by thread: [Solved]RE: Re: Populate a NSPopupButton with ascii
  • Index(es):
    • Date
    • Thread