Passing arguments by value or by reference in objective C

前端 未结 5 1169
天命终不由人
天命终不由人 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 10:58

    Did you edit out code between this line

    UILabel *startHourLabel;
    

    and this line?

    [self checkRedColorText:startHourLabel];
    

    If not, the problem is that you're re-declaring your startHourLabel variable, so you're losing any sort of initialization that was there previously. You should be getting a compiler error here.

提交回复
热议问题