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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:56:49+00:00 2026-05-25T18:56:49+00:00

Is it okay to do [BNUtilitiesQuick searchController].searchList.text not in main thread? for example? I’ve

  • 0

Is it okay to do

[BNUtilitiesQuick searchController].searchList.text not in main thread? for example?

I’ve heardNSString * is threadSafe. However,

what about when I perform

NSString * searchTerm =[BNUtilitiesQuick searchController].searchList.text;

the [BNUtilitiesQuick searchController].searchList.text change to another string?

  • 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-25T18:56:50+00:00Added an answer on May 25, 2026 at 6:56 pm

    You’re main concern here in a multithreaded environment is that the objects referenced don’t get released while you’re attempted to read them.

    Assuming you’re using custom classes with synthesized properties, as stated in the Objective-C doc on declaring properties, properties are declared atomic by default. The synthesized code will be similar to the following:

    [_internal lock]; // lock using an object-level lock
    id result = [[value retain] autorelease];
    [_internal unlock];
    return result;
    

    This, more or less, let’s you use the returned object without worry of it being released on you. So, if you don’t declare your properties as nonatomic, you should be OK as far as protecting against crashes due to improper memory management.

    If these are not custom classes, you may want to check the class’s documentation to determine how the properties have been declared.

    Data integrity, however, is a different concern. Even if all the properties specified in your line of code are declared atomic, that doesn’t guarantee that all threads will see the same values at all times. So, yes, the value of text may change while a thread gets its value the way you’ve described. The easiest solution is read/write mutable data from the same thread.

    And, yes, NSString is generally thread-safe as it is immutable.

    You may wish to review Apple’s thread programming guide for more information.

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

Sidebar

Related Questions

Okay I do apologise that I'm out of my depth here. I'm not the
Okay here is my url: http://example.com/home/process_login I would like to replace the underscore with
Okay so I have a simple HTML Input fragment: <input id=txtFirstName type=text class=txtBox runat=server
Okay, I have hundreds of .net controls with text attributes that needs to be
Okay, so I've known about this for like 600 years now, but I've only
Okay i know i have to use the JDBC etc, but im not sure
Okay, I'm reading about Linux kernel development and there are some code snippets using
Okay i have this problem with every page i make. im not sure what
Okay, so I'm trying to set a variable via a javascript method call. However
Okay, URL Routing is great. Extensionless URLS, SEO friendly etc. However, it seems that

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.