manuelBetancurt
manuelBetancurt

Reputation: 16138

string to another view

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!),

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!!

Upvotes: 0

Views: 98

Answers (1)

Ishu
Ishu

Reputation: 12787

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.

Upvotes: 1

Related Questions