Frage

This is the line of code for my NSLog:

    NSLog(@"\n\noCLientFirstName: %@\nlastName: %@\nconcatenatedName: %@",oClientFirstName, lastName, concatenatedName);

Why am I getting output that looks like this?

oCLientFirstName: <UITextField: 0xefe0330; frame = (394 293; 160 30); text = 'Bob'; clipsToBounds = YES; opaque = NO; autoresize = TM+BM; gestureRecognizers = <NSArray: 0xefe12d0>; layer = <CALayer: 0xefe0120>>

lastName: <UITextField: 0xef05bd0; frame = (20 40; 260 40); text = 'Jones'; clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0xef057c0>; layer = <CALayer: 0xef05ba0>>

concatenatedName: Bob<UITextField: 0xef05bd0; frame = (20 40; 260 40); text = 'Jones'; clipsToBounds = YES; opaque = NO; gestureRecognizers = <NSArray: 0xef057c0>; layer = <CALayer: 0xef05ba0>>

I have NEVER had this issue before; the output should look like this:

oClientFirstName: Bob
lastName: Jones
concatenatedName: BobJones

What's going on?

War es hilfreich?

Lösung 2

This looks like you are passing UITextField objects to your log function rather than NSStrings. Double check the types and adjust your code accordingly.

Andere Tipps

%@ format specifier in NSLog will call the following methods in order on the object parameter for the position. debugDescription description

You're getting the result of that for the objects.

NSLog(@"\n\noCLientFirstName: %@\nlastName: %@\nconcatenatedName: %@",oClientFirstName.text, lastName.text, concatenatedName.text);

this is the solution of your question :)

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