UIBarButtonItem *doneitem=[[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(donePressed:)]autorelease];
Do this. It's way more simple.
Put the image file in your project directory
Add the file into Xcode (Right click on the Xcode project, add files to "Project Name")
Select your UIBarButtonItem in Storyboard
Click on "Image" and find your image (See Screenshot)
Celebrate, because it will work perfectly and it requires no unnecessary code.
