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

2

2 Answers 2

0

Try with this:

[NSString stringWithFormat:@"%@", yourtextField.text];
Sign up to request clarification or add additional context in comments.

1 Comment

when i am adding empty space in between i get response
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.

2 Comments

1.NSTaggedPointerString
2.__NSCFConstantString

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.