我正在使用PhoneGap開發iOS混合應用程序。將數組從本地傳遞到混合視圖
我的問題
我創建一個數組,我要發送到混合視圖在本機代碼數據。
這裏是我的代碼,
的index.html
function myJavascriptFunction (obj){
var array = new Array();
array = obj;
console.log(array);
}
objective.m
{
array =[[NSArray alloc]initWithObjects:@"1",@"2",@"3",@"4", nil];
[[NSNotificationCenter defaultCenter]postNotificationName:@"NotificationCalled" object:array];
}
如何從原始數據傳遞到混合動力的看法?
你不能用'NSNotificationCenter'做到這一點。您必須創建自定義插件才能實現此目的。 –
嗨Bhumeshwer,可以告訴我該怎麼做。我是新來的電話差距 – Siva