Element initializer method must have at least 1 parameter
元素初始值设定项方法必须至少有 1 个参数
The idea with class cluster is very simple: you typically have an abstract class that during the initialization process uses information, generally provided as parameters of the initializer method or available in the environment, to apply a logic and instantiate a concrete subclass.
class cluster 的想法很简单: 使用信息进行(类的)初始化处理期间,会使用一个抽象类(通常作为初始化方法的参数或者判定环境的可用性参数)来完成特定的逻辑或者实例化一个具体的子类。
Initializer method is actually a special provision of the, It is possible for the class to initialize.
初始化器其实就是一个特殊规定了的方法,它能够为类进行初始化。
Element initializer method must be named 'Add'
必须将元素初始值设定项方法命名为"Add"
Element initializer method must be an instance method
元素初始值设定项方法必须为实例方法
Other results
If you really want to use the initializer instead of factory method, consider using an optional variable to store the result.
如果你确实想使用初始化方法而不愿意用工厂函数的话,也可以考虑用一个 Optional 量来存储结果
Constructor cannot be modified while debugging because field '%1' has an initializer using an anonymous method.
在调试过程中无法修改构造函数,原因是字段"%1"具有使用匿名方法的初始值。
Not wrong, When we initialize a class object when, We did call a method - initializer.
没错的,当我们初始化了一个类为对象的时候,我们确实调用了一个方法 - 初始化器。
The best overloaded method match '{0}' for the collection initializer element cannot be used. Collection initializer 'Add' methods cannot have ref or out parameters.
无法使用集合初始值设定项元素的最佳重载方法匹配项"{0}"。集合初始值设定项"Add"方法不能具有 ref 或 out 参数。
For this specific example, we do not need to add auto release pool indeed. In Swift 1.1, with the added feature of failable initializers, class factory methods like dataWithContentsOfFile are completely removed. Apple suggests to always use failable initializers instead
其实对于这个特定的例子,我们并不一定需要加入自动释放。在 Swift 中更提倡的是用初始化方法而不是用像上面那样的类方法来生成对象,而且从 Swift 1.1 开始,因为加入了可以返回 nil 的初始化方法,像上面例子中那样的工厂方法都已经从 API 中删除了。今后我们都应该这样写:
method to use nested collection initializers with a Dictionary.
即可对字典使用嵌套的集合初始值设定项。
The selected code is a constant initializer and cannot be replaced by a method call
选定的代码是常量初始值,不能通过方法调用替换
collection initializer syntax relies on extension methods defined in GenericAdd.vb.
集合初始值设定项语法依赖 GenericAdd.vb 中定义的扩展方法。
Potentially sensitive or inappropriate content
Examples are used only to help you translate the word or expression searched in various contexts. They are not selected or validated by us and can contain inappropriate terms or ideas. Please report examples to be edited or not to be displayed. Potentially sensitive, inappropriate or colloquial translations are usually marked in red or in orange.