Note that there are some explanatory texts on larger screens.

plurals
  1. POMy objects in storyboard don't link correctly with the code
    primarykey
    data
    text
    <p>I am trying to use storyboards in my application. I began well, I have added two view controllers with a button to go from the first to the second. The problem is in this second view controller: the objects I add on it and link with the code do not work. When I set a breakpoint in the view controller code, the 'self.property' is set to nil, whereas it should be instantiated by the storyboard.</p> <p>I have been looking for an answer for hours, and I really don't understand the problem, since all the rest seems to be good.</p> <p>I have tried to write the property in the code (strong/nonatomic, nonatomic/retain and even weak/nonatomic), to link the object directly to the code so that it creates the property automatically, but I never get anything else than "nil" with breakpoints.</p> <p>viewController.h:</p> <pre><code>@interface NMLoadingViewController : UIViewController { __weak IBOutlet UIProgressView *imageProcessingProgressView; } @property (weak, nonatomic) IBOutlet UIProgressView *imageProcessingProgressView; @end </code></pre> <p>.m:</p> <pre><code>@synthesize imageProcessingProgressView; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. // Custom initialization NSLog(@"INIT."); } </code></pre> <p>(amont other lines of irrelevant code)</p> <p>If I set the breakpoint to the "INIT." line, my imageProcessingProgressView is nil. I can't see a reason for that, I guess I have missed a very little detail...</p> <p>(Note that I have tried this with other objects, like a UILabel, but it did not work either. Stranger, when I had two objects, one of them had an adress which was not nil, but still it was corrupted and did not show the right object.)</p> <p>Edit: It was a lot of trouble for nothing... The problem is about the Variable View in XCode, which show my variable to "nil", whereas a log shows me a correct object...</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload