我有3个视图通过使用for循环动态创建.在那我称为旋转动画的下面的方法
- (void)runRightSpinAnimationOnView:(UIView*)view duration:(CGFloat)duration rotations: (CGFloat)rotations repeat:(float)repeat;
{
CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
rotationAnimation.fromValue = [NSNumber numberWithFloat:0];
rotationAnimation.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
//rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 /* full rotation*/ * rotations * duration ];
rotationAnimation.duration = duration;
//rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = repeat;
[view.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
}
Run Code Online (Sandbox Code Playgroud)
如何在触摸开始视图中停止旋转动画?...我尝试了以下编码触摸开始方法,但它没有工作
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *touch = [touches anyObject];
int viewTag=[touch view].tag;
UIView *myView =(UIView *)[self.view viewWithTag:viewTag];
[myView.layer removeAllAnimations];
}
Run Code Online (Sandbox Code Playgroud)
请帮我...
我想在Instagram上分享文字/照片/视频.我正在搜索这个很长一段时间,但我没有得到任何适当的文件.如果有人知道在Instagram上分享请告诉我.
当我点击"恢复"按钮点击(AdHoc版本)时,我的应用程序崩溃,但同样的应用程序在调试模式下工作正常.我的代码:
[[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
Run Code Online (Sandbox Code Playgroud)
崩溃报告:
Nov 6 23:19:04 LHD-iPod5 backupd[1815] <Warning>: INFO: Account changed (enabled=0, accountID=(null))
Nov 6 23:19:04 LHD-iPod5 kernel[0] <Debug>: AppleKeyStore: operation failed (pid: 1815 sel: 23 ret: e00002f0)
Nov 6 23:19:04 LHD-iPod5 profiled[1816] <Notice>: (Note ) profiled: Service starting...
Nov 6 23:19:04 LHD-iPod5 itunesstored[90] <Warning>: Could not load library [22]
Nov 6 23:19:04 LHD-iPod5 securityd[78] <Error>: CFPropertyListReadFromFile file file:///Library/Keychains/accountStatus.plist: The operation couldn’t be completed. (Cocoa error 260.)
Nov 6 23:19:04 LHD-iPod5 securityd[78] <Notice>: item SecDbItemDoUpdate replaced O,genp,EEF8647C,L,cku,apple,1272,acct,svce,v_Data,20131106174027.105945Z,F7768B61 …Run Code Online (Sandbox Code Playgroud) 我使用的是cocos2d v0.99.5,iOS部署目标是5.0
当我在iOS-7.0/5.0模拟器中使用Xcode 5.0运行我的应用程序时它工作正常.我在iOS-6.1/6.0模拟器中使用Xcode 5.0运行不起作用.我用断点检查,它崩溃在下面的代码:
CCLabelTTF *mainGameTitle = [[CCLabelTTF alloc] initWithString:@"REGULAR PACK" dimensions:CGSizeMake(40, 50) alignment:UITextAlignmentLeft fontName:@"Arial Rounded MT Bold" fontSize:20];
Run Code Online (Sandbox Code Playgroud)
它显示如下:

我写的时候:
CCLOG(@"font names ====> %@",[UIFont familyNames]);
Run Code Online (Sandbox Code Playgroud)
在此行中,iOS-6.0和6.1中也出现"EXC_BAD_ACCESS"错误.
我试过CCMenuItemFont,这个也显示了上面的崩溃.
它工作在7.0和5.0模拟器/设备.这是什么问题?请帮我?
编辑:
我尝试了另一种方法,即
CCLabelTTF *mainGameTitle = [CCLabelTTF labelWithString:@"REGULAR PACK" fontName:@"Arial Rounded MT Bold" fontSize:20];
Run Code Online (Sandbox Code Playgroud)
我再次在labelWithString:fontName:fontSize方法中遇到UIFont问题.
我有这样的dict formate.我需要在字典的dict键中使用"quantity1"键对数组进行排序.
array: (
{
brand = Ryul;
productTitle = Any;
quantity = 1;
subBrand = "Ryul INJ";
type = Product;
dict = {
brand1 = Trol;
productTitle1 = Different;
quantity1 = 2;
subBrand1 = "";
type1 = Brand;
};
},
{
brand = Trol;
productTitle = Different;
quantity = 2;
subBrand = "";
type = Brand;
dict = {
brand1 = Trol;
productTitle1 = Different;
quantity1 = 2;
subBrand1 = "";
type1 = Brand;
};
}
)
Run Code Online (Sandbox Code Playgroud)
我用这个代码进行排序:
NSSortDescriptor …Run Code Online (Sandbox Code Playgroud)