Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Oh man...</p> <pre><code>if (newsPre.on = YES) { </code></pre> <p>You need two equal signs there. Otherwise you're invoking a setter method. (See? Dot syntax is bad!) As it currently stands, this is saying: <code>if ([newsPre setOn:YES]) {</code>. What you want is either <code>newsPre.on == YES</code> or <code>[newsPre on] == YES</code>.</p> <pre><code> NSArray *newsArray = [NSArray AarrayWithObjects = @"News", @"Latest", @"Trending", nil;] </code></pre> <p>First, the semicolon goes <em>after</em> the bracket. It's supposed to be the last thing on the line. Also, "AarrayWithObjects" should be "arrayWithObjects", and that extra "=" in the middle of the line should be ":".</p> <pre><code> for(int i=0, i&lt;3, ++i;) { </code></pre> <p>Those commas are supposed to be semi colons</p> <pre><code> NSString *newText = [NSString stringWithFormat:@"%@", sufField, newsArray objectAtIndex: i]; </code></pre> <p>You only have one substitution modifier (<code>%@</code>), but you're trying to substitute in 2 values. Additionally, you need brackets around "<code>newsArray objectAtIndex:i</code>"</p> <pre><code> display.text=newText; </code></pre> <p>Hooray! A syntactically correct line! However, this is happening on <em>every</em> iteration of the loop. So every time you loop, you're changing the text of <code>display</code>. Are you sure that's what you want?</p> <pre><code> } </code></pre> <p>This is OK</p> <pre><code>} </code></pre> <p>This is OK too.</p> <p>In summary: learn the syntax.</p>
 

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