• 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: NSCalenderDate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCalenderDate


  • Subject: Re: NSCalenderDate
  • From: Hasan Diwan <email@hidden>
  • Date: Tue, 25 May 2004 08:32:38 -0700

Nilesh:
Create your actionbutton in Interface Builder. Have an action
method reading something like this:
- (IBAction)dateDocument:(id)sender {
NSMutableString *documentContents = [[textView string] mutableCopy];
NSCalendarDate *today = [NSCalendarDate date];
NSString *dateAsString = [today
descriptionUsingCalendarFormat:@"\n%d-%m-%y"]; // insert a new line
before the date
[documentContents appendString:dateAsString];
[textView setString:documentContents];
[documentContents autorelease];
}
Feel free to email me if you should encounter problems -- cheers!
On May 25, 2004, at 6:39 AM, Patel, Nilesh M wrote:

> I am new to cocoa and have developed a texteditor and was wondering if
> there is a way where I can enter the date/time (NSCalenderDate) after
> I am done typing a letter, memo, note, etc. I was thinking about
> setting it up as an Action button? if so how?
Hasan Diwan {http://ibn.com/~hdiwan}
OpenPGP Fingerprint: 275D 0E84 550C D92A 4A56 732C 8528 2579 E6E9 4842

[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.


References: 
 >NSCalenderDate (From: "Patel, Nilesh M" <email@hidden>)

  • Prev by Date: Re: why are floats flakey?
  • Next by Date: Re: NSCalenderDate (Patel, Nilesh M)
  • Previous by thread: NSCalenderDate
  • Next by thread: Re: NSCalenderDate (Patel, Nilesh M)
  • Index(es):
    • Date
    • Thread