Pet*_*ong 10 objective-c xcode4
我试图将CFUUIDRef转换为NSString*.
之前,我使用了以下代码,并且工作正常.
CFStringRef str = CFUUIDCreateString(NULL, _uuid); # _uuid is of type CFUUIDRef
return (__bridge NSString *) str;
Run Code Online (Sandbox Code Playgroud)
但是,在最近更新Xcode(或其他我没注意到的事情?)之后,上面的代码给了我错误:
使用未声明的标识符'__bridge'
我做错了什么?我该怎么解决?
===更新===
完整代码:
+ (NSString *)uuidToString:(CFUUIDRef)_uuid {
CFStringRef str = CFUUIDCreateString(NULL, _uuid); # _uuid is of type CFUUIDRef
return (__bridge NSString *) str;
}
Run Code Online (Sandbox Code Playgroud)
uuid由以下生成:
uuid = CFUUIDCreate(NULL);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
15801 次 |
| 最近记录: |