2011-02-24 246 views
0

我已經按照從 passing data between classes串到另一個視圖

做了教程,並且工作正常,但我真的需要發送一些字符串值(日期),另一種意見認爲,(很簡單,但我知道IM對於這個小白!),

  • ,所以我的問題是,我需要發送此字符串(日期),以另一種觀點認爲,該字符串是好的,但我不似乎得到(還)如何構造函數,

我沒有得到任何警告,但應用BRE AKS,

- (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); 

} 

控制檯消息

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

非常感謝!

回答

1

setString1是當你設定從你的錯誤屬性value.So這看起來像您在類CroTime屬性字符串1,但你沒有合成它它調用setter方法。

這種情況只發生在這種情況下。所以請確保在製作屬性時將其合成到.m文件中。

+0

+1我認爲@ishu在他的結尾是正確的......這種類型的錯誤信息是在ishu上面討論的條件中。 – Sudhanshu 2011-02-24 05:36:44

+0

非常感謝!!,就是這樣!,我在學習很多!,需要知道如何識別這個connsole消息......乾杯 – MaKo 2011-02-24 05:41:30

相關問題