• 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: Jean-Daniel Dupas <email@hidden>
  • Date: Fri, 29 May 2009 11:45:37 +0200


Le 29 mai 09 à 11:31, Alexander Spohr a écrit :


Am 29.05.2009 um 02:55 schrieb John Ku:

And yeah, NSMutableString will be initialized else where and released later.

Why use a mutable string at all? Just retain the new string and dump the old one.


Use
@property (retain) NSString *title;
@synthesize title;
and be done with it.

Copying it is even better as it will prevent strange side effect you can have if you affect a mutable string to the property (and it is a fast as retaining if you use immutable strings).


@property (copy) NSString *title;


_______________________________________________

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


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>)
 >Re: Performance, Efficiency - Coding practice (From: Shawn Erickson <email@hidden>)
 >Re: Performance, Efficiency - Coding practice (From: John Ku <email@hidden>)
 >Re: Performance, Efficiency - Coding practice (From: Alexander Spohr <email@hidden>)

  • Prev by Date: Re: Performance, Efficiency - Coding practice
  • Next by Date: [Core Data] mergeChangesFromContextDidSaveNotification: and thread safety
  • Previous by thread: Re: Performance, Efficiency - Coding practice
  • Next by thread: Re: Performance, Efficiency - Coding practice
  • Index(es):
    • Date
    • Thread