Note that there are some explanatory texts on larger screens.

plurals
  1. USJens Ayton
    primarykey
    data
    text
    plurals
    1. CORemoving an object at index 0 is potentially an O(n) operation. (NSMutableArray may be faster than that, but it isn’t guaranteed.) The faster approach is to use replaceObjectAtIndex: at a moving index. See the linked article on ring buffers for more information. All that said, a 475-item array shouldn’t slow you noticeably. Like James Jones and kaizer.se said, to find your real problem, profile. (In fact, try it without any maths at all – I suspect it’s the drawing that’s costing you.)
      singulars
    2. CONot nilling out ivars during dealloc is the #1 reason using accessors in dealloc is dangerous – a subclass may have left an ivar dangling, and then try to access it in an overridden setter. Still, leaving them dangling is the long-standing Cocoa norm, so it can’t really be said to be wrong. Personally, I’ve started adapting the GNUstep style of using a DESTROY() macro to release and clear variables in one go.
      singulars
    3. CO-[GameObject doesTouch:] is indeed sending an unrecognized method. There is no way to tell what it is from the stack trace, but it will be logged when the exception is thrown, so it should be visible in the Xcode console. To get more information, catch the exception or set a breakpoint in objc_exception_throw (Run->Show->Breakpoints->Double-Click for Symbol, type objc_exception_throw, then Run->Debug).
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload