Re: Simple Question
Re: Simple Question
- Subject: Re: Simple Question
- From: Peer Allan <email@hidden>
- Date: Mon, 12 Nov 2001 08:18:05 -0600
Like I said in my original post I had a feeling it was going to be something
simple that I simply overlooked. I understand if it looks lazy posting such
a question to the list, but I did search for the answer for quite a while.
I was fully expecting a RTFM response. The reason I posted it anyway was
simple, I couldn't find it, I was VERY frustrated because I couldn't find it
(and because I felt stupid that I couldn't find it), and finally, I knew
someone on the list would know it instantly and cure me of my frustration.
>
>
Since we are on the subject of newbies not being able to find information,
>
why couldn't you find these references or the many times this question has
>
been answered in this forum before ? Rather than shouting RTFM at you, we
>
can use this question as a test case for why this information was hard to
>
find ?
>
>
- Have you ever used printf() in ANSI C ?
Yes.
>
- Did you consider just using sprintf() ?
No, I didn't consider either of these options, in hindsight I'm kicking
myself for it, but I guess I had NSString so wrapped in my head as a
completely different class that would not be compatible with something like
that. So you could chalk this one up an assumption on my part.
>
- Did you glance at the NSString documentation ? If not why ? In your
>
question, you state that you want and NString containing text and a number.
>
Why didn't you just scan the NSString documentation ?
I looked through and did searches in the NSString documentation. I must not
have looked close enough and not searched it with the correct keywords.
Again, I think I was so hung up on floats and NSString together that when I
didn't see any specific references I didn't bother to bend my thought
process to accommodate another possibility.
>
- Did you scan the NSString and or NSNumber documentation and not suspect
>
that a format could help you ? Did you not think that -stringValue of a
>
number could help ?
Those were my first thoughts and they were exactly where I looked. I tried
to use and NSNumber instead of a float and could get it to work.
>
- Did you notice that strings can be appended to each other in a variety of
>
ways ?
Yes, I am using this in several other parts of my application, but it was
always just 2 NSStrings that needed to be appended to one another. I tried
to use it for this step but got a 'type mismatch' error.
>
>
I am not picking on you. I think you can help many people understand what
>
exactly is missing from the documentation.
>
I don't feel picked on, but thanks for the Q&A. I read over the superclass
documentation all the time trying to figure things out for my own. I
searched on Google on converting floats to NSStrings and in the cocao-dev
archive.
Where I run into problems is not so much trying to find the methods that
will do what I want, but how to properly implement them. I think that I
learn better by example that by description. If I can see a small piece of
code that shows the method in context then I find it much easier to picture
it implemented into my own program.
I think it is great to have a complete list of all the methods for each
class at my fingertips, but sometimes the descriptions are lacking and the
only example I have found in the docs (so far) was for appending strings.
You can have it all listed, but without better docs showing how to use it
correctly it can be difficult for a newbie to figure it out.
Thanks again,
Peer