title: Objective C 's NSString subStringToIndex causing strange issue
body: <p>Hi everyone I am working on a game and I have run into a really weird issue and was hoping to get some help. Basically sometimes the text is a bit long to show in one textbox so I wanted it to break down a string and store the undisplayed text in a string to be used in the next message box. So when I use this code..</p>
  
  <pre><code>NSString * Talkin1 = @"Hello I am an annoying string";
  NSString * Talkin2 = [Talkin1 substringToIndex:5];
  </code></pre>
  
  <p>It makes Talkin2 the value of Hello which is what I want. Then I store it in the object with..</p>
  
  <pre><code>[_window setMultiMessage:Talkin2];
  </code></pre>
  
  <p>which goes to my set and get methods in an object i made.</p>
  
  <p>In it's interface...</p>
  
  <pre><code> NSString * multiMessage;
  </code></pre>
  
  <p>in its .m</p>
  
  <pre><code>-(void) setMultiMessage:(NSString*)messageTwo
  {
   multiMessage = messageTwo; 
  }
  -(NSString*) getMultiMessage
  {
   return multiMessage;
  }
  </code></pre>
  
  <p>then later the main object pulls it out again, when it is done closing the first window with...</p>
  
  <pre><code> NSString * talking = [_window getMultiMessage];
  </code></pre>
  
  <p>Now in debugging, I have noticed talking's value will be "out of scope" when i get the string back from _window. So then it crashes my program when it tries to use it. </p>
  
  <p>But. If i do this everything works fine. </p>
  
  <pre><code>NSString * Talkin1 = @"Hello I am an annoying string";
   //NSString * Talkin2 = [Talkin1 substringToIndex:5];
  
  [_window setMultiMessage:Talkin1];
  </code></pre>
  
  <p>So it works perfect (except for splitting the string like I want) when I use <code>@" "</code> but not when I use any result of substringToIndex or substringFromIndex.</p>
  
  <p>I am new to objective c so I assume it is something basic I am missing. Any help would be wonderful! Thank you in advance.</p>