ios - NSMutableArray always converting to NSArray -


i have nsmutablearray did initialisation follows:

@interface countries () {     nsmutablearray *arrayofcountry; } @end   - (void)viewdidload {        //...        arrayofcountry=[[nsmutablearray alloc]init];        //... } 

then wanted apply removeobjectatindex nsmutablearray:

[arrayofcountry removeobjectatindex:sourcerow]; 

the problem is crashing log:

-[__nsarrayi removeobjectatindex:]: unrecognized selector sent instance 

i verified with:

nslog( nsstringfromclass( [arrayofcountry class] )); 

and it's returning __nsarrayi. question how converted nsarray? i'm populating with:

arrayofcountry=[json valueforkeypath:@"country_name"]; 

thank help.

try this. create new nsmutablearray based on contents of other array.

arrayofcountry = [nsmutablearray arraywitharray:[json valueforkeypath:@"country_name"]]; 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -