• 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: Andreas Mayer <email@hidden>
  • Date: Fri, 9 Dec 2005 22:28:46 +0100


Am 09.12.2005 um 21:45 Uhr schrieb Steve Gran:

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.)


Andreas
_______________________________________________
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
References: 
 >Re: Using instance variable from NSArray of objects (From: Steve Gran <email@hidden>)

  • Prev by Date: Re: Programmatically add data to a Persistent Data Model with Bindings
  • Next by Date: Re: threads vs run-loops for keeping your GUI responsive
  • Previous by thread: Re: Using instance variable from NSArray of objects
  • Next by thread: Re: Using instance variable from NSArray of objects
  • Index(es):
    • Date
    • Thread