How can I access or set a Task's properties inside a class or method?
Have you defined the settings and their type in your Task file?

I've had success using the array of things passed to the task to set the total steps like so:

class RerouteTask extends BaseTask
{

  protected function defineSettings()
  {
    // Files passed from controller
      return array(
        'files' =&gt; AttributeType::Mixed,
      );
  }

  public function getTotalSteps()
  {
    return count( $this-&gt;getSettings()-&gt;files );
  }


Then inside a controller you create the task.

$task = craft()-&gt;tasks-&gt;createTask('Reroute', 'Importing routes', array(
  'files' =&gt; $files
));