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!),
- 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 warning开发者_C百科s 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!!
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.
精彩评论