开发者

how to implemet database logic in tableview to controll rows information?

My meaning is i want to implement the table from where i will get data from the database.I store all the data into database now the problem is i am not able to show this data in tableView as describe below.Also you can see the example that i want to develop table like chipottle Chipottle app. There is a bag for created order list information.If you do not get my question then please see the chipottle app just create order it will store into bag in main view click on bag button you will see one table with all your created order information and in last subtitle.Please See the app it's totally free i really stuck into this problem so please try to help me.

I stored 10 fields in database Ordername ={Order1,Order2}

category = {category1,category2}

submenu1 = {{sub00,sub01,sub02},{sub11,sub12}}

price1 = {{$2,$3.1,$4.2},{$7.85,$2.3}}

submenu2 = {{sub21,sub22,sub23,sub24},{sub31,sub32}}

price2 = {{$2.2开发者_StackOverflow,$4.5,$7.7,$3.2},{$4.4,$1.3}}

drinkmenu = {pepsi,pepsi1,soda,lemon,pinaplesoda}

dirnkprice = {$4.4,$8.5,$3.7,$2.8,$3.4}

I count the no. of section like = [Ordername count] .also able to display the section title as per the Ordername.

Now i want to display category ,submenu1,price1,submenu2,price2 all at Zero(0) index means (at indexpath.row = 0) all value as per the Ordername.

and for drinkmenu it is display on different different indexpath.row but after at zero index.

Thank You. Please it is very urgent.


go through following link you will have your work done.

http://blog.webscale.co.in/?p=284

It is customization of UITableViewCell.

Hope it helps.


All you've got to do, is create a special order tableViewCell and put in your data, show it for indexPath.row == 0 only. Here is some example code:

- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)anIndexPath
{
    // sectioning logic here...

    if(anIndexPath.row == 0) {
        // Helper to create a fresh cell, implements dequeueing
        OrderTableViewCell *cell = [TableViewCellFactory orderTableViewCell:aTableView];

        // pass on the cell to do fill in data
        [self configureOrderCellWithCell:cell andIndexPath:anIndexPath];

        return cell;
    } else {
        // process other cells
    }
}

- (void)configureVideoClipCellWithCell:(VideoClipTableViewCell *)aCell andIndexPath:(NSIndexPath *)anIndexPath
{
    // get model at current indexPath
    Order *order = [orders objectAtIndex:anIndexPath.row];

    // publish data in cell
    aCell.category.text = order.category;
    aCell.submenu1.text = order.submenu1;
    aCell.price1.text = order.seprice1rie;
    aCell.submenu2.text = order.submenu2;
    aCell.price2.text = order.price2;   
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜