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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:25:17+00:00 2026-06-13T23:25:17+00:00

I’m in the process of learning Objective-C. And I have such an academical question

  • 0

I’m in the process of learning Objective-C. And I have such an “academical” question which is addressed to Objective-C experts with good knowledge of modern C++ (C++11).

In C++11 I often used move semantics (using references to temporary objects we can avoid unnecessary copies):
What are move semantics?
http://www.cprogramming.com/c++11/rvalue-references-and-move-semantics-in-c++11.html

these links for objective-c coders not familiar with move semantics concept, and I’m interested does Objective-C has something similar or may be there are some ways to implement/emulate this?

  • 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-13T23:25:18+00:00Added an answer on June 13, 2026 at 11:25 pm

    does Objective-C has something similar or may be there are some ways to implement/emulate this?

    Nope. That’s not a huge issue, once you have digested the abstraction layer you are working at with Objective-C. Understand that objects are reference counted and are heap allocations.

    Now there are two ways you can take this:

    a) Use Objective-C++ — Just mix and match the language features to your content.

    b) Use idiomatic Objective-C. This goes back a long time. Once you accept that objects are reference counted heap allocations and there is no way around that (with clang), then you learn to approach programs differently. Sure, reference counting everything and putting it on the heap has costs, but you can take advantage of those traits in some scenarios. The most notable uses are the use of immutable objects and shallow copying. Copying a std::string as object is going to result in SSO copy or a heap allocation. Copying an NSString could simply return itself (after incrementing the reference count or not, depending on the type of string it is, it may also need to create a concrete copy at that point). As well, these objects are all just pointers, so you don’t need to actively be concerned with how to pass an object (value/reference/const reference/move). A far simpler model exists in ObjC, which can be exploited. So there is a shift in design here: there is less “value dominance” in ObjC and more of “favor immutability and sharing”.

    In some cases, you can write a move method. Since common framework classes do not support this, it typically makes more sense to use object composition.

    Since objects are allocated on the heap, moves are not so important. Well designed classes take costs into consideration to minimize huge/expensive copies, and internally use some interesting optimizations. The idiom just suggests that you should take a different approach to creating your classes — how do they share data? What is mutable? What must be copied? Sometimes, you might be dealing with big, mutable/expensive data and a move would be convenient, but you could often just place that in a shared container object or reconsider semantics of your objects’ initialization in order to minimize physical copying (and avoid odd semantics in object interfaces). Beyond that, I don’t see moves as being very useful all too often in pure Objective-C. Of course, they become important for C++ libraries which have been designed to make use of move semantics and are able to create objects in several memory locations. If you do move, you would usually want to keep that detail private or make it really obvious (e.g. I have done that in a rendering pipeline to minimize big allocations for each filter).

    Examples of where you think it would be beneficial would also help understand your problem/rationale.

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

Sidebar

Related Questions

I don't have much knowledge about the IPv6 protocol, so sorry if the question
This could be a duplicate question, but I have no idea what search terms
I have an autohotkey script which looks up a word in a bilingual dictionary
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.