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

  • Home
  • SEARCH
  • 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 9151693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:51:52+00:00 2026-06-17T11:51:52+00:00

At least I think it’s a basic problem. I just started working with views

  • 0

At least I think it’s a basic problem. I just started working with views programmatically.

In RouteCaptureViewController.h:

@property (strong, nonatomic) IBOutlet UIView *routeCaptureSuperView;

@property(nonatomic, weak) IBOutlet UIImageView *captureImageView;
@property(nonatomic, retain) IBOutlet UIImageView *previewImageView;
@property (weak, nonatomic) IBOutlet UIView *captureRouteButtonView;

In my storyboard:

enter image description here

All of the outlets are properly connected, I checked.

I’m implementing addSubview in a method as such and nothing happens:

  [self.routeCaptureSuperView addSubview:self.captureRouteButtonView];
  [self.routeCaptureSuperView addSubview:self.captureImageView];

The following lines worked previously in the code:

[self.captureImageView removeFromSuperview];
[self.captureRouteButtonView removeFromSuperview];

And I know self.routeCaptureSuperView is not nil from an NSLog.

  • 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-06-17T11:51:54+00:00Added an answer on June 17, 2026 at 11:51 am

    If I understood you correctly and you removed the views to add them again later I can make an educated guess:

    In the moment you send removeFromSuperview to your views they get deallocated because they are declared as weak only.
    Weak means that the property will be nil’d if the object is deallocated because the last strong relationship to that object is released.

    The parent view is the object that keeps the last strong relationship to those two views.

    Try to change weak to strong in the @property declaration of the two subviews.

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

Sidebar

Related Questions

I've just wrapped my head around monads (at least I'd like to think I
I have a problem (or at least I think I do). I am attempting
I have a very complex problem (at least i think so) implementing a custom
Or at least I think the problem involves some kind of memory error. I'm
I have a problem with my site , or at least I think I
I have a strange problem, at least I think it is strange. The following
i have a kind of special problem (at least i think it is one
or at least that's what pingdom says, and i think it's a pretty reliable
I bound (at least i think i did) data to a ListBox following a
I know (or at least I think I know) that selection is essentially one

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.