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 09-22-2011, 02:04 PM   #1 (permalink)
Registered Member
 
Join Date: Apr 2011
Posts: 44
XaKaX is on a distinguished road
Default How do I..

People, How can I refresh the table from the RootViewController in the Split View Based Application ?

The class is UITableViewController, so I don't have an IBOutlet for do [reloaddata]


Thanks.
XaKaX is offline   Reply With Quote
Old 09-22-2011, 02:13 PM   #2 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 194
mavrik5150 is on a distinguished road
Default

If it's just another TableViewController that you have then you should just be able to do: [OtherView.tableView reloadData]. As long as you are importing it and creating the OtherView reference this should work.
mavrik5150 is offline   Reply With Quote
Old 09-22-2011, 02:57 PM   #3 (permalink)
Cocoa Junkie
 
Duncan C's Avatar
 
Join Date: Dec 2008
Location: Northern Virginia
Posts: 6,003
Duncan C has a spectacular aura about
Default

Quote:
Originally Posted by mavrik5150 View Post
If it's just another TableViewController that you have then you should just be able to do: [OtherView.tableView reloadData]. As long as you are importing it and creating the OtherView reference this should work.
GACK!!!!!

Bad, bad advice.

One view controller should never muck around with the views inside another view controller. This creates tight coupling between the view controllers, and completely violates the encapsulation that is important to good object-oriented design.

Instead, you should add a method to the view controller that owns the table view, called something like dataChanged. Then the view controller can issue a reload command to it's table view if it sees fit to do so.
__________________
Regards,

Duncan C
WareTo

Check out our apps in the Apple App store


Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.

See this tutorial on using UIView animations and layer animations:

See this thread on generating random, non-repeating text

Check out a very cool Macintosh Kaleidoscopes app called ScopeWorks that we released to the Mac App store.
Duncan C is offline   Reply With Quote
Old 09-22-2011, 03:07 PM   #4 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 194
mavrik5150 is on a distinguished road
Default

Quote:
Originally Posted by Duncan C View Post
GACK!!!!!

Bad, bad advice.

One view controller should never muck around with the views inside another view controller. This creates tight coupling between the view controllers, and completely violates the encapsulation that is important to good object-oriented design.

Instead, you should add a method to the view controller that owns the table view, called something like dataChanged. Then the view controller can issue a reload command to it's table view if it sees fit to do so.
But I thought that in a split view it's basically a tableview on one side and another view on the other? I've never used a splitview yet so I just assumed that's how it would have worked.

In my apps I normally do what you provided and run it in viewwillappear to see if the table needed to be reloaded. Maybe I should play with the splitview some more before I start assuming how it works. Thanks.
mavrik5150 is offline   Reply With Quote
Reply

Bookmarks

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: 392
14 members and 378 guests
7twenty7, eski, EvilElf, HemiMG, iOS.Lover, jarv, n00b, pbart, Pudding, sacha1996, Sami Gh, UMAD, VinceYuan, yuncarl28
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,672
Threads: 94,121
Posts: 402,905
Top Poster: BrianSlick (7,990)
Welcome to our newest member, yuncarl28
Powered by vBadvanced CMPS v3.1.0

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