Objective-C count for array that was/is a sub array fails? -
nslog(@"size of array: %i", ([historicdatesarray [23] count])); historicdatesarray [23] = historicdatesarray [23][1]; nslog(@"size of array: %i", ([historicdatesarray [23] count]));
as second nslog tries execute:
terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nscfstring count]: unrecognized selector sent instance 0x728c7f0'
historicdatesarrray nsmutablearray. can read(nsstring) contents of historicdatesarray[23], can't count elements?
i no longer need object @ historicdatesarray[23][0] , want assign object @ historicdatesarray[23][1] historicdatesarray[23], tested , works, why can't use 'count' size of array?
how can convert 2d nsmutablearray 1d nsmutablearray?
i think problem historicdatesarray [23] no more array .it holding string value , wont have count property.that makes issue
firstline:
object @ historicdatesarray index 23 array,it has values [23][1] ,[23][2]...etc
so have value count operation
nslog(@"size of array: %i", ([historicdatesarray [23] count]));
the value @ historicdatesarray [23][1] string.
second line:
historicdatesarray [23] = historicdatesarray [23][1];
here changing value of array index [23] array string.and hence there no more array @ index [23] .it represent string value
third line:
nslog(@"size of array: %i", ([historicdatesarray [23] count]));
trying log count property array,but value @ index 23 string , hence crash
Comments
Post a Comment