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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:51:42+00:00 2026-05-28T22:51:42+00:00

I think the question is clear enough but still – what’s the difference between:

  • 0

I think the question is clear enough but still – what’s the difference between:

NSString *string = @"Hello world!";

and

NSString *string = [[NSString alloc] initWithString:@"Hello world!"];

Let me know if this already answers it.

  • 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-28T22:51:43+00:00Added an answer on May 28, 2026 at 10:51 pm
    NSString *string = [[NSString alloc] initWithString:@"Hello world!"];
    

    Per cocoa as cocoa naming convention, You create an object using a method whose name begins with “alloc”, “new”, “copy”, or “mutableCopy”. That means you own the string above, hence you’re responsible to release the object.

    NSString *string = @"Hello World";
    

    The line above is a string literal / constant, you don’t alloc it or release it. You don’t own this object.

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

Sidebar

Related Questions

I think my question is clear enough, but I explain more. Simply, when we
I think my question is already clear enough, but to make it even more
I think the question title is clear enough: is is possible to stable_sort() a
I think my question is somewhat similar to CaptainPicard's but dissimilar enough that I
I think the question is clear enough. Some of the columns in my datawarehouse
I think the question is clear enough. Will the auto keyword auto-detect const-ness, or
Update I don't think I was clear enough when I originally posted this quesion.
I think the question is a bit silly, but for a newbie startup building
I hope I can make this question clear enough. I'm looking to put a
it's a dumb question i think..But.. When a declare a child class of a

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.