Reputation: 737
I have a strange error.
MyController A
{
@ syntesize myUITextView;
}
MyController B {
MyControllerA *controller = ....
NSSTring *myString = " hello";
controller.myUITextView.text = myString;
NSLog(@"%@",myUITextView.text) = (null)
NSLog(@"%@",myString) = hello
}
when i print controller.myUITextView it's null, what i am doing wrong, please ?
thanks four your answers
Upvotes: 0
Views: 551
Reputation: 8583
NSSTring *myString = " hello";
"hello"
is not an ObjectiveC string, it's a C string. You should add @
before like this: @"hello"
Upvotes: 1
Reputation: 2230
Are you sure that you initialize myUITextView
in MyController A
(or bind it in Interface Builder) properly? Seems like controller.myUITextView
is nil.
Upvotes: 0
Reputation: 2106
It looks like you're not logging what you think you're logging. This line...
NSLog(@"%@",myUITextView.text);
is missing the controller variable prefix so it should be:
NSLog(@"%@",controller.myUITextView.text);
Upvotes: 0
Reputation: 26390
NSString *myString = @"hello";
controller.myUITextView.text = myString;
NSLog(@"%@",controller.myUITextView.text) ;
NSLog(@"%@",myString);
Try this
Upvotes: 0