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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T15:14:44+00:00 2026-06-04T15:14:44+00:00

I have a xcode project in which i need to enter data on button

  • 0

I have a xcode project in which i need to enter data on button click and then display it in the TableView.

Example: Twitter (follow/unfollow).

1.I click on friend’s icon, a list of my friends appear.

2.When I click on any of my friends, their friends list appear in tableview with follow buttons corresponding to them (mutual friends have unfollow buttons).

3.Now, when I click on the follow button and go back to check my friend list, that particular friend has been added twice.

What I have done so far:

Checked if the sql db exist somewhere else as well.

Checked if the webservice is being called twice.

Everything’s fine. I have iMac and Macbook Pro as well and both of them have same issues.
I have reinstalled Xampp twice but still the same result.

For your reference, following is the php i am using for my Xcode project.

<?php
 $id =  $_REQUEST['id'];
 $fid = $_REQUEST['fId'];
 $firstName = $_REQUEST['firstName'];
 $lastName = $_REQUEST['lastName'];

 $con = mysql_connect("localhost","root","");
 if(!$con)
 die("Connection failed"."<br/>");

 $db = mysql_select_db("db",$con);
 if(!$db) die("Database not found!"."<br/>");

 $query = "INSERT INTO $id(firstName,lastName,folks_id)     VALUES('$firstName','$lastName','$fid')";
 print  $query;
 mysql_query($query,$con);
 mysql_close($con);

?>

EDIT: Xcode part for reference

-(IBAction)followButtonClicked:(UIButton *)sender
    {

  NSMutableString *postString = [NSMutableString stringWithString:kFollowURL];
    [postString appendString: [NSString stringWithFormat:@"?%@=%@", kId, [user objectForKey:@"id"] ]];
    [postString appendString: [NSString stringWithFormat:@"&%@=%@", kfId, [fId objectForKey:@"fID"] ]];
    [postString appendString: [NSString stringWithFormat:@"&%@=%@", kfirstName, [firstNameDict objectForKey:@"firstName"] ]];
    [postString appendString: [NSString stringWithFormat:@"&%@=%@", klastName, [lastNameDict objectForKey:@"lastName"] ]];
    [postString appendString: [NSString stringWithFormat:@"&%@=%@", kprofileType, [profileTypeDict objectForKey:@"profileType"] ]];

    [postString setString: [postString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    NSLog(@"post string = %@", postString);

    NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:postString]];

    [request setHTTPMethod:@"POST"];

    followConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];
    NSLog(@"postconnection: %@", followConnection);

    //Get JSON Response from server

    NSData *dataURL =  [NSData dataWithContentsOfURL: [ NSURL URLWithString: postString ]];    
    NSString *serverOutput = [[NSString alloc] initWithData:dataURL encoding: NSASCIIStringEncoding];

    NSLog(@"serverOutput = %@", serverOutput);

 } 
  • 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-04T15:14:46+00:00Added an answer on June 4, 2026 at 3:14 pm

    [SOLVED] The thing which did the trick was that i made fid as unique… so now whenever i click on the follow button, it is entered one and not twice.

    Thanx to all of you guys for the help and support.

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

Sidebar

Related Questions

Now I have a Xcode project which is built for iOS 5, but now
I have an old Xcode project which contains a CoreData model (containing a version
I have a VS2010 project which is a windows application that acquires data from
I have an Xcode project which builds a Cocoa desktop Browser application. My Browser
If I have a directory in my Xcode project (not a Group), which is
I have created a library which can download JSON data which is then placed
I have an Xcode project which basically loads and parses a xml file which
I have a problem with an Xcode project which has a path of /users/me/blah
In Objective-C xcode project I have a plist file with which associates integers with
I have a project which I have created in Xcode (starting with the command-line

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.