• 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: John Ku <email@hidden>
  • Date: Thu, 28 May 2009 17:55:50 -0700

Yeah sorry everyone, in the original example i am using a constant.My
working app is actually using a mutable string. So I've got both mixed up.

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

*hits myself in the head* Im not processing correctly today..

Thanks,
John

On Thu, May 28, 2009 at 5:50 PM, Shawn Erickson <email@hidden> wrote:

> On Thu, May 28, 2009 at 5:42 PM, John Ku <email@hidden> wrote:
> > Thank you all for the explanation. After reading over and experiment, I
> kind
> > of get what you all are saying.I've probably confused myself too much
> with
> > the dot syntax to use title = @"fdsfd".
> >
> > So if i have:
> >
> > NSMutableString *title = [[NSString alloc] init];
> > [title setString: @"test"];
> >
> > That would be correct and safe?
>
> Assuming you meant [[NSMutableString alloc] init] and someplace later
> release it... then yes but why?
>
> Do you want a mutable string or just @"test"?
>
> If you are always going to draw the string "test" you can simply do
> the following...
>
> [@"test" drawAtPoint:origin withAttributes:nil];
>
> -Shawn
>
_______________________________________________

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: Alexander Spohr <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>)

  • 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