1

i am trying to load textfield value in to mutable array using add object method but that value is not in string formate.i enter the array structure in below. thank you.

  {
     ItemUPC = rr001;   ------->>>>>in this place       
    ItemUnits = "";
    Itemcost = "";
 } 

i expected this structure

{
     ItemUPC = "rr001";   ------->>>>>in this place       
    ItemUnits = "";
    Itemcost = "";
 } 

thankyou

Barani
  • 84
  • 1
  • 1
  • 12

2 Answers2

0

Try with this:

[NSString stringWithFormat:@"%@", yourtextField.text];
Sijmen Mulder
  • 5,767
  • 3
  • 22
  • 33
Amit Ajmera
  • 1,387
  • 10
  • 15
0

in both cases it IS actually a string. the problem is that NSLog() only shows the "" signs if it is an empty string or if there are some spaces within the string!

you can check it like this:

for (id object in yourArrayName) {
  NSLog(@"%@", [object class]);
}

if the object IS a string it should say something like __NSCFConstantString.

André Slotta
  • 13,774
  • 2
  • 22
  • 34