我有一個NSMutableArray,我加載了不同的對象(類)。循環遍歷一個NSMutableArray
現在我需要通過數組並獲得進一步操作的類。
我嘗試這種方法...
for (id obj in allPointsArray)
{
///// this is where i need to bring the obj into a class to work with
NSInteger loc_x = obj.x_coord;
NSInteger loc_y = obj.y_coord;
}
,但我不能讓我的頭周圍竟使類從數組中,並把它變成一個usuable對象。
x_coord和y_coord在存儲在數組中的所有對象之間是通用的。
感謝大家幫助
我想你可以得到類的類型,如果你使用[對象類]並將其與期望的類進行比較。但我不知道我是否正確地解決了問題...... – 2011-01-31 18:10:04