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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:49:15+00:00 2026-06-01T18:49:15+00:00

The problem is simple to explain but difficult for me to resolve. I have

  • 0

The problem is simple to explain but difficult for me to resolve. I have a property that is NEVER initialized.

First of all, I’m using the iCarousel custom class in order to display some images for my app. In one of its delegate methods (the one that it uses in order to know which view is going to show at some index), I use this code:

- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
   if(!view)
   {
      CustomController* controller = [self.storyboard instantiateViewControllerWithIdentifier: "identifier"]; 
      //BTW, the CustomController is initialized properly. Its instance is not nil after the initialization.
      controller.imageView.image = [UIImage imageNamed: "something.png"];
      view = controller.view;
   }

   return view;       
}

As you can see, the view that I show in my carousel is a custom view with its own controller. I initialize it using the storyboard method and then I just set the image in my imageView property, which is, obviously, an UIImageView.

Don’t get excited and say that I’m not initializing my imageView, because I have a custom getter in my “CustomController” class. Like this:

//interface (.h)

...

@property (nonatomic, strong) UIImageView* imageView;

...

//implementation (.m)

...

@synthesize imageView = _imageView;

...

- (UIImageView*) imageView
{
   if(!_imageView)
      _imageView = [[UIImageView alloc] init];
   return _imageView;
}

...

Believe it or not, even if I put a breakpoint in the “_imageView = [[UIImageVIew alloc] init];”… the program executes that line but the _imageView remains nil. ¿Why?

I don’t want to know “How to set my property”, so please don’t give workarounds for this… what I want to know is “Why my property is never setted and remains nil always”, what’s am I doing wrong?.

I’ve also tried to use my imageView as an IBOutlet… but even if I link it to an imageView in the Interface Builder and check its value after the “viewDidLoad”, it still remains nil.

P.S: Btw, I’m using ARC (yeah, I know is in the title… xD)

  • 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-01T18:49:17+00:00Added an answer on June 1, 2026 at 6:49 pm

    Well, it looks like the answer was what borrrden said, the problem was the LLDB debugger. Actually, my property was initialized but the debugger didn’t detect it like that, if I change it to GDB I could see it wasn’t nil after all. Furthermore, the reason why I had also issues with my child viewcontroller’s outlets was because I didn’t use the View Controller Container methods in iOS5 (DidMoveParentViewController and those ones).

    Kinda tricky.

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

Sidebar

Related Questions

somewhat simple problem(to explain) this time: i have an array of markers that i
I have a problem that I can't seem to resolve. I'm sure it's simple,
a possibly simple problem, but weird why I have no idea how to do
My problem is simple: I have a long list of elements that I want
I have a simple problem that i cannot solve. I have a dictionary: aa
This is a bit of a difficult problem to explain, but I'm hoping it
I have this simple problem. I'll try to explain with a sample code An
Simple problem that I can't figure out... How can I print a '%' character
simple problem with a simple question. I have a string, in C# i can
I got a simple problem in SQLAlchemy. I have one model in a table,

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.