• 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: runtime error using NSArray with NSButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: runtime error using NSArray with NSButton


  • Subject: Re: runtime error using NSArray with NSButton
  • From: Sherm Pendley <email@hidden>
  • Date: Thu, 5 Dec 2002 18:44:23 -0500

On Thursday, December 5, 2002, at 03:43 PM, Mike McCune wrote:

hi all, I'm trying to create an NSArray with the method arrayWithObjects, the objects are a mix of NSTextFields and NSButtons. I'm doing the creation in awakeFromNib. When the program runs it exits after start with signal(11) SIGSEGV. After debugging for awhile I narrowed it down to the NSButtons that are being added to the NSArray. I created a second NSArray and tried to add the NSButtons to just that array, but same thing program exits with (11).

Anybody have any ideas? I'm using Obj-C and the latest edition of the devtools with the july and october patches installed.

Without seeing your code, the best I can offer is a blind guess - but here goes. :-)

A SIGSEGV resulting from an arrayWithObjects message usually means that you forgot to pass a nil as the last parameter. For example, to create an array of two buttons, you'd need to write something like this:

anArray = [NSArray arrayWithObjects: aButton, anotherButton, nil];

Omitting the trailing nil is not a guaranteed crash - it will *sometimes* work, but not very often. It will only work if the processor register or memory address that would hold that parameter just happens to contain a zero.

sherm--

UNIX: Where /sbin/init is Job 1.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >runtime error using NSArray with NSButton (From: Mike McCune <email@hidden>)

  • Prev by Date: Re: runtime error using NSArray with NSButton
  • Next by Date: Objective-C++ compiler updates?
  • Previous by thread: Re: runtime error using NSArray with NSButton
  • Next by thread: Re: -methodForSelector: doesn't fail when it should
  • Index(es):
    • Date
    • Thread