This is not an attempt to appeal the decisions of the community, I just want to become a better stackoverflower...
I posted a question (Now edited, so no need to go looking for it) asking how to convert an NSString to an int. Within moments, it had several downvotes.
quick Swift question:
So, I have an app that needs to convert from NSString to an integer. Here's what I tried -
var variable = (NSString(data:data, encoding:NSUTF8StringEncoding)) exampeStruct.otherVariable = (variable).toInt() I would expect it to set exampleStruct.otherVariable to an int value of the NSString, but it gives the error "NSString does not have a member toInt?"
What is the proper way to convert nsstring to int?
It was soon closed as off topic. I've looked through the How to Ask Questions thing in help center, and I can't seem to find what I missed...
Search, and Research
This was done. First, I tried it by guessing, then next I went to google. As you know, google displays result differently for everyone, but in case you need to check, there was no help while researching this way.
Write a title that summarizes the specific problem
"NSString to Integer" would seem to fit this rule...
Introduce the problem before you post any code
Yup! "...Convert from nsstring to integer..." Would seem to do that.
Help others reproduce the problem
I included the smallest amount of code necessary to reproduce the problem.
Include all relevant tags
ios xcode swift nsstring all seem to be relevant
Proof-read before posting!
Done! Not saying it was perfect, but it was proofread.
Post the question and respond to feedback
I interacted with the commentors...
Look for help asking for help
This is this post :D
It was also closed for being a
a problem that can no longer be reproduced or a simple typographical error
It was a reproducible (I gave code!) debugging question. There was no typos in the code, as far as I am aware...
As well as...
"Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers.
It had a desired behavior/specific problem/problem statement "Convert from NSString to an integer". It had code that reproduced it.
So, having tried in vain to figure out what I did wrong, any chance you can tell me? Thanks for your time, and apologies for probably a basic question. Again, I have no issues with what the community decided to do, I just want to learn.