objective c - Array not retaining properly? -


After

I get the following error when running my application:

2011-09-02 15 : 38: 44.157 TheApp [9973: 207] - [NSCFNumber isEqualToString:]: 38 :: 44.160 TheApp [9973: 207] *** End Unrecognized Selector Example 0x4b28990

2011-09-02 15 The application sent for 'NSInvalidArgumentException', due to reason: -

'[NSCFNumber isEqualToString:] Non-recognized selector example sent for 0x4b28990' and Xcode in green color Line marks in this function:

  - (zero) E) oneCheckAndSetStrokes {playerOneScoreNum.text = [playerOneScore objectAtIndex: (11)]; }   

So I think that something has been messed up with the arrows. After som research I came across a lot of such posts. Which is inticate that error occurs when the array seems to be properly maintained (hence my title)

Then I'm trying to maintain the array in the file being started (The way the above file is not the same as the code. The arrays are also defined in other files, and then imported), in the following manner:

  - ( Zero) viewDidoadload [[Super Viewedload]; PlayerOneScore = [[NSMutableArray alloc] initWithCapacity: 1 9]; [PlayerOneScore maintained]; }   

The problem will be solved according to the earlier referenced, but in my case it is not so. Has anyone suffered similarly? It seems that I'm missing something trivial.

Thank you, Tobias Tiddle "post-text" itemprop = "text">

You have nothing to do with maintaining an error, The reason has been found in this line:

  playerOneScoreNum.text = [playerOneScore objectIntindex: (11)];   

You are trying to set the string properties by using a number object! You will need to use "stringValue" in this way:

  playerOneScoreNum.text = [[playerOneScore objectAtexX: 11] stringValue];   

ps: wrapping index with parentheses (11) is useless: p

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -