search

Home  >  Q&A  >  body text

ios - swift纯新手,请教各位.swift中使用self=super.init遇到错误

在声明的方法中想调用self=super.init,遇到错误. cannot assign to value:'self' is immutable

public class initWithData:NSObject{

func initWithDataModel(superID:Int,myID:Int,grade:Int,isOpen:Bool,showName:NSString,rightShowName:NSString){

    
    
    if(self = super.init){
        
    }
    
    
}
黄舟黄舟2771 days ago756

reply all(1)I'll reply

  • ringa_lee

    ringa_lee2017-04-18 09:48:33

    No need to judge, just super.init()just

    reply
    0
  • Cancelreply