0

When I try to add some string values to a NSMutableArray it shows following exception.

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString addObject:]: unrecognized selector sent to instance

here is my code:

NSMutableArray *pTitle = [[NSMutableArray alloc]init];

code for adding object:

[pTitle addObject:txtTitle.text];

[dataBase setObject:pTitle forKey:@"Title"];

All I need to revoke the NSMutableArray. How can I resolve this... Thanks in advance for your Valuable helps...

Arun
  • 3,406
  • 4
  • 30
  • 55
  • search that pTitle is declared as NSString somewhere in class. – h.kishan Aug 21 '13 at 05:03
  • 1
    maybe you can show a little more code? because in what you provide it should be correct. Maybe after the init of pTitle you somehow assign it to some other dataType? – Joshua Aug 21 '13 at 06:01
  • Are you using ARC? What code is in between the creation and usage of the array? – Wain Aug 21 '13 at 06:09

0 Answers0