+ Reply
Results 1 to 2 of 2
  1. #1
    What's Jailbreak?
    Join Date
    Jul 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default NSDictionary objectAtIndex

    Hi people,
    I'm trying to acces an NSDictionary for a table view.
    Now my problem is that in apple's example they use

    Code:
     [aNSDictionary objectAtIndex:intIndex];
    but htis method is deprecated, if you look in the reference of NSDictionary they eliminated this moethod but i don't understand what I must use instead...
    I'm little bit confused please help

    Thxx

  2. #2
    Developer NetMage's Avatar
    Join Date
    Aug 2007
    Location
    Virginia
    Posts
    1,292
    Thanks
    71
    Thanked 210 Times in 168 Posts

    Where was the example?

    objectAtIndex: is an NSArray method, not an NSDictionary method.

    An array is indexed by integers, a dictionary is indexed by keys, which can be any Objective-C object (hence
    Code:
    - (id)objectForKey:(id)aKey
    )

    Typically you would use NSString as keys, but you can do more sophisticated things.
    Starlight Computer Wizardry
    Pocket-sized Development
    Follow me on twitter: @NetMage

  3. The Following User Says Thank You to NetMage For This Useful Post:

    beit (08-18-2008)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts