Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS - UILabel variable becoming (null)
    primarykey
    data
    text
    <p>I have searched high and low for an answer to my predicament and I believe it is due to my difficulty in adapting to ARC - I am hoping to deploy my app on iOS5 and am currently testing it in on a beta4 3GS.</p> <p>When the viewController is loaded (viewDidLoad:) my app alloc init's a UILabel and customises it to add it to the top of the screen:</p> <pre><code>UIView *navHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 280, 44)]; self.artistLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 2, 280, 15)]; artistLabel.font = [UIFont systemFontOfSize:12]; artistLabel.textColor = [UIColor grayColor]; artistLabel.backgroundColor = [UIColor clearColor]; artistLabel.textAlignment = UITextAlignmentCenter; [navHeaderView addSubview:artistLabel]; self.navigationBar.topItem.titleView = navHeaderView; </code></pre> <p>Okay, this works fine and fills in the relevant detail by accessing a updateTrack method:</p> <pre><code>- (void)updateTrack { _player = [MPMusicPlayerController iPodMusicPlayer]; _item = [_player nowPlayingItem]; self._artistString = [_item valueForProperty:MPMediaItemPropertyArtist]; self.artistLabel.text = self._artistString; } </code></pre> <p>This method is called when the music playing is changed using NSNotifications. However the artistString UILabel is now (null). I cannot see why the property has been released - it is set a nonatomic, strong property in the header file and synthesized at the top of the .m file.</p> <p>Maybe I should also add that a nonatomic, strong property I have assigned to an IBOutlet of UIImageView also goes (null) once the app has successfully loaded, displayed the album art once (i.e. this is not added as a subview).</p> <p>Any help would be greatly appreciated :D</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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