Advertisement
beeradmoore

Untitled

Nov 1st, 2011
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1. // Works flawlessly
  2. for (int i = 0; i < Root.Count; ++i)
  3. {
  4.     Console.WriteLine("Begin SectionLoop");
  5.     for (int j = 0; j < Root[i].Count; ++j)
  6.     {
  7.         Console.WriteLine("Element: " + Root[i][j]);
  8.         if (typeof(EntryElement) == Root[i][j].GetType())
  9.         {
  10.             if (((EntryElement)Root[i][j]).Entry != null && ((EntryElement)Root[i][j]).Entry.IsFirstResponder)
  11.             {
  12.                 ((EntryElement)Root[i][j]).Entry.ResignFirstResponder();
  13.             }
  14.         }
  15.     }
  16.     Console.WriteLine("End SectionLoop");
  17. }
  18.  
  19. // Does not even output "Begin SectionLoop", but dies with a SIGSEGV
  20. foreach (Section section in Root)
  21. {      
  22.     Console.WriteLine("Begin SectionLoop");
  23.     foreach (Element entryElement in section)
  24.     {
  25.         Console.WriteLine("Element: " + entryElement);
  26.         if (typeof(EntryElement) == entryElement.GetType())
  27.         {
  28.             if (((EntryElement)entryElement).Entry != null && ((EntryElement)entryElement).Entry.IsFirstResponder)
  29.             {
  30.                 ((EntryElement)entryElement).Entry.ResignFirstResponder();
  31.             }
  32.         }
  33.     }
  34.     Console.WriteLine("End SectionLoop");
  35. }
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement