Search code examples
ios6nslog

Why am I getting this when I do a NSLog?


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?


Solution

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