views:

156

answers:

3
+1  A: 

It's because your UITextField object is somehow assigned to a variable/property which is not supposed to be a UITextField.

It can happen in many different ways.

  1. You might have connected the IB outlet incorrectly. Check your nib in the Interface Builder to see your UITextField is not connected to something strange.
  2. You might have just assigned an UITextField to a variable of a different type. In that case, the compiler should have given you a warning. Correct your code and remove all the warnings.
  3. You might have not correctly done retain/release. Do "build and analyze", and remove all warnings.
Yuji
+2  A: 

It seems that isNaturallyRTL is an (undocumented) NSString method. At least NSString responds to it.

This may mean that you assign a UITextField to some variable, where you should put in an NSString instead.

BTW: 0x3947fe0 is the pointer to the UITextField that should be an NSString, so if you're totally lost, try to find out which UITextField has that address (e.g. by a dumb NSLog("tf X: 0x%x",tfx);)

mvds
When I try to run that it says that tfx is undeclared.
Phenom
you should put in your own `UITextField` variables for `tfx` (I don't know how you named them)
mvds
+1  A: 

I found the problem. It was in this line of code:

[tempValues setObject:textFieldBeingEdited forKey:tagAsNum];

I changed it to the following:

[tempValues setObject:textFieldBeingEdited.text forKey:tagAsNum];

and that's what fixed it.

Phenom
So there's your `UITextField` instead of `NSString` assignment!
mvds
Incidentally, this is why the text-field naming pattern of “nameText”, which I see so frequently in others' questions here on Stack Overflow, is a bad idea.
Peter Hosey