小编Had*_*adi的帖子

如何将UUID存储为int

我在这里有一些问题..我正在使用以下代码在我的应用程序中生成uuid.

    - (NSString *)GetUUID
{
    CFUUIDRef theUUID = CFUUIDCreate(NULL);
    CFStringRef string = CFUUIDCreateString(NULL, theUUID);
    CFRelease(theUUID);
    return [(NSString *)string autorelease];
}
Run Code Online (Sandbox Code Playgroud)

此代码返回一个NSString对象.现在我想将生成的存储UUIDunsigned int.有什么建议请问我怎么能在这里做.谢谢.

iphone uuid objective-c xcode4

4
推荐指数
2
解决办法
2390
查看次数

如何更改loadedHtml文本中的字体颜色

我保存了这样的字符串..

NSString *loadString = [NSString stringWithFormat:@"<html><body><font color=\"white\">%@</font></body></html>", string];
Run Code Online (Sandbox Code Playgroud)

现在我想在webview中加载此字符串

[webView loadHTMLString:loadString baseURL:nil];
Run Code Online (Sandbox Code Playgroud)

现在加载网页时,颜色默认为黑色.我想将颜色更改为白色,但我无法这样做.任何建议如何更改字体颜色.谢谢.

编辑1:我试过这个,但没有运气..

NSString *htmlString = [NSString stringWithFormat:@"<html><style type=\"text/css\"><!--.style1 { font-family: Arial;color: #FFFFFF;font-size: 20px;font-weight: bold;}--> <body><font class=\"style1\">%@</font></body></html>", string];
Run Code Online (Sandbox Code Playgroud)

这也..

NSString *htmlString = [NSString stringWithFormat:@"<html> \n""<head> \n""<style type=\"text/css\"> \n""body {font-family: \"%@\"; font-size: %@; color:#FFFFFF; }\n""</style> \n""</head> \n""<body>%@</body> \n""</html>", @"helvetica", [NSNumber numberWithInt:15], string];
Run Code Online (Sandbox Code Playgroud)

html xcode objective-c

1
推荐指数
2
解决办法
2401
查看次数

标签 统计

objective-c ×2

html ×1

iphone ×1

uuid ×1

xcode ×1

xcode4 ×1