« D-Lay Day | Main | Check out that new site banner »
Monday
Dec192011

Wtf, Unity/Xcode/iOS?

What a waste of a day.

Somehow, i end up losing somewhere around 6-8 hours of work time to what is possibly the top 5 most ludicrous bugs i've ever dealt with in my programming career.

For months now, we have had a stable level 1-1.  Suddenly, a line of code that does objective checking on our trigger system (kill enemies 4,5,6 drops a chest, that sort of thing) stops working.  The line that's the culprit?

var tempArray : Array = new Array(gObjectiveList);

for those of you not verse in programming, all this is doing is essentially making a copy of an existing array.  The array wasn't empty, or null, or changed in any way.  It's the same old array we'd been copying for months with no issue.  In fact, the Web/Mac/PC Builds don't even give off an error.  Only iOS, and only in ONE spot where this line was called.  This type of initaliziation is called in our code maybe 20 times in different situations.

The solution?  Do the exact same thing, but in a different way:

  1. var tempArray : Array;   
  2. for (all objects in gObjectiveList) tempArray.Add(gObjectiveList[i]);

insane.  time poorly spent.  Now i wish i knew who to blame.

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.