小编Abh*_*sad的帖子

在mac bash终端中使用shell命令时出现"非法字节序列"错误

尝试从MacOS bash shell中的大文件中提取非英语字符时出现"非法字节序列"错误.这是我尝试使用的脚本:

sed 's/[][a-z,0-9,A-Z,!@#\$%^&*(){}":/_-|. -][\;''=?]*//g' < $1 >Abhineet_extract1.txt;
sed 's/\(.\)/\1\
/g' <Abhineet_extract1.txt | sort | uniq |tr -d '\n' >&1;
rm Abhineet_extract1.txt;
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误:

uniq: stdin: Illegal byte sequence
Run Code Online (Sandbox Code Playgroud)

"+?

unix bash shell sed uniq

5
推荐指数
1
解决办法
1万
查看次数

ARC语义问题"仅在归档时命名为'setRotation'的多个方法"

我在cocos2dv3中的项目正在抛出ARC Sematic 问题 多个名为'setRotation:'的方法在归档(发布模式)时发现了不匹配的结果,参数类型或属性.它在部署到模拟器/设备(调试模式)时运行良好.在发布模式下,编译器在UIRotationGestureRecognizer和中的旋转实现之间混淆CCNode.当我收到错误时CCBAnimationManager.m,我将调用选择器setRotation的对象类型化为(CCNode*),但随后出现了错误CCActionInterval.我希望有一个更好的解决方案,而不是在cocos2d库中进行类型转换.

我究竟做错了什么?感谢您的时间.

编辑

@interface CCAction : NSObject <NSCopying> {
    id          __unsafe_unretained _originalTarget;
    id          __unsafe_unretained _target;
    NSInteger   _tag;
}
@property (nonatomic,readonly,unsafe_unretained) id target;
@property (nonatomic,readonly,unsafe_unretained) id originalTarget;
@property (nonatomic,readwrite,assign) NSInteger tag;
Run Code Online (Sandbox Code Playgroud)

CCAction.m
@synthesize tag = _tag, target = _target, originalTarget = _originalTarget;


-(void) startWithTarget:(id)aTarget
{
    _originalTarget = _target = aTarget;
}

-(void) startWithTarget:(id)aTarget
{
    _originalTarget = _target = aTarget;
}
Run Code Online (Sandbox Code Playgroud)

类层次结构

@interface CCActionFiniteTime : CCAction <NSCopying> …
Run Code Online (Sandbox Code Playgroud)

objective-c cocos2d-iphone ios xcode5

4
推荐指数
1
解决办法
2889
查看次数

cocos2d v3支持多屏分辨率?

我对cocos2d v3对多屏幕分辨率的支持感到困惑.如果我使用CCSetupScreenMode: CCScreenModeFlexible,我提供的图像的默认分辨率应该是多少?

目前,我已经为所有iOS设备分辨率提供了资产以及后缀,并在iPhone"3.5inch"和iPad上加载了正确的图像.但是,iPhone"4英寸"的"-568h @ 2x"后缀不能正常工作.我使用了错误的后缀吗?

我想避免使用宏来确定游戏运行的设备并相应地加载图像.

感谢您的时间!

cocos2d-iphone ios

0
推荐指数
1
解决办法
2471
查看次数

标签 统计

cocos2d-iphone ×2

ios ×2

bash ×1

objective-c ×1

sed ×1

shell ×1

uniq ×1

unix ×1

xcode5 ×1