Note that there are some explanatory texts on larger screens.

plurals
  1. POUIAlertView causing change to navigation bar button's titleLabel
    primarykey
    data
    text
    <p>I am observing a weird trend in my app: whenever an alert message is displayed, the value of navigation bar button's title gets changed to its storyboard title value. Here is one of the UIAlertView: </p> <p><img src="https://i.stack.imgur.com/6JHQT.png" alt="navigation bar button title getting changed by alert view"> </p> <p>Title value 100 that is visible in image above is the value that is present in my storyboard. I am successfully changing this bar button's value to whatever is the current score with this line:</p> <pre><code>self.coinsRemainingButton.titleLabel.text = self.coinsRemaining; </code></pre> <p>Everything works fine until I display some alert view. As soon as any UIAlertView is displayed, this navigation bar button's title gets changed to 100 irrespective of the current score. For ex. even if my current score is 500, as soon as an alert message appears my bar button's value gets changed to 100, as shown in screenshot above.<br> I've checked thoroughly and I am not changing the value mistakenly myself.<br> If I remove UIAlertView lines everything comes back in order.<br> Thanks for your time.</p> <p>Update 1: Here is my UIAlertView code: </p> <pre><code> UIAlertView *iapSuccessful = [[UIAlertView alloc] initWithTitle:@"Purchase Successful" message:@"Congrats!! You just got coins" delegate:Nil cancelButtonTitle:@"Ok" otherButtonTitles: nil]; [iapSuccessful show]; </code></pre> <p>Update 2: I couldn't find solution so for the sake of workaround I thought of updating my bar button title by code immediately after UIAlertView is displayed:</p> <pre><code>[iapSuccessful show]; self.coinsRemainingButton.titleLabel.text = self.coinsRemaining; </code></pre> <p>but UIAlertView is still forcibly changing title of the bar button to storyboard value.</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.
 

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