From ed0e2e03219746667d71b9cccc72c2958bdd4d12 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 24 Jun 2010 09:15:42 +0000 Subject: =?UTF-8?q?=E2=80=A2=20further=20progress=20to=20support=20"Save?= =?UTF-8?q?=20Session"=20(all=20opened=20windows=20plus=20including=20tabs?= =?UTF-8?q?=20connections)=20-=20loop=20through=20all=20windows=20and=20fo?= =?UTF-8?q?r=20each=20window=20through=20all=20tabs=20and=20save=20all=20u?= =?UTF-8?q?ntitled=20doc=20within=20the=20bundle=20named=20via=20UUIDs=20a?= =?UTF-8?q?nd=20all=20opened=20spf=20files=20=E2=80=A2=20added=20the=20SPS?= =?UTF-8?q?tringAddition=20method=20+[NSString=20stringWithNewUUID]=20whic?= =?UTF-8?q?h=20returns=20a=20new=20UUID=20string?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPStringAdditions.m | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Source/SPStringAdditions.m') diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m index de1fdf5e..fc8326e7 100644 --- a/Source/SPStringAdditions.m +++ b/Source/SPStringAdditions.m @@ -142,6 +142,20 @@ return [numberFormatter stringFromNumber:[NSNumber numberWithDouble:timeInterval]]; } +/** + * Returns a new created UUID string. + */ ++ (NSString*)stringWithNewUUID +{ + // Create a new UUID + CFUUIDRef uuidObj = CFUUIDCreate(nil); + + // Get the string representation of the UUID + NSString *newUUID = (NSString*)CFUUIDCreateString(nil, uuidObj); + CFRelease(uuidObj); + return [newUUID autorelease]; +} + /** * Escapes HTML special characters. */ -- cgit v1.2.3