---
title: "sceneSourceWithData:options:"
framework: scenekit
role: symbol
role_heading: Type Method
path: "scenekit/scnscenesource/scenesourcewithdata:options:"
---

# sceneSourceWithData:options:

Creates a scene source that reads the scene graph contained in an NSData object.

## Declaration

```occ
+ (instancetype) sceneSourceWithData:(NSData *) data options:(NSDictionary<NSString *,id> *) options;
```

## Parameters

- `data`: An data object containing a scene file in a format recognized by SceneKit.
- `options`: A dictionary containing options that affect scene loading. See Scene Loading Options for available keys and values. Pass nil to use default options.

## Return Value

Return Value A new, initialized scene source object, or nil if initialization was not successful.

## Discussion

Discussion The data parameter of this method (a NSData) should contain the same data as directly read from a scene file (such as by using the NSData method doc://com.apple.documentation/documentation/foundation/nsdata/init(contentsofurl:)-6foqd). Use this method when you have the contents of a scene file but not the file itself—for example, if your app downloads scene files from the network.

## See Also

### Creating a Scene Source

- [sceneSourceWithURL:options:](scenekit/scnscenesource/scenesourcewithurl:options:.md)
- [init(url:options:)](scenekit/scnscenesource/init(url:options:)-rw0y.md)
- [init(data:options:)](scenekit/scnscenesource/init(data:options:).md)
