---
title: "In Objective-C how to Dump Data stored obj-c object"  
description: "In Objective-C how to Dump Data stored obj-c object"  
author: "zack mathews"  
published: 2015-09-29  
updated: 2015-09-29  
canonical: https://www.mindstick.com/forum/33481/in-objective-c-how-to-dump-data-stored-obj-c-object  
category: "iphone"  
tags: ["iphone", "ios", "objective c"]  
reading_time: 1 minute  

---

# In Objective-C how to Dump Data stored obj-c object

In other [programming languages](https://www.mindstick.com/articles/12386/5-up-and-coming-programming-languages-to-know-about) like [PHP](https://www.mindstick.com/articles/12149/php-constant-and-php-variables) or [Perl](https://www.mindstick.com/interview/2291/what-is-the-characteristic-of-streaming-api-that-makes-it-flexible-run-mapreduce-jobs-in-languages-like-perl-ruby-awk-etc), it is easy to dump everything that is contained in a variable. Like in PHP using var_dump() or print_r() [functions](https://www.mindstick.com/forum/160140/explain-the-role-of-functions-as-a-service-faas-in-serverless-computing) and Perl has the [Data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science)::Dumper CPAN [class](https://www.mindstick.com/blog/165/generic-class-in-c-sharp), etc.

So, I want something like that in Objective-C, in few cases it would be very convenient to able to dump everything like that, [instead of](https://www.mindstick.com/articles/330/triggers-in-sql-server) using gdb to inspect each variable.

## Replies

### Reply by Tarun Kumar

I will use to debug NSArray contents using the code:

```
NSEnumerator *enum = [arrObj objectEnumerator];id obj;     while ( obj = [enum nextObject] ) {   NSLog(@"%@", obj);}
```

The code above enumerate all objects in the NSArray arrObj, so we can iterate through and also can print every object. \
I hope this code will be helpful for you.


---

Original Source: https://www.mindstick.com/forum/33481/in-objective-c-how-to-dump-data-stored-obj-c-object

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
