• 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: Hillegas printing Stuck again!!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hillegas printing Stuck again!!


  • Subject: Re: Hillegas printing Stuck again!!
  • From: Antonio Nunes <email@hidden>
  • Date: Wed, 29 Aug 2007 10:18:21 +0100

On 29 Aug 2007, at 10:03, Martin Kyte wrote:

Person *p = [people objectAtIndex:i];
and then try to access each part of the object
[p personName] I get selector not recognised error
-[NSCFDictionary expectedRaise]: selector not recognized [self = 0x322b40]
I cannot understand why p should be of NSCFDictionary type and not my class type Person.

Regardless of how you declare p, it will be the type of the object assigned to it at runtime. So it would seem you filled your people array with dictionaries rather than with persons. Assigning "Person *p" is good for a lot of things, but at runtime this is not that important (I think), and you might as wel have assigned "id p". Think of it this way: p will point to whatever object is assigned to it, and the runtime knows the type of the object. How it is declared at compile time is of lesser consequence at runtime. (If this is incorrect or not that good a way of putting it I'm sure someone will chip in.)


-António

-----------------------------------------------------------
And could you keep your heart in wonder
at the daily miracles of your life,
your pain would not seem less wondrous
than your joy.

--Kahlil Gibran
-----------------------------------------------------------



_______________________________________________

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: 
 >Hillegas printing Stuck again!! (From: Martin Kyte <email@hidden>)

  • Prev by Date: Re: Hillegas printing Stuck again!!
  • Next by Date: Re: encoding vended objects
  • Previous by thread: Re: Hillegas printing Stuck again!!
  • Next by thread: radio buttons in NSMatrix obscuring text field
  • Index(es):
    • Date
    • Thread