Thanks for taking the time Patrick, i can't believe i made such a
fundamental mistake. Btw, how did you know that it was the password
outlet?
Patrick Machielse - 20 Oct 2005 09:49 GMT
> Thanks for taking the time Patrick, i can't believe i made such a
> fundamental mistake.
Because it is valid in Objective-C to send messages to 'nil',
unconnected outlets don't generally raise errors. Everyone here
experienced it (at least) once and went on a wild bug chase.
> Btw, how did you know that it was the password
> outlet?
when the password outlet is not connected, it has the value 'nil',
and
if ( [[password stringValue] isEqualToString:@"Hello"] )
evaluates to 'NO'. (which probably isn't guaranteed, because
isEqualToString returns a BOOL and not an object, but that's a finer
point)
patrick
clvrmnky - 24 Oct 2005 18:42 GMT
> Thanks for taking the time Patrick, i can't believe i made such a
> fundamental mistake. Btw, how did you know that it was the password
> outlet?
My guess: because the if statement fails unless the password id is
connected up properly. That is, the final boolean is determined by the
whole statement; comparing an unconnected id in this manner will always
return false, it looks like.
By removing the if statement (or forcing it to true) the code worked,
and since the if statement was properly formed, the problem had to be in
the final result of the statement coming out to false.