我正在制作教程,我正在尝试模仿Path教程的样式,如下所示:
http://www.appcoda.com/wp-content/uploads/2013/06/UIPageViewController-Tutorial-Screen.jpg

我的问题是,如果设置委托方法如此:
- (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController {
// The number of items reflected in the page indicator.
return 5;
}
Run Code Online (Sandbox Code Playgroud)
然后我在点下面得到这个愚蠢的黑条:
http://i.stack.imgur.com/pUEdh.png

有没有办法让这个酒吧半透明的方式类似于将UINavigationBar设置为半透明?
<script>
$(document).ready(function() {
var data = { "programs": [ { "name":"zonealarm", "price":"500" }, { "name":"kaspersky", "price":"200" } ] };
$.each(data.programs[0], function(key,val) {
alert(key+val);
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
此代码检索第一个数据.name:zonealarm和price:500.如何检索对象中的所有数据?我试过$.each(data.programs, function(key,val)但它没有奏效.我应该把它放在一个循环中吗?
我们如何实现3D触摸以检查用户是否点击UIView或强制触摸UIView?
有没有办法用UIGestureRecognize或仅用UITouch?
我试图在伪分布式模式下安装Hadoop 2.2.0.当我尝试启动datanode服务时,它显示以下错误,任何人都可以告诉如何解决这个问题?
**2**014-03-11 08:48:15,916 INFO org.apache.hadoop.hdfs.server.datanode.DataNode: Block pool <registering> (storage id unknown) service to localhost/127.0.0.1:9000 starting to offer service
2014-03-11 08:48:15,922 INFO org.apache.hadoop.ipc.Server: IPC Server Responder: starting
2014-03-11 08:48:15,922 INFO org.apache.hadoop.ipc.Server: IPC Server listener on 50020: starting
2014-03-11 08:48:16,406 INFO org.apache.hadoop.hdfs.server.common.Storage: Lock on /home/prassanna/usr/local/hadoop/yarn_data/hdfs/datanode/in_use.lock acquired by nodename 3627@prassanna-Studio-1558
2014-03-11 08:48:16,426 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for block pool Block pool BP-611836968-127.0.1.1-1394507838610 (storage id DS-1960076343-127.0.1.1-50010-1394127604582) service to localhost/127.0.0.1:9000
java.io.IOException: Incompatible clusterIDs in /home/prassanna/usr/local/hadoop/yarn_data/hdfs/datanode: namenode clusterID = CID-fb61aa70-4b15-470e-a1d0-12653e357a10; datanode clusterID = CID-8bf63244-0510-4db6-a949-8f74b50f2be9
at**** …Run Code Online (Sandbox Code Playgroud) 我有一个for循环,我正在循环.
我想制作一个自定义模态并在继续之前等待响应.
我怎样才能做到这一点?我知道我要等待回电.
像这个例子:
for(var x in array){
alert(x);
console.log(x);
}
Run Code Online (Sandbox Code Playgroud)
它完全符合我的要求.但我想要三个按钮.但警报不是javascript的一部分(?它在浏览器中.)
所以,你们有个主意吗?
我在考虑做这样的事情:
var run = true;
function foo(){
if (run){
setTimeout(foo, 500);
}
}
function stop(){
run = false;
}
foo();
Run Code Online (Sandbox Code Playgroud)
然后等待停止,在继续之前调用按钮单击.但这是非常好的做法吗?
或者使用lambda函数作为customAlert的参数和一个"全局"变量,该变量保存我正在经历的数组的当前位置并使用函数执行此操作.像:检查数组是否仍然保持大于X的键.然后再次执行该功能,每次增加全局X.
谢谢你输错代码:哦,我有个主意; 我只是在匿名函数中使用lostsource的解决方案,所以我不会得到全局变量.优秀.
(function(){
})();
Run Code Online (Sandbox Code Playgroud) ViewController有definesPresentationContext和 providesPresentationContextTransitionStyle,但没有它们是如何工作的想法.我看过WWDC2011,但我仍然对这两件事感到困惑.
任何人都可以解释一下,最好用简单的演示吗?
我想在我的iPad应用程序上获取一个SplitView,我的左侧菜单是纵向,如iPad设置.目前在纵向方向上,我有一个全屏内容视图,我在NavigationBar上有一个按钮,其中包含一个带有左侧菜单的弹出窗口.
不知怎的,git得到了它,我有一个未跟踪的文件(一个目录已经在我的存储库中已经有一段时间了,大约17个月).无论如何,我似乎无法说服git这不是一个未经跟踪的文件.此外,我无法重新添加有问题的文件.知道如何解决这个问题吗?
例:
? git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# rosetta_tests/profile/tests/docking/
nothing added to commit but untracked files present (use "git add" to track)
Run Code Online (Sandbox Code Playgroud)
我尝试添加目录并重新检查状态.
? git add rosetta_tests/profile/tests/docking/
? git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# rosetta_tests/profile/tests/docking/
nothing added to commit but untracked files present (use "git …Run Code Online (Sandbox Code Playgroud) 首先尝试使用集合视图并遇到此错误:
由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无法使类型的视图出列:具有标识符的UICollectionElementKindCellCell - 必须为标识符注册nib或类或在故事板中连接原型单元'
代码非常简单,如下所示.我不能为我的生活弄清楚我错过了什么.
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];
cell.backgroundColor = [UIColor whiteColor];
return cell;
}
Run Code Online (Sandbox Code Playgroud)
集合视图控制器是使用nib创建的,委托和数据源都设置为文件的所有者.
View Controller的头文件也非常基本.
@interface NewMobialViewController_3 : UICollectionViewController <UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
@end
Run Code Online (Sandbox Code Playgroud) gcc 4.4.4 c89
null终止字符串的标准方法是什么?当我使用时,NULL我收到一条警告信息.
*dest++ = 0;
*dest++ = '\0';
*dest++ = NULL; /* Warning: Assignment takes integer from pointer without a cast */
Run Code Online (Sandbox Code Playgroud)
源代码:
size_t s_strscpy(char *dest, const char *src, const size_t len)
{
/* Copy the contents from src to dest */
size_t i = 0;
for(i = 0; i < len; i++)
*dest++ = *src++;
/* Null terminate dest */
*dest++ = 0;
return i;
}
Run Code Online (Sandbox Code Playgroud)
另一个问题:我故意注释掉null终止的那一行.但是,它仍然正确地打印出dest的内容.此函数的调用者将通过包括NULL或不包括字符串的长度发送.即strlen(src) + 1或stlen(src). …