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 8893067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:09:25+00:00 2026-06-14T23:09:25+00:00

I have a custom Picker with country list and corresponding flags everything work fine,

  • 0

I have a custom Picker with country list and corresponding flags everything work fine, but i want when country is selected country name and the flag as background picture to be displayed and i don’t understand why my method can’t set text a text it’s make no sense for me.
this is my code: Note my “country” NSSTring is properly declared in interface and synthesized in .m
and namefieldText IBOutlet is connected.
Code:

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
    // report the selection to the UI label

   country = [customPickerArray objectAtIndex:[pickerView selectedRowInComponent:0]];

      nameFiled.text =country;     // Nothing happens here

    NSLog(@"%@",country);         //NSLog show correctly selected country in a console 
}
  • 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-14T23:09:26+00:00Added an answer on June 14, 2026 at 11:09 pm

    The issue is with your:

    country = [customPickerArray objectAtIndex:[pickerView selectedRowInComponent:0]];

    Instead, you should be saying:

    country = [customPickerArray objectAtIndex:row];

    Good luck!

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

Sidebar

Related Questions

I have custom classes that I currently instantiate within App.xaml as resources. I want
I have lookup column, but the data in this column is very large.I want
I have a custom dialog in my android application. I want to have in
I have the following code, its a custom people picker for sharepoint 2010. It
I have to create the custom TableView with the picker control in multiple rows,can
I have a date picker: <link rel=stylesheet type=text/css href=/css/jquery-ui-1.8.17.custom.css/> <script src=/js/jquery-1.7.1.min.js></script> <script src=/js/jquery-ui-1.8.17.min.js></script> <div
i have this code for a datetime picker <link type=text/css href=css/ui-lightness/jquery-ui-1.7.2.custom.css rel=stylesheet /> <script
I'm using XCODE 4.2 on iOS5. I have created a UITableViewController custom, called picker.
I have created custom module from - Modulecreator. Now I want to add calender
I have set a picker's model to a custom class which inherits UIPickerViewModel I

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.