Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-14-2011, 02:29 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Location: New Zealand
Posts: 49
jvpython is on a distinguished road
Send a message via Skype™ to jvpython
Post Inserting new row in custom table view

Hello,
I tried the usual way of adding new rows to a table in my custom table view

Code:
[tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationRight];
But the app crashes, it seems that this isn't the way to add new custom cells to the table. What is the right method to do this?
Thank you

JVPython
jvpython is offline   Reply With Quote
Old 02-14-2011, 02:45 AM   #2 (permalink)
Registered Member
 
Join Date: Oct 2009
Location: Amsterdam, The Netherlands
Posts: 782
TUX2K is on a distinguished road
Default

Aad the row to your data source.
Then call the UITableView updateData method.

the [tableView insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationRight] is for animation only not for adding a row.
__________________
If my answer helped you, you might want to help me.
Make a donation via PayPal.
TUX2K is offline   Reply With Quote
Old 02-14-2011, 03:07 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Location: New Zealand
Posts: 49
jvpython is on a distinguished road
Send a message via Skype™ to jvpython
Default

Ok I see what you mean. But what is that update data method you were talking about?
jvpython is offline   Reply With Quote
Old 02-14-2011, 03:34 AM   #4 (permalink)
Registered Member
 
Join Date: Oct 2009
Location: Amsterdam, The Netherlands
Posts: 782
TUX2K is on a distinguished road
Default

that is the method that you call in the tableview to let it update the the data from the data source.

If you want the use the insertRow method you call the beginupdate method on table isert your row in the datasource and then call the insertRow method and finish update.
__________________
If my answer helped you, you might want to help me.
Make a donation via PayPal.
TUX2K is offline   Reply With Quote
Reply

Bookmarks

Tags
custom cell, iphone, table view

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 376
9 members and 367 guests
chemistry, cpsclicker, daudrizek, jeroenkeij, Kirkout, PavelMik, teebee74, whitey99
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,666
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, cpsclicker
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:04 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0