• 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: Newbie probably not retaining himself to well... (off list)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Newbie probably not retaining himself to well... (off list)


  • Subject: Re: Newbie probably not retaining himself to well... (off list)
  • From: Alexander Griekspoor <email@hidden>
  • Date: Thu, 20 Jun 2002 10:13:41 +0200

>> -----Original Message-----
>> From: Alexander Griekspoor [mailto:email@hidden]
>>
>> Aha, that makes sense... So I changed:
>>
>>>> if([startdate minuteOfHour] < 10){
>>>> starttime = [NSString stringWithFormat: @"%d:0%d",
>>>> [startdate hourOfDay], [startdate minuteOfHour]];
>>>> }
>>
>>
>> into:
>>
>> 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...
>>
>
> starttime = [NSString stringWithFormat: @"%d:d",
> [startdate hourOfDay], [startdate minuteOfHour]];
>
> See man 3 printf for details. (Pad with zeros - minimum width 2)
>
> No need for if statements.
>
> Carl Gherardi
>

Thanks!!! I would almost send all my code line by line to this list,
kiddin'!

Seems like three hours of thinking and trying to solve the missing string
stuff is solved in one minute, but no worries, as a newbie I'll keep on
trying 3 hours on my next big problem before posting it here...

Alex
_______________________________________________
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: Re: [Q] large flat files usage
  • Next by Date: Re: QTMovie->PICT->NSImage Performance
  • Previous by thread: Re: Help with closing Sheets
  • Next by thread: Re: QTMovie->PICT->NSImage Performance
  • Index(es):
    • Date
    • Thread