XCode 4 if (self = [super init]) issue

前端 未结 8 1108
野的像风
野的像风 2021-01-02 17:36

I have recently (e.g. just now) upgraded to XCode 4, and I like it overall, however, there is one thing that annoys me.

When I write code like this:

         


        
8条回答
  •  佛祖请我去吃肉
    2021-01-02 17:36

    use if(self == [self init]).....since you are using a assignment operator " = " in the place of condition .... if statement checks the condition .... n you are assingng a value out there... use "==" instead of "=" ...

    thanx.....

提交回复
热议问题