tags:

views:

38

answers:

1

when i copy the content in iphone the content is available in the pastebpard ,how do i get the time and date from the pasteboard

A: 

By putting a date and time on the pasteboard in the first place?


Your comment fills in some rather critical missing information. I suggest that you edit your question to include the missing information.

(1) if there is a date & time in what is copied, you'll need to detect it and parse it. How you do that is entirely dependent on what is being copied.

(2) If you want the date/time of when the pasteboard was taken, then you would want to look to the UIPasteboard's API. There isn't anything that captures the date of when a pasteboard was created, though.

Now, if you are looking to see if the pasteboard has changed since the last time you looked, use the [changeCount][2].

bbum
in a webpage when i select a content and hit on copy i also should get the date and time when i clicked copy
Pinky
If you want the date/time of when the pasteboard was taken, then you would want to look to the UIPasteboard's API. There isn't anything that captures the date of when a pasteboard was created, though.Now, if you are looking to see if the pasteboard has changed since the last time you looked, use the [changeCount][2]. where to make use of this // create a pasteboard and read the last copied content UIPasteboard* generalPasteboard = [UIPasteboard generalPasteboard]; ClipboardText= generalPasteboard.string; now where should i include this [changecont][2];
Pinky
Wherever you need it to do whatever it is you are trying to do. The changeCount (a) changes whenever the contents of the pasteboard changes and (b) resets at boot. What you do with that value defined by those simple rules is entirely determined by your requirements.
bbum
you are asking me to keep a variable and keep a flag settings if it is increased then different content else same content
Pinky