0
NSString *qry=@"UPDATE TABLE USERBASIC SET F_NAME='%@',M_NAME='%@',L_NAME='%@' WHERE REGISTRATIONID='%@'";
NSString *updtQuery=[[NSString alloc] stringWithFormat:qry,fname.text,mname.text,lname.text,userInformationId];
NSLog(@"try UPDATE %@:",updtQuery);

this gives invalid argument exception.. :(

Gabe
  • 84,912
  • 12
  • 139
  • 238
rptwsthi
  • 10,094
  • 10
  • 68
  • 109

2 Answers2

4

This:

[[NSString alloc] stringWithFormat...]

stringWithFormat is a class method; you use it as [NSString stringWithFormat: ...]

See also:

Community
  • 1
  • 1
Steven Fisher
  • 44,462
  • 20
  • 138
  • 192
3

Try this

NSString *updtQuery=[NSString stringWithFormat:qry,fname.text,mname.text,lname.text,userInformationId];

or

NSString *updtQuery=[[NSString alloc] initWithFormat:qry,fname.text,mname.text,lname.text,userInformationId];
visakh7
  • 26,380
  • 8
  • 55
  • 69