Passing arguments by value or by reference in objective C

前端 未结 5 1203
天命终不由人
天命终不由人 2020-12-02 10:21

I\'m kind of new with objective c and I\'m trying to pass an argument by reference but is behaving like it were a value. Do you know why this doesn\'t work?

This is

5条回答
  •  生来不讨喜
    2020-12-02 11:00

    In objective-c, there is no way to pass objects by value (unless you explicitly copy it, but that's another story). Poke around your code -- are you sure checkRedColorText: is called? What about [startDate compare:endDate], does it ever not equal NSOrderedDescending? Is labelToChange nil?

提交回复
热议问题