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

  • Home
  • SEARCH
  • 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 6033349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:28:13+00:00 2026-05-23T05:28:13+00:00

@property (nonatomic, retain) NSString *text; with this property I am saving text from a

  • 0
@property (nonatomic, retain) NSString *text;

with this property I am saving text from a textfield I create in a UITableViewCell

static NSString *cellIdentifier = @"fieldTableCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];

    UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 12, 275, 25)];
    textField.clearsOnBeginEditing = NO;
    textField.returnKeyType = UIReturnKeyDone;
    [textField addTarget:self action:@selector(textFieldDone:) forControlEvents:UIControlEventEditingDidEndOnExit];
    [cell.contentView addSubview:textField];
}

// re-get textField and set tag to section
if (section == 1) {
    textField.text = self.text; // Where the problem is
    textField.tag = section;
}

and

- (void)textFieldDone:(id)sender {
    UITextField *field = sender;

    if (field != nil) {
         NSInteger section = field.tag;

        if (section == 1) {
            self.text = field.text;
        }
    }
}

However, back in cellForRowAtIndexPath is setting textField.text back to the saved text. The problem is when it does this it is giving me

-[CFString _isNaturallyRTL]: message sent to deallocated instance
0x2c459ff0

when I look at self.text in cellForRowAtIndexPath in the debugger, it says it is NSZombie_NSString … so somehow it is getting dealloc’d. I have tried setting the property to copy, copying the string using [initWithString]… Why is the string getting dealloc’d?

  • 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-23T05:28:14+00:00Added an answer on May 23, 2026 at 5:28 am

    once bitten twice shy. Except, Ive already made this mistake.

    in my acctual code I had

    text = textField.text; //var declared in class
    

    But I meant

    self.text = textField.text; //to use the property like in my example
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to compare the following simple assignments: ... @property(nonatomic,retain) UITextField *textField; ... self.textField.text
NSString *statusValue; NSString *currentValue; @property(retain, nonatomic) NSString *statusValue; @property(retain, nonatomic) NSString *currentValue; @synthesize statusValue;
What does nonatomic mean in this code? @property(nonatomic, retain) UITextField *theUsersName; What is the
Do I have this right ... // Reactor.h @property(nonatomic, retain) NSMutableArray *reactorCore; // Reactor.m
I have an NSString declared as @property (nonatomic,copy) NSString *text in a class. When
I have 2 autogenerated entities : @interface ContactEntity : Entity @property (nonatomic, retain) NSString
DetailViewController.h @interface DetailViewController : UIViewController { NSInteger getInteger; NSNumber *getNumber; } @property (nonatomic, retain)
I've been reading that if I have something like this: @property (nonatomic, assign) UIView
This code works: monkey.h @interface monkey : NSObject { NSNumber *monkeyRanch; } @property (nonatomic,
I Create a class named DataClass there i have this method +(NSMutableArray*) returnList :(NSString

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.