Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6469501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T05:59:54+00:00 2026-05-25T05:59:54+00:00

I have a type that inherits from UIImageView but adds some extra functionality. I’d

  • 0

I have a type that inherits from UIImageView but adds some extra functionality. I’d like to put it into my UITableViewCells as the image view, but would rather not do a whole new cell layout just so that I can add this image.

When I try to set the image view directly (self.imageView = myImageView) I get a compile error telling me that imageView is readonly. Is there any way around this or do I need to write a new table view cell class?

For greater clarity:

@interface MyImageViewClass : UIImageView {

}

@end

==========================

@interface MyTableCellClass : UITableViewCell {

}

@end

@implementation MyTableCellClass

-(void) setupCell
{
    MyImageView *imageView = [[[MyImageView alloc] init] autorelease];
    self.imageView = imageView;  // <---- THIS THROWS A COMPILE ERROR
}

@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T05:59:55+00:00Added an answer on May 25, 2026 at 5:59 am

    There are several options here.

    • You can just insert your own image view into the cell at the same location as the normal image view. In tableView:willDisplayCell:forRowAtIndexPath:, you can set the frame of your image view to match the default one (so you’ll get Apple’s layout logic). Then just set the image for your image cell rather than the default one.

    • You can do the same, but “steal” the image in tableView:willDisplayCell:.... Just set myImageView.image=imageView.image and clear the imageView‘s image. This would make it more transparent but slightly more magical.

    • Get fancy and ISA swizzle the imageView to your class. You must have no additional ivars or synthesized properties in your class for this to work or the crashes you get will be bizarre. Search around for “isa swizzle” or “class swizzle.”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class that inherits from defaultdict like this: class listdict(defaultdict): def __init__(self):
I have a view, that is of Inherits from System.Web.Mvc.ViewPage<P> . Type P has
I have a class that inherits from a dictionary in order to add some
yes but i have a problem i have created a controller that inherits from
I have generic type that looks like: public class GenericClass<T, U> where T :
I have an ASCX that inherits from a WebControl that has a 'CustomConfiguration' property
I have a partial view that inherits from ViewUserControl<Guid?> - i.e. it's model is
I have a class that inherits from DrawingVisual. It declares a DependencyProperty which, when
I have a custom control Workspace that inherits from Control and within it is
So I have one custom model binder that inherits from DefaultModelBinder, where I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.