Re: runtime error using NSArray with NSButton
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.