我正在开发一个使用xib文件的iOS应用程序.
通常我使用Storyboard和I don't know how to set up a UITableViewCell with xib files.当我用UITableView创建一个xib文件时,我看到一个带有一些行的表,现在我需要编辑这一行来写出我存储在数组中的内容.
如何使用xib文件设计UITableViewCell?
我需要做一个非常简单的表:我将使用单元格的Basic预设来显示标题.我知道我要将委托和DataSource连接到表视图的文件所有者,并且我在文件所有者中放入了UITableViewDelegate和UITableViewDataSource.
现在我如何编辑单元格的内容? 我在网上找到一些指南,告诉我用UITableViewCell创建一个xib文件,我做了,但我不知道如何使用它
我要解析我的iOS应用程序的Html.我在网上看到我应该使用Xpath,我找到了库TFHpple.我看到这个库使用了XpathQuery
<!DOCTYPE "html">
<html>
<head>
<meta property="og:site_name" content="Sito 4"/>
<meta property="og:title" content="home"/>
<meta name="viewport" content="width=320" />
<meta name="keywords" content="mobile website,microsite, mobdis,iphone,android" />
<meta name="description" content="Amazingly designed using MobDis.com" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="format-detection" content="telephone=no" />
<title>Sito 4/home</title>
<!--[if (!IE)|(gte IE 8)]><!-->
<link href="http://cdn2.mobdis.me/assets/publish-3.4-datauri.css" media="screen" rel="stylesheet" type="text/css" />
<!--<![endif]-->
<!--[if lte IE 7]>
<link href="http://cdn2.mobdis.me/assets/publish-3.4.css" media="screen" rel="stylesheet" type="text/css" />
<![endif]-->
<script type="text/javascript"></script>
<style type="text/css">
body{
background-color: black;
}
</style>
</head>
<body>
<div id='processingScreen' style="width:320px;height:417px;background-color:rgb(0, 0, 128)"><img alt="Publish_loading" src="http://cdn2.mobdis.me/pro_images/publish_loading.gif" …Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我需要从Objective C发送一个数组到javascript.我在网上看到我可以使用这条指令:stringByEvaluatingJavaScriptFromString我也是这样做的:
Objective C片段
NSMutableArray *names = [[NSMutableArray alloc]init];
NSMutableArray *srcs = [[NSMutableArray alloc]init];
for (int i = 0; i < [site count]; i++) {
NSDictionary *dictData = [site objectAtIndex:i];
[names addObject:[dictData objectForKey:@"name"]];
[srcs addObject:[dictData objectForKey:@"src"]];
}
// UPDATE
NSData *jsonArray = [self arrayToJson:nameSrc];
NSString *jsonString = [[NSString alloc]initWithData:jsonArray encoding:NSUTF8StringEncoding];
NSString *econdedString = [self base64String:jsonString];
NSString *jsCall = [NSString stringWithFormat:@"dataFromObjC(\"%@\")", econdedString];
[self.webView stringByEvaluatingJavaScriptFromString:jsCall];
Run Code Online (Sandbox Code Playgroud)
所以在javascript中我创建了一个具有此名称的函数dataFromObjC(names, srcs),但它没有向我显示我发出的警报.我将在这里发布我的HTML的完整代码,以便您可以帮我解决这个问题.
HTML代码
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8" />
<meta name="viewport" …Run Code Online (Sandbox Code Playgroud) 我正在尝试解析位于计算机上的JSON文件.我想解析它.JSON文件具有以下结构:
{
"sites": {
"site": [
{
"id": "01",
"name": "Sito 1",
"src": "localhost/root/coupon/sito1",
"expiryDate": "29 Ago 2013"
},
{
"id": "02",
"name": "Sito 2",
"src": "localhost/root/coupon/sito2",
"expiryDate": "30 Ago 2013"
},
{
"id": "Sito 3",
"name": "Sito 3",
"src": "localhost/root/coupon/sito2",
"expiryDate": "31 Ago 2013"
}
]
}
}
Run Code Online (Sandbox Code Playgroud)
在我的html中,我导入了jQuery库,我创建了一个在加载页面时加载的函数.代码如下:
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<title>Lista coupon</title>
<script type="text/javascript" src="jquery-1.9.1.min.js"></script>
<script type="text/javascript" charset="utf-8">
function loadJson() {
window.alert("Carico il contenuto del file …Run Code Online (Sandbox Code Playgroud) 我想删除页面顶部的边距.我将通过屏幕截图向您展示我的意思
你可以在我的照片中看到一个红色箭头表示我的问题.我怎么能删除这个保证金?我在这里发布我的CSS:
div#header {
background-color: #6495ED;
background: -moz-linear-gradient(100% 100% 90deg, black, gray);
background: -webkit-gradient(linear, center top, center bottom, from(gray), to(black));
margin: 0px;
width: 100%;
}
body {
background-color: #000000;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
h1 {
text-align: center;
color: #FFFFFF;
font-family: sans-serif;
font-size: 26px;
font-weight: bold;
padding: 5px;
}
ul {
list-style-type: none;
padding: 5px;
}
li {
color: #FFFFFF;
font-family: sans-serif;
}
p {
color: #FFFFFF;
font-family: sans-serif;
padding: 5px;
}
a {
text-decoration: none; …Run Code Online (Sandbox Code Playgroud) objective-c ×3
ios ×2
javascript ×2
cocoa-touch ×1
css ×1
css3 ×1
html ×1
html-parsing ×1
html5 ×1
jquery ×1
json ×1
margin ×1
parsing ×1
tfhpple ×1
uitableview ×1
uiwebview ×1
xpath ×1