Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7953739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:13:42+00:00 2026-06-04T03:13:42+00:00

I have a NSArray that contain three keys with their corresponding values… When I

  • 0

I have a NSArray that contain three keys with their corresponding values… When I retrieve the value for a key with the method valueForKey: I get this on a NSLog():

2012-05-18 21:59:52.176 ScrollApp[21443:f803] value for key is(
    "Image 4"
)

which is exactly the value I set on the plist.

But if I assign this values to the text of the label the compiler complain with unrecognized selector sent to instance.

I know I will have to retrieve the returning value of the array as a string and pass it to the label.

The question is how?

This is the code:

NSArray *imgList = [[NSArray alloc]initWithContentsOfFile:path];
NSArray *imgName = [[NSArray alloc] initWithObjects:[imgList objectAtIndex:3], nil];

NSLog(@"%@", [imgName valueForKey:@"Details"]);

NSString *currentPic = [imgName valueForKey:@"Details"];

subPanel.small_panel_Detail_Lbl.text =  currentPic;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T03:13:43+00:00Added an answer on June 4, 2026 at 3:13 am

    valueForKey when sent to an array returns an array of all the values with that key in the array — it may only be one value, but it will be in an array. If you log [currentPic class], I’m guessing that it will be an array, so you need to send objectAtIndex to it to get a single string

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have NSArray and I want to remove duplicates from it. I know that
for an iOS 5.0 application using ARC, i have an NSArray of objects that
I have an NSArray of (Product) objects that are created by parsing an XML
I have code that works great for adding a button to the toolbar: NSArray*
Here is the code that I have for my cell of my UITableView: forKeys:[NSArray
I have a NSMutableArray and a NSArray . Both consist of elements that are
I have an NSArray storing NSDictionaries. Each dictionary has two keys; a name and
I have an NSArray that contains date strings (i.e. NSString) like this: Thu, 21
I have a dictionary whose keys are NSStrings and whose objects are NSArray. Here's
I have an iphone app that lets users post a 'story' to their facebook

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.