I am new to objective C. I am writing code for a coding competition. For that, I am writing code in my XCode IDE and I upload the code on their website. The code that works in my machine gives compiler errors on the website.
For e.g. A simple assignment of array element which works for me in XCode.
NSArray *itemArray;
NSString *feet;
feet = itemArray[0];
The above line generates error "incompatible types when assigning to type 'struct NSString *' from type 'struct NSArray'"
I have to use the following syntax to make it work.
feet = [itemArray objectAtIndex:0];
Similary, the for loop.
for (int i = 0; i <= count - 1; i++) {
<#statements#>
}
This gives error "for loop initial declarations are only allowed in C99 or C11 mode". I need to make the following change to make it work.
int i;
for (i = 0; i <= count - 1; i++) {
<#statements#>
}
Could anyone please advise how do I configure my XCode IDE so that I can write the code compatible with the compiler in the website?
Apparently, the supported version of Objective C on the website is GCC 4.4.5 I would like to know whether I can configure it in XCode