I have an jpg image named Check Mark.jpg
that I'm trying to load into the accessory view of a table view cell. This is what my code currently is:
cell.accessoryView =
[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Check Mark.jpg"]];
in the cellForRowAtIndexPath
method
When I do this, nothing displays in the table view cell. I have checked the name of the file, and have tried putting it in the folder containing the .xcodeproj file and the folder containing all the code files. Neither of these have worked. I also tried declaring the UIImageView
and UIImage
as strong properties and initializing them in the init:
method. None of this works. I can display the detail disclosure button in the view, so I know the accessory view is there, but I can't seem to figure out how to display this simple image.
Do I have to somehow load the image into my project?