if (myFile.existsAsFile()) {
String myText = myFile.loadFileAsString();
//this works!
label1->setText(myText,false);
//this gives me an error
texteditor1->setText(myText, false);
}[/code]
the error I get is:
JUCE v1.53.107
JUCE Assertion failure in /Users/fsottile/Desktop/francesco/study/audio unit/JUCE/examples/test_introducer/Builds/MacOSX/…/…/JuceLibraryCode/…/…/…/juce/amalgamation/…/src/gui/components/controls/juce_TextEditor.cpp, line 1254
Debugger() was called!
[quote]// if you’re adding text with line-feeds to a single-line text editor, it
// ain’t gonna look right!
jassert (multiline || ! newText.containsAnyOf ("\r\n"));[/quote]
If that’s the assertion, you either need to set the textbox to be multiline (setMultiLine (true), probably what you want) or else parse the string after you read it in so it doesn’t contain “\r\n”. (string.removeCharacters ("\r\n")).