Frage

I have one UITextField and it's referencing outlet name title. when i use title as a outlet it crashes my application. and gives error [UITextField isEqualToString] NSInvalidArgument etc.

and when I use titles it work fine. I search more in google for reserved words in ios and there i not found that title is a reserved word. so please anybody knows about this simple issue than please share it with me. I know this is simple issue but I'm new in ios development and right now I'm trainee developer so for me this is a big issue because I want to know why this title word as a referencing outlet not working.

Thank You!

War es hilfreich?

Lösung

Assuming you are doing this on a class that extends UIViewController, the problem is that UIViewController already has a property named title with a type of NSString.

By adding an outlet for a UITextField with a name of title, you are creating a conflict with the NSString property named title.

Simply give your outlet a name that doesn't conflict with an existing property name.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top