• 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: SOLVED Re: SIGTRAP on adding object to mutable array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SOLVED Re: SIGTRAP on adding object to mutable array


  • Subject: Re: SOLVED Re: SIGTRAP on adding object to mutable array
  • From: "Shawn Erickson" <email@hidden>
  • Date: Tue, 11 Sep 2007 15:58:12 -0700

On 9/11/07, Daniel Child <email@hidden> wrote:
> That's what I would have expected, but during debugging,
> wordObjects had an address and was listed as having 0 objects.
>
> However, your suggesting I look these over helped me uncover the error.
> I had declared the instance variables to be of one type and actually
> allocated memory for another type. Amazingly, XCode did not catch this or
> even generate a warning.

-[NSObject init] has a return type of id which is effectively
type-less (it can point to any object). It is valid to assign a value
of type id to any object ivar regardless of that ivars type.

I don't see how you got the failure reported earlier given the code
you posted here. You should have gotten an exception outlining an
attempt to send an addObject: message to an instance of
NSMutableDictionary which doesn't support such a message. It sounds
like some other issues was corrected around the same time you noticed
you allocated an object of the wrong type.

-Shawn
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >SIGTRAP on adding object to mutable array (From: Daniel Child <email@hidden>)
 >Re: SIGTRAP on adding object to mutable array (From: "Shawn Erickson" <email@hidden>)
 >SOLVED Re: SIGTRAP on adding object to mutable array (From: Daniel Child <email@hidden>)

  • Prev by Date: SOLVED Re: SIGTRAP on adding object to mutable array
  • Next by Date: Re: Cocoa WebKit Editing
  • Previous by thread: SOLVED Re: SIGTRAP on adding object to mutable array
  • Next by thread: Questions for a new mac developer...
  • Index(es):
    • Date
    • Thread