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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:04:00+00:00 2026-06-01T01:04:00+00:00

I’m have a weird issue here. I have a UITableView using custom UITableViewCells. Everything

  • 0

I’m have a weird issue here. I have a UITableView using custom UITableViewCells. Everything is working as expected except this on particular issue.

Here’s the scenario:

I need to remove the “$” symbol in a UITextField right before editing begins. This is done via the textFieldShouldBeginEditing: method.

- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
    LifeEarningsLineItemTableViewCell *cell = (LifeEarningsLineItemTableViewCell *)[self tableViewCellContainingObject:textField inTableView:self.lifeEarningsTableView];
    if (textField == cell.itemAmount) {
        /*Remove currency symbol for editing.*/
        NSString *currencySymbol = [self.currencyFormatter currencySymbol];
        NSMutableString *mutableText = [NSMutableString stringWithString:textField.text];
        [mutableText replaceOccurrencesOfString:currencySymbol withString:@"" options:NSCaseInsensitiveSearch range:NSMakeRange(0, [mutableText length])];
        textField.text = mutableText;
    }

    return YES;
}  

Here’s the problem:

  • Between different rows, moving from textField1 to textField2 (in a different row), the “$” is removed, this is GOOD.
  • Within the same row, moving from textField1 to textField2, the “$” is not removed, this is BAD.

Why is the “$” not being removed within the same row, but does in different rows?

Here’s is a visual representation of the issue: Issue

[EDIT…ADDITION]
I get these logs with these flows:

Flow1
SHOULD BEGIN…..Row:0, Tag:0
SHOULD BEGIN…..Row:0, Tag:1
DID END…..Row:0, Tag:0
DID END…..Row:0, Tag:1

Flow2
SHOULD BEGIN…..Row:0, Tag:0
SHOULD BEGIN…..Row:1, Tag:1
DID END…..Row:0, Tag:0
DID END…..Row:1, Tag:1

Also, here is the tableViewCellContainingObject:inTableView:tableView method:

- (UITableViewCell *)tableViewCellContainingObject:(UIView *)view inTableView:(UITableView *)tableView {
    CGPoint objectRectInTableViewCoordinates = [tableView convertPoint:view.bounds.origin fromView:view];
    NSIndexPath *cellIndexPath = [tableView indexPathForRowAtPoint:objectRectInTableViewCoordinates];
    return [tableView cellForRowAtIndexPath:cellIndexPath];
}

And the textFieldDidEndEditing method:

- (void)textFieldDidEndEditing:(UITextField *)textField {
    LifeEarningsLineItemTableViewCell *cell = (LifeEarningsLineItemTableViewCell *)[self tableViewCellContainingObject:textField inTableView:self.lifeEarningsTableView];
    LifeEarningsLineItem *lifeEarningsLineItem = [self.lifeEarningsFetchedResultsController objectAtIndexPath:[self.lifeEarningsTableView indexPathForCell:cell]];

    if (textField == cell.itemAmount) {
        NSNumber *absInteger = [NSNumber numberWithInteger:abs([textField.text integerValue])];
        textField.text = [self.currencyFormatter stringFromNumber:absInteger];
        lifeEarningsLineItem.amount = absInteger;
        [self sumAmountsAndDisplay];
    } else if (textField == cell.itemName) {
        lifeEarningsLineItem.name = textField.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-06-01T01:04:01+00:00Added an answer on June 1, 2026 at 1:04 am

    I think your solution (decoupling the FRC during editing) may be a little drastic and could have unforeseen effects. Here are a couple of alternative suggestions. I am assuming the problem is caused by the table reloading the row you are editing once you have finished editing the first field in the cell.

    • Don’t store the currency symbol in your model, add it to the displayed text in cellForRowAtIndexPath, if the text field is not editing. When your textfield begins editing, set its text to the value directly from the model. You don’t have to do anything in end editing since the reload will add the currency symbol back on for you.
    • If you dont want to change the model, you can do something similar anyway – in cellForRowAtIndexPath remove the currency symbol if the cell is editing.
    • Store the index path of the currently editing row and conditionally ignore changes to this row in the FRC delegate method.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I have some data like this: 1 2 3 4 5 9 2 6
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) 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.