• 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: Using instance variable from NSArray of objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using instance variable from NSArray of objects


  • Subject: Re: Using instance variable from NSArray of objects
  • From: Steve Gran <email@hidden>
  • Date: Fri, 9 Dec 2005 14:43:12 -0800

>> I don't really "get" the concept of how to get back instance
>> variables of an object when the object is in an array.


>You'll have to get the object out of the array first.

>(Or, if you are using bindings, you would use an NSArrayController to
>access the objects inside the array.)

>> I change the the line to
>> [returnedPrice setIntValue: [[theObjectINeed
>> valueForKey:@"priceOfCar"] intValue]];


>Try

> [returnedPrice setIntValue: [[[theObjectINeed objectAtindex:0]
>valueForKey:@"priceOfCar"] intValue]];

>('theObjectINeed' is not a good variable name, really. I'd make that
>'filteredArray' or some such.)


Got it, and yes I was just using "theObjectINeed" even after I figured out that instead of it being "the" object it was really just an array which contained the filtered object so as not to confuse you (or anyone else who was trying to follow my pretty convoluted example).

:)

More importantly, as a newbie to programming (in my retirement by the way), I am beginning to understand how the pieces are fitting together and the concepts of things like various instance variables within objects all within an array of objects. Which believe me is quite a bit to grasp.

But thanks again, I appreciate the time and help you and others have taken in "dummy down the jargon" for this ol' guy. I often preface my posts with a line from the movie Philadelphia..."Talk to me like I'm a six year old."

;)
_______________________________________________
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
  • Prev by Date: Re: threads vs run-loops for keeping your GUI responsive
  • Next by Date: Re: NSTextField undo in a sheet?
  • Previous by thread: Re: Using instance variable from NSArray of objects
  • Next by thread: How To: NSAttributedString in a NSTableView, catch clicks on a link
  • Index(es):
    • Date
    • Thread