当前位置:主页 > 开发频道 > 新手教学 > 起步教学 >

生成随机guid串的代码

时间: 2010-07-13 15:43 点击:

代码由 CocoaChina 会员garnett2183分享 + (NSString*) stringWithUUID { CFUUIDRefuuidObj = CFUUIDCreate(nil);//create a new UUID //get the string representation of the UUID NSString*uuidString = (NSString*)CFUUIDCreateString(nil, uuidOb

  代码由 CocoaChina 会员“garnett2183”分享


  1. + (NSString*) stringWithUUID {
  2.    CFUUIDRef    uuidObj = CFUUIDCreate(nil);//create a new UUID
  3.    //get the string representation of the UUID
  4.    NSString    *uuidString = (NSString*)CFUUIDCreateString(nil, uuidObj);
  5.    CFRelease(uuidObj);
  6.    return [uuidString autorelease];
  7. }

顶一下(0)

0%

踩一下(0)

0%

发表评论

评价: 中立 好评 差评 请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。

表情:

论坛新帖 进入论坛...