Objective-C “if” statements not retaining

后端 未结 3 1477
死守一世寂寞
死守一世寂寞 2021-01-14 17:20

I know the title of this question is a bit confusing, but here it goes anyway:

I\'m creating an NSString after an if statement but it just doesn\'t seem

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-14 18:11

    You have declared pwd as a local variable inside the bodies of the if. The variable you refer to later is probably declared outside, and is never set by either assignment. Simply remove NSString * from the assignments.

提交回复
热议问题