I am getting pretty frustrated, i have an tcp server running on my mac where i have a couple of devices hooked up to. I wanted to have my iphone connected to it so i can run som commands from my iphone directly to my mac @ home.
The tcp client for my iphone works pretty good except for one fault, it seems like it doesnt clear up the outputstream for each string i send. Here is an example of what i am having problems with
- I type in “Start my browser” on my iphone client and hit send
- The message pops up on my mac, everything ok so far
- I want to send another command from my iphone and type “B” and hit send
- The output on the iphone will then be “Btart my browser”
- It seems as it keeps the previous string in cache or something.
Does anyone have any sugestions? I would appreciate all help, if you need to see any of my code please post an message saying so and i will have it posted.
Without any code I can only guess, but this looks like a bug in your code that handles the string input. In case you are using a NSMutableString / NSMutableData to store your input, make sure you clear that input after accepting a command. It now looks like you just overwrite the beginning without actually erasing it first.