---
title: "bundleWithPath:"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/nsbundle/bundlewithpath:"
---

# bundleWithPath:

Returns an NSBundle object that corresponds to the specified directory.

## Declaration

```occ
+ (instancetype) bundleWithPath:(NSString *) path;
```

## Parameters

- `path`: The path to a directory. This must be a full pathname for a directory; if it contains any symbolic links, they must be resolvable.

## Return Value

Return Value The NSBundle object that corresponds to path, or nil if path does not identify an accessible bundle directory.

## Discussion

Discussion This method allocates and initializes the returned object if there is no existing NSBundle associated with path, in which case it returns the existing object.

## See Also

### Related Documentation

- [main](foundation/bundle/main.md)

### Creating and initializing a bundle

- [init(url:)](foundation/bundle/init(url:)-a2t0.md)
- [init(for:)](foundation/bundle/init(for:).md)
- [init(identifier:)](foundation/bundle/init(identifier:).md)
- [init(path:)](foundation/bundle/init(path:).md)
