iTunes Connect表示要在Mac Developer Utilities文件夹中使用Application Loader实用程序.
存档区域中还有XCode提交功能,与提交前验证应用程序的位置相同.
这两个实用程序是否做同样的事情?哪个更好?
这不起作用:
CCSprite *testscale=[CCSprite spriteWithSpriteFrame:starFrame];
testscale.scale=0.5;
float starWidth=testscale.contentSizeInPixels.width;
CCLOG(@"contentpixels: %f contentsize: %f",starWidth, testscale.contentSize.width);
Run Code Online (Sandbox Code Playgroud)
CCLOG中的两个输出都显示精灵的原始像素大小,而不是缩放后的大小.
有没有办法在没有这样做的情况下得到它?...
float displayWidth=starWidth*testscale.scale;
将精灵缩放到精确大小的最佳技术是什么?scale属性是一个乘数,但是如果你想要一个sprite正好是X像素宽,那么有一个简单的技术吗?或者,它是否需要简单地使用所需的大小和实际的精灵contentsize来计算必要的scale操作?
如果你折叠一个循环的视图(这样它显示了省略号......而不是循环中的行)并且你为许多循环执行此操作,有没有办法快速将所有这些扩展回显示所有行代码再次?
这编译,但我从来没有在任何其他代码中看到它.安全吗?
Testclass():sources(new int[32]){}
Run Code Online (Sandbox Code Playgroud)
代替:
Testclass(){
sources = new int[32];
}
Run Code Online (Sandbox Code Playgroud) 我看到很多将项添加到a map或unordered_mapvia 的示例operator[],如下所示:
int main() {
unordered_map <string, int> m;
m["foo"] = 42;
cout << m["foo"] << endl;
}
Run Code Online (Sandbox Code Playgroud)
是否有任何理由使用insert成员函数?看起来他们都做同样的事情.
我做了很多:
class Child{
Control*parent;
public:
Child(Control*theParent):parent(theParent){}
};
class Control{
Child child;
void makeChild(){ child=Child(this); }
//Control() : child(this) { } //another example
}
Run Code Online (Sandbox Code Playgroud)
因此,Control拥有并操作孩子,但孩子仍然引用了父Control.
当我阅读关于程序设计模式等的一般主题时,似乎不特别推荐这种组织对象的方法.我意识到存在风险,例如你不希望你child的父母通过让父母做只有父母应该自己决定做的事情来滥用它的父母; 在这种情况下,通过确保父级的关键方法是私有的,似乎很容易防止.但是你可能有另一个管理父节点的控制器,在这种情况下,一些方法应该是公共的,现在你的孩子也可以访问那些,当真正只有其他控制器应该操纵那些.
所以我可以看出这是多么危险.
但我的问题是,什么是常见的替代方案?您需要父母拥有一个孩子,但您需要孩子能够偶尔通知父母.怎么,如果不是以上?
Objective-C有NSNotificationCenter,它允许通知而不实际传递引用,但这也使得创建组织问题变得容易(为什么我的孩子发出这个通知,谁将收到它?)
与thisC++中的关键字类似,我想要有一个QML元素将自己传递给JS函数,或者让它在另一个元素上设置属性.这可能吗?
例如:
Rectangle{
id:theParent
property var theElement
SomeElement{
id:theChild
MouseArea {
anchors.fill:parent
onClicked: {
someJsFunction(*whatGoesHere*)
parent.theElement=*whatGoesHere*
}
}
Run Code Online (Sandbox Code Playgroud)
或者,考虑一下:
Rectangle{
id:theParent
property var theElement
SomeElement{
id:theChild
}
Run Code Online (Sandbox Code Playgroud)
然后,在SomeElement.qml中:
Rectangle{
MouseArea {
anchors.fill:parent
onClicked: {
someJsFunction(*whatGoesHere*)
parent.theElement=*whatGoesHere*
}
}
}
Run Code Online (Sandbox Code Playgroud)
在这种情况下,*whatGoesHere*它将是调用它们的SomeElement的实例.
这在QML中是否可行?我认为该id属性是有意义的,但根据文档,你无法查询该id字段的值,无论如何,id如果我SomeElement在一个单独的文件中描述,那么就不可用了,并且上面的whatGoesHere处理出现在那个单独的文件而不是特定的实例.
我有这样的数据集: '(("red" 3 5)("blue" 6 8)...)
assoc当键是字符串时是否可以使用?在这个简单的测试中,没有一个明显的尝试对我有用:
CL-USER> (defparameter ggg (list '("foot" 2) '(bar 5)))
GGG
CL-USER> ggg
(("foot" 2) (BAR 5))
CL-USER> (assoc 'bar ggg)
(BAR 5)
CL-USER> (assoc "foot" ggg)
NIL
CL-USER> (assoc '"foot" ggg)
NIL
CL-USER> (assoc 'foot ggg)
NIL
Run Code Online (Sandbox Code Playgroud) 所以我可以这样做:
CL-USER> (format t "~80<~a~;~a~;~a~;~a~>~%" "hello" "how are you" "i'm fine" "no you're not")
hello how are you i'm fine no you're not
Run Code Online (Sandbox Code Playgroud)
它按指定的方式在4跨度上均匀分隔4个字符串.
但是,我想传递一个字符串列表,并根据列表中的许多字符串来确定它们的合理性.
这些都不是这样的:
CL-USER> (format t "~{~80<~a~;~>~}~%" '(1 2 3 4 5 6))
1
2
3
4
5
6
CL-USER> (format t "~80<~{~a~;~}~>~%" '(1 2 3 4 5 6))
; Evaluation aborted on #<SB-FORMAT:FORMAT-ERROR {126651E1}>.
; ~; not contained within either ~[...~] or ~<...~>
Run Code Online (Sandbox Code Playgroud)
有没有办法做到这一点?