0

I've followed tutorial from passing data between classes

did it, and is working fine, but I really need to send some string value (a date) to another view, (is simple I know but Im a noob for this!),

  • so my problem is that I need to send this string (Date), to the other view, the string is ok, but I dont seem to get (yet)how to construct the function,

I get no warnings but the app breaks,

    - (void)calendarView:(KLCalendarView *)calendarView tappedTile:(KLTile *)aTile{
NSLog(@"Date Selected is %@",[aTile date]);

string1 = [[aTile date] description];
dateis.text = string1; //label to check string is working

NSLog(@"ahi va! %@", string1);

NSString *cucux = dateis.text;

CroTime *croco = [CroTime alloc];
croco.string1 = cucux;
[self.view addSubview:croco.view];

NSLog(@"croco = %@", cucux);

 }

Console message

   Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CroTime setString1:]: unrecognized selector sent to instance 0x5e2e1e0'

Thanks a lot!!

1 Answer 1

1

setString1 is a setter method which calls when you set a property value.So from your error this looks like you make a property string1 in class CroTime but you did not synthesize it.

This type of condition occur only in this case. so ensure that when you make property then synthesize it in .m file.

Sign up to request clarification or add additional context in comments.

2 Comments

+1 i think @ishu is right at his end ....this type of error message comes in the condition ishu had discussed above.
Thanks a lot!!, that was it!, Im learning a lot!, need to know how to recognize this connsole messages... cheers

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.