Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
When I type in something in, the text of the textview appears. When I repeat that the text CHANGES. But I want to add a line. Could somebody please tell me how to do that?
When I type in something in, the text of the textview appears. When I repeat that the text CHANGES. But I want to add a line. Could somebody please tell me how to do that?
vincefried
Several things:
In one part of your code you call it mTextField, and in another part you call t mTextView. Do you have two different text objects?
Are you using UITextView or UITextField objects? A UITextView is a multi-line, scrollable text object.
If you are creating UITextFields, though, I don't think they are set up to display multiple lines of text.
If you're using a UILabel (read-only) they default to a single line, but can be set up to display multiple lines. To do that set the numberOfLines property to 0.
Next, assuming you're using a UITextView, you will need to append new text to the end of the old. To get the new text to begin on a new line, you'll need to add a carriage return at the end of the old text. Something like this:
... I didn't describe it right... first you connect over peer-to-peer to another device. Then, you have a textfield and a textview. in the textfield, you type in something, and then it displays the typed text in the textview of your peer. the textview is not editable. there's a "send"-button, which is connected to the sendData-action. everytime, I press the send button, the text in the textview of my peer will be replaced by the new text, I typed in, but it should be added in a new line, just like a messenger. I hope that helped ;)
... I didn't describe it right... first you connect over peer-to-peer to another device. Then, you have a textfield and a textview. in the textfield, you type in something, and then it displays the typed text in the textview of your peer. the textview is not editable. there's a "send"-button, which is connected to the sendData-action. everytime, I press the send button, the text in the textview of my peer will be replaced by the new text, I typed in, but it should be added in a new line, just like a messenger. I hope that helped ;)
Ok, so take the contents of your text field and/or the response from the server and append it to the contents of the text view as I outlined in my post.
Regards,
Duncan C WareTo
Animated GIF created with Face Dancer, available for free in the app store.
Replies
Remember to release your alloced string.
Homer J Simpson
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeSeveral things:
In one part of your code you call it mTextField, and in another part you call t mTextView. Do you have two different text objects?
Are you using UITextView or UITextField objects? A UITextView is a multi-line, scrollable text object.
If you are creating UITextFields, though, I don't think they are set up to display multiple lines of text.
If you're using a UILabel (read-only) they default to a single line, but can be set up to display multiple lines. To do that set the numberOfLines property to 0.
Next, assuming you're using a UITextView, you will need to append new text to the end of the old. To get the new text to begin on a new line, you'll need to add a carriage return at the end of the old text. Something like this:
Duncan C
WareTo
Animated GIF created with Face Dancer, available for free in the app store.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeAdalbert sagt.. (Germany only)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeDuncan C
WareTo
Animated GIF created with Face Dancer, available for free in the app store.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeAdalbert sagt.. (Germany only)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome