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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:36:52+00:00 2026-05-20T22:36:52+00:00

I have been working on a easy RSS reader for my own. I am

  • 0

I have been working on a easy RSS reader for my own. I am new to Objective-C so I am stuck at one point. There is a add button on the navigation bar of the application which opens a uialertview with a textfield where the user gonna input the url of the rss feed. The application has a predefined rss feed address in its source code. I am writing my code examples below:

- (void)viewDidLoad {
    [super viewDidLoad];    
    self.feeds = [NSArray arrayWithObjects:@"http://www.formula1.com/rss/news/latest.rss",
                  nil];

feeds is the predefined array which has the address of the feed. I tried that code below to get the text but it didnt work. Also how the application gonna take that url from textfield and replace with the predefined one?

- (void) myAlertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex

{

    if (buttonIndex == 1)

    { // Ok pushed
        //[data addObject:myTextField.text];

    }
  • 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-05-20T22:36:52+00:00Added an answer on May 20, 2026 at 10:36 pm

    The buttons in a UIAlertView are zero-index. If OK is your only button, is should be:

    if (buttonIndex == 0)
    

    Also, if I understand you correctly, you want to replace the text with the array property. The answer would depend on where the textfield is but I recommend you give a tag to your textfield as so:

    myTextField.tag = 10; //Any number should work
    

    Now you can access that textfield using the method viewWithTag: on it’s parent view.

    If the textfield is in the main view, you would retrieve as follows (within your ViewController):

    UITextField *textfield = (UITextField *)[self.view viewWithTag:tagNumber]; //tagNumber being the tag you assigned to the field
    textfield.text = [self.feeds objectAtIndex:0];
    

    It would be similar if the field was in the address book (within the clickedButtonAtIndex method):
    UITextField *textfield = (UITextField *)[alert viewWithTag:tagNumber]; //tagNumber being the tag you assigned to the field
    textfield.text = [self.feeds objectAtIndex:0];

    EDIT: I reread what you’ve written and have understood the question better. I’m unsure why you’re storing the URL in an array (unless you plan to allow them to enter multiple arrays).

    If so, you really don’t need a predefined, but to remove it you can do the following in the clickedButtonAtIndex method:

    [self.feeds removeAllObjects];
    [self.feeds addObject:textfield.text];
    

    That should remove your predefined string and add the new one.

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

Sidebar

Related Questions

I have been working on Eclipse recently. I am fairly new to java programming,
There has to be a easy solution to this. I have been trying to
I been working in a new game, and finally reached the point where I
I have a feeling this is easy but, I've been working on it for
I have been new to the PHP development area and I am working on
I have been recently working on an easy to use Syntax Highlighting system for
Have been working on this question for a couple hours and have come close
I have been working on a Windows Mobile app for a little while now
I have been working on keeping things object oriented for my project. Currently, I'm
I have been working on this problem for 2 days now and it's an

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.