我是有myclass.m 4個陣列問題正從一個級陣列到另一個類
我需要得到這些陣列到myclassviewcontroller.m
對於我像myclassviewcontroller.m編寫代碼這個。
- (void)resultarrays :(NSMutableArray *)Agentids loanofficerid:(NSMutableArray *)Loanofficerid agentname:(NSMutableArray *)agentname agentemail:(NSMutableArray *)agentemail agentphone:(NSMutableArray *)Agentphone {
agentids = [[NSMutableArray alloc] initWithObjects:Agentids,nil];
loanofficerid = [[NSMutableArray alloc] initWithObjects:Loanofficerid,nil];
agentnames = [[NSMutableArray alloc] initWithObjects:agentname,nil];
agentemails = [[NSMutableArray alloc] initWithObjects:agentemail,nil];
agentphone = [[NSMutableArray alloc] initWithObjects:Agentphone,nil];
NSLog(@"123 %@",agentids);
NSLog(@"123 %@",loanofficerid);
NSLog(@"123 %@",agentnames);
NSLog(@"123 %@",agentphone);
}
在myclass.m我寫這篇文章
myclassviewcontroller *LOVobj = [[myclassviewcontroller alloc]init];
[LOVobj resultarrays:resultData_agent loanofficerid:array1 agentname:array2 agentemail:array3 agentphone:array4];
然後它會顯示我在控制檯打印的所有對象。
在此之後,在按鈕單擊我打印這些數組,然後它打印空。
即使我給它分配setter和getter方法。
我沒有什麼問題可以任何人請幫助我。
謝謝你提前。
查看按鈕單擊後打印的代碼會很有幫助。 – Bogatyr 2011-02-15 10:33:14