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 7510173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:08:59+00:00 2026-05-29T23:08:59+00:00

I am getting confuse weither reference to subviews i am creating in a view

  • 0

I am getting confuse weither reference to subviews i am creating in a view should be declared with the weak or strong keyword when using ARC in iOS5.

Here is a sample of my header file:

#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>

@class SCLGridView;

@interface MyViewController : UIViewController <UIPopoverControllerDelegate, MFMailComposeViewControllerDelegate>
    @property (weak, nonatomic) IBOutlet UIView *hiddenBrowserView; 
    @property (strong, nonatomic) SCLGridView *gridView;
    @property (strong, nonatomic) UIImageView *backgroundView; 
    @property (strong, nonatomic) UIView *backgroundShadowView;
    @property (strong, nonatomic) UIPopoverController* popOverController;
@end

I run under the impression that the views i am creating and want to reference should be declare with the strong keyword because i am owning those views(i create them). However i have declared the hiddenBrowserView as weak because i am referencing a view i have created in the storyboard. Is this apporach correct or i should make all those view reference as weak even for the reference to views i create programmatically? Thanks!

  • 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-29T23:09:00+00:00Added an answer on May 29, 2026 at 11:09 pm

    As far as I know the subviews are strongly referenced by the main view of your controller. So there is no purpose of referencing them strong because the’ll be useless when your main view goes down.

    1. In other way, you create a subviews programmatically, and add them to your controller’s main view.
    2. Your controller’s main view references them strongly.
    3. And you point at this views with weak properties.
    4. When your controller’s main view is deallocated, so are the subviews.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just getting my head around Ruby metaprogramming. The mixin/modules always manage to confuse me.
I'm getting confused in the doco how I should be setting up Ninject. I'm
i'm getting confuse about dataset and dataview, which i either use dataset to update
I am getting confuse with all those terms: ABI, calling convention, and hardware architecture.
I'm getting a bit confuse with the rails console. I'm trying to connect to
Im sorry if this is a newbie question but I'm getting confuse about how
I am getting confused with all the different terminology when using Android: Activity, Service...
Here he comes to confuse his day! (should be my handle from now on)
I am getting confused about Google Map. I am writing a CMS website using
I'm getting confused with the include/exclude jargon, and my actual SVN client doesn't seem

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.