• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Performance, Efficiency - Coding practice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Performance, Efficiency - Coding practice


  • Subject: Re: Performance, Efficiency - Coding practice
  • From: Graham Cox <email@hidden>
  • Date: Fri, 29 May 2009 10:48:24 +1000


On 29/05/2009, at 10:42 AM, John Ku wrote:

NSMutableString *title = [[NSString alloc] init];
[title setString: @"test"];

That would be correct and safe?


Yes, but pointless.

If the string is a constant, use a constant.

NSString* string = @"whatever";



--Graham


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Performance, Efficiency - Coding practice
      • From: Andrew Farmer <email@hidden>
References: 
 >Performance, Efficiency - Coding practice (From: John Ku <email@hidden>)
 >Re: Performance, Efficiency - Coding practice (From: Kyle Sluder <email@hidden>)
 >Re: Performance, Efficiency - Coding practice (From: John Ku <email@hidden>)

  • Prev by Date: Re: Performance, Efficiency - Coding practice
  • Next by Date: Re: Performance, Efficiency - Coding practice
  • Previous by thread: Re: Performance, Efficiency - Coding practice
  • Next by thread: Re: Performance, Efficiency - Coding practice
  • Index(es):
    • Date
    • Thread