Search code examples
iosrubymotion

RubyMotion require method alternative


I have same methods in Controllers for deleting/showing CoreData objects. I've decided to put into its own Module. But found out that require is not supported by RubyMotion.

How should I go about including Helpers module I have to my Controllers? I've tried load,include,require_realtive to no avail.


Solution

  • include definitely works. If you get errors when using include, you have a load order issue. There are 2 different options to fix that, depending on if you are using bundler, or not. Those 2 options are detailed on this similar question:

    Include not finding module RubyMotion