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
if
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.
pwd
NSString *