我在这里有一些问题..我正在使用以下代码在我的应用程序中生成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
对象.现在我想将生成的存储UUID
为unsigned int
.有什么建议请问我怎么能在这里做.谢谢.
我保存了这样的字符串..
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)