Oddity
Oddity
- Subject: Oddity
- From: email@hidden
- Date: Thu, 15 Nov 2001 23:33:11 -0600
I'm finishing up the first app I've done that's not a tutorial, a simple
mortgage calculator. I have a field named 'cityStateZip'. I fill the
field with a series of 'stringByAppendingString's. When I first built
this part of the routine, I found I couldn't append anything if nothing
was intially in the string. So I created the string with a blank:
NSString* cityStateZip = @" ". Not a solution I liked because now I have
blank spaces in front of my test. When I had the rest of the program
running, I went back to this code to try some other stuff. I tried to
initWithString:city and a couple of other things, that I couldn't get to
work. Anyway, it's getting late and I want the thing to run before
quitting for the night. I rewrite: NSString* cityStateZip = @" ". It
compiled fine. When I ran the program I got errors. (Unable to access
the stupid variable!). After a fair amount of head scratching, I
eventually copied the new iteration of the variable name and pasted them
over the other instances of it and now it works fine. I am ABSOLUTELY
postitive the new variable name was identical to the old ones.
Any quesses as to what happened. (And while we're at it, how do I get
the first value, city, into the string without a leading space?)