我XMPPFramework在我的申请中使用.我在.m文件中导入了Cocoa/Cocoa.h.但是当我构建项目时Xcode显示错误.
错误:"找不到Cocoa/Cocoa.h文件".
我该如何解决这个错误?
我尝试构建时遇到此错误:
"重复符号__Z8ERRCHECK11FMOD_RESULT:
/Users/codemenmini2012-2/Library/Developer/Xcode/DerivedData/MagicSleepFullVersion-agxulkdijnxbqmbuigucmrczufyw/Build/Intermediates/MagicSleepFullVersion.build/Debug-iphonesimulator/MagicSleepFullVersion.build/Objects-normal/i386/MagicSleepViewController.o
/Users/codemenmini2012-2/Library/Developer/Xcode/DerivedData/MagicSleepFullVersion-agxulkdijnxbqmbuigucmrczufyw/Build/Intermediates/MagicSleepFullVersion.build/Debug-iphonesimulator/MagicSleepFullVersion.build/Objects-normal/i386/MagicSleepViewControllerIpad.o
Run Code Online (Sandbox Code Playgroud)
ld:1个用于体系结构i386 clang的重复符号:错误:链接器命令失败,退出代码为1(使用-v查看调用)
怎么解决这个家伙?
我有两个图像mosha1和mosha2.我通过UIView动画将它们从某个位置移动到另一个点(206,89).现在我希望如果用户在移动时触摸任何图像,那么该图像的移动将在那里停止.所以我设置了停止动画运动的代码:
[mosha1.layer removeAllAnimations];
Run Code Online (Sandbox Code Playgroud)
此方法调用会停止图像的移动,但是然后它会显示在点(206,89)中.但它应该出现在用户触摸的确切位置.怎么解决这个?
UIView动画方法:
-(void)moshaMoveUp: (UIImageView *)mosha {
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:3.0];
[UIView setAnimationDelay:0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDelegate:self];
mosha.center = CGPointMake(206, 89);
[UIView commitAnimations];
}
Run Code Online (Sandbox Code Playgroud) 我想将图像移动到某个位置.而且我还需要每秒检查图像的当前位置,无论该图像是否在该特定位置到达.所以,我做了以下事情:
-(void)viewWillAppear:(BOOL)animated{
[self moshaMoveUp:mosha1 with:206 and:89];
playerLifeCount = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(deductPlayerLife) userInfo:nil repeats:YES];
}
-(void)moshaMoveUp: (UIImageView *)mosha with:(int)x and:(int)y{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:7.0];
[UIView setAnimationDelay:0];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDelegate:self];
mosha.center = CGPointMake(x, y);
[UIView commitAnimations];
}
Run Code Online (Sandbox Code Playgroud)
但问题是当一开始调用'moshaMoveUp'方法时,图像的中心在那时被设置为(206,89).因此,每隔一秒我检查当前位置,它会显示我希望图像到达的位置的结果,而不是当前位置.即使图像尚未到达该位置.
-(void)deductPlayerLife{
NSLog(@"x : %f",mosha1.frame.origin.x);
NSLog(@"y : %f",mosha1.frame.origin.y);
}
Run Code Online (Sandbox Code Playgroud)
那么,如何在不停止图像移动的情况下每秒获得该图像的实际当前位置.