 <p>I propose that you generate Image for your need, just by running this code and delete it after you generate the image:</p> <pre><code>- (void)viewDidLoad { ... someButton = [UIButton buttonWithType:101]; UIBarButtonItem *someBarButton = [[UIBarButtonItem alloc] initWithCustomView:someButton]; self.navigationItem.leftBarButtonItem = someBarButton; ... } </code></pre> <p>and </p> <pre><code>- (void)viewWillAppear:(BOOL)animated { .... UIImage *img1 = [someButton backgroundImageForState:UIControlStateNormal]; NSData *newData = UIImagePNGRepresentation(img1); NSFileManager *fileManager =[NSFileManager defaultManager]; BOOL filecreationSuccess = [fileManager createFileAtPath:@"/Users/macbookmac/Desktop/tester.png" contents:newData attributes:nil]; ... } </code></pre>