• 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: cocoa-dev digest, Vol 2 #810 - 14 msgs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cocoa-dev digest, Vol 2 #810 - 14 msgs


  • Subject: Re: cocoa-dev digest, Vol 2 #810 - 14 msgs
  • From: Mel Walker <email@hidden>
  • Date: Thu, 20 Jun 2002 10:45:24 -0600

On Thursday, June 20, 2002, at 02:18 AM, cocoa-dev-
email@hidden wrote:

if([startdate minuteOfHour] < 10){
starttime = [[NSString alloc] initWithString: [NSString
stringWithFormat: @"%d:0%d",
[startdate hourOfDay], [startdate minuteOfHour]]];
}

With removal of the alloc/init of starttime in the init method.
If you have any suggestions on a better or more elegant way, please tell me,
but yes it works perfectly!!!! Thanks a lot. A happy newbie...

Try using

starttime = [[NSString alloc] initWithFormat:@"%d:0%d", [startdate hourOfDay], [startdate minuteOfHour]]

saves you a step, and an autorelease (from NSString stringWithFormat).
--
Mel Walker <email@hidden>
Software Engineer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Converting dfont files into "normal" TTF ones?
  • Next by Date: Re: Protecting Software w/ Software License Keys...
  • Previous by thread: Re: Converting dfont files into "normal" TTF ones?
  • Next by thread: Converting a NSString into a math opertation
  • Index(es):
    • Date
    • Thread