---
title: "initWithTaskList:tasks:all:"
framework: intents
role: symbol
role_heading: Instance Method
path: "intents/indeletetasksintent/initwithtasklist:tasks:all:"
---

# initWithTaskList:tasks:all:

Initializes the intent object with information about the task list and the tasks to delete from it.

## Declaration

```occ
- (instancetype) initWithTaskList:(INTaskList *) taskList tasks:(NSArray<INTask *> *) tasks all:(NSNumber *) all;
```

## Parameters

- `taskList`: The task list to delete tasks from.
- `tasks`: An array of tasks to delete.
- `all`: A Boolean value indicating whether to delete all of the tasks in the task list.

## Return Value

Return Value An initialized intent object or nil if the object could not be created.

## Discussion

Discussion Normally, you don’t create instances of this class yourself. Instead, SiriKit creates instances when the user asks to set the attributes of a task. However, you can use this method during testing to create intent objects in order to validate your intent handling code paths.
