我正在尝试将git子模块添加到我的项目中,特别是ShareKit.我的项目是一个git repo,当我尝试输入时
git submodule add git://github.com/ShareKit/ShareKit.git Submodules/ShareKit
Run Code Online (Sandbox Code Playgroud)
进入终端我得到一个错误,说子模块已经存在.我想我刚刚在这个项目中添加了它,并最终没有使用它并且不正确地从项目目录中删除它(最有可能删除子模块文件夹).所以我尝试着做
git rm --cached Submodules/ShareKit
Run Code Online (Sandbox Code Playgroud)
根据如何删除子模块?,现在当我尝试使用第一段代码再次添加子模块时,我得到了这个:
A git directory for 'Submodules/ShareKit' is found locally with remote(s):
origin git://github.com/ShareKit/ShareKit.git
If you want to reuse this local git directory instead of cloning again from
git://github.com/ShareKit/ShareKit.git
use the '--force' option. If the local git directory is not the correct repo
or you are unsure what this means choose another name with the '--name' option.
Run Code Online (Sandbox Code Playgroud)
而且我不确定该怎么做.我对git很新,我需要在我的项目中得到这个 - 有没有办法只是擦除项目中的所有git并从头开始?我只是用一个新项目做到这一点,但除此之外它已经非常完整,从头开始并将所有内容复制完毕将非常耗时.我让ShareKit在测试应用程序中工作,安装正确,有什么理由我不能将该文件夹中的所有ShareKit文件复制到我需要的文件夹中吗?
编辑:我试过了
git submodule deinit Submodules/ShareKit
Run Code Online (Sandbox Code Playgroud)
这给了我这个错误:
error: …Run Code Online (Sandbox Code Playgroud) 有人给我发了一个项目文件夹,因为我受雇来帮助处理它。该项目运行和编译最终没有任何问题,但当我尝试运行它时遇到问题。当我打开工作区时,xcodeproj 文件是红色的,并且其下没有出现任何关联的项目文件 - Pods 项目和所有 pod 文件都正确显示。这些文件肯定在文件夹中 - 我可以打开 xcodeproj 并且它的所有文件都正确显示在那里。查看文件检查器,Pods 项目文件路径似乎指向我的计算机上的正确位置,但主项目文件路径指向将其发送给我的人的计算机上的位置。如果我单击旁边的文件夹图标并将文件路径更改为计算机上的正确位置,它不再是红色,但它仍然无法正确加载,并且其余的项目文件仍然不存在。
我有几个动画块,所有动画块都遵循这种基本格式,具有不同的延迟,以便它们一个接一个地触发:
[UIView animateWithDuration:.85 delay:3 options:opts animations:[animations objectAtIndex:ww] completion:[completions objectAtIndex:ww]];
Run Code Online (Sandbox Code Playgroud)
选项只是UIViewAnimationOptionAutoreverse一个变量,便于访问.
我希望在动画和完成之间有一个延迟,以便图像在返回到原始图像之前保持一点点位置.我考虑使用几个更简单的animateWithDuration:animations:块,但我没有看到任何方法来做文档中的延迟,除非我遗漏了一些东西.
@ Paul.s这里是我用你给我的代码:
void (^completion)(void) = ^{
[UIView animateWithDuration:.5
delay:5
options:UIViewAnimationCurveLinear
animations:[completions objectAtIndex:ww]
completion:^(BOOL finished) {}];
};
// Call your existing animation with the new completion block
[UIView animateWithDuration:.5
delay:1
options:UIViewAnimationCurveLinear
animations:[animations objectAtIndex:ww]
completion:^(BOOL finished) {
completion();
}];
Run Code Online (Sandbox Code Playgroud)
作为参考,动画非常简单,只需将图像从一个点移动到另一个点然后再移回.它崩溃的点[UIView animateWithDuration:.5是定义完成块的行,它在动画的第一部分运行后崩溃.
我正在搞乱Core Animation试图让它工作,而且我很确定我做的一切都正确但是当我试图运行我的程序时,Xcode向我抛出了这些奇怪的错误:
体系结构i386的未定义符号:"_ OBJC_CLASS _ $ _ CALayer",引自:ViewController.o中的objc-class-ref"_OBJC_CLASS _ $ _ CABasicAnimation",引用自:ViewController.o中的objc-class-ref ld:未找到符号对于架构i386 collect2:ld返回1退出状态
我不知道这是什么意思.我将QuartzCore框架导入适当的视图控制器,这是我用于动画的代码:
UIImage *image01 = [UIImage imageNamed:@"image.png"];
imageView = [[UIImageView alloc] initWithImage:image01];
imageView.frame = CGRectMake(455, 150, 150, 150);
CALayer *imageLayer = [CALayer layer];
imageLayer.bounds = imageView.frame;
imageLayer.contents = imageView;
[view.layer addSublayer:imageLayer];
CGFloat imageXAtStart = imageLayer.position.x;
imageLayer.position = CGPointMake(335, 150);
CABasicAnimation *imageAnimation = [CABasicAnimation animationWithKeyPath:@"position.x"];
imageAnimation.fromValue = [NSNumber numberWithFloat:imageXAtStart];
imageAnimation.toValue = [NSNumber numberWithFloat:335];
imageAnimation.duration = 3;
imageAnimation.beginTime = 2;
[imageLayer addAnimation:imageAnimation forKey:@"position"];
Run Code Online (Sandbox Code Playgroud)
如果重要,动画只是将图像/图层从一个x值移动到另一个x值.