我試圖從數據庫中獲取數據到幻燈片菜單。我正在使用下面的代碼來獲取數據,並且需要連接到UI中存在的按鈕。如何通過數組快速傳遞數據到按鈕
func fetchiingcontact()
{
var allusers:NSMutableArray = NSMutableArray()
allusers = ModelManager.getInstance().getAlldrawerData()//Fetching contacts objects from Sqlite
for var i = 0 ; i < allusers.count ; i++
{
var userobject : user = user()
userobject = allusers.objectAtIndex(i) as! user
let contactobjectuser:UserContactsClass = UserContactsClass()
let userdefault = NSUserDefaults.standardUserDefaults()
let ownuserid = userdefault.integerForKey("Userid")
if(userobject.userid == ownuserid)
{
}
else
{
contactobjectuser.firstName = userobject.firstName
contactobjectuser.lastName = userobject.lastName
contactobjectuser.profilePic = userobject.profilePic
contactobjectuser.nickName = userobject.nickName
usercontactslistarray.addObject(contactobjectuser)
self.secondLabel.text = contactobjectuser.lastName
self.userFlname.text = contactobjectuser.firstName
}
}
我如何通過代碼usercontactslistarray連接到UI按鈕爲self.secondlabel.text不工作
你似乎不與SQLite或獲取數據有關。這部分看起來很好。 – rmaddy