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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 07-08-2009, 08:51 PM   #26 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: Setauket, NY
Posts: 133
Default

Quote:
Originally Posted by mnemonic_fx View Post
What's the dreaded message ?
I'm getting an objc_msgSend at runtime in one of my methods when I pop my last view from the navController. So I think assigning the delegate is forcing the reload 'cause I think all of my methods are firing again.
So I'm going to investigate this and let you know.

It would seem that the following code is getting executed for every view controller which I guess it should:
Code:
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
	if ([viewController isKindOfClass:[UITableViewController class]])
	{
		UITableViewController *controller = (UITableViewController *)viewController;
		[controller.tableView reloadData];
	}
}
The problem is that I don't want every table in every view to be reloaded - just my SubscriptionDetailController. Is there any way to select that view to reload? Like, is there a way to determine which class is currently executing?
Also, one of my local variables is going out of scope. I'm not sure why, but I need to only reload just a particular table view controller. So how can I find out which view controller/class is executing? That's what I need to key off of for the reloadData.
Thanks!

Last edited by hstaniloff; 07-08-2009 at 09:56 PM.
hstaniloff is offline   Reply With Quote
Old 07-09-2009, 07:42 AM   #27 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: Setauket, NY
Posts: 133
Default

Quote:
Originally Posted by hstaniloff View Post
I'm getting an objc_msgSend at runtime in one of my methods when I pop my last view from the navController. So I think assigning the delegate is forcing the reload 'cause I think all of my methods are firing again.
So I'm going to investigate this and let you know.

It would seem that the following code is getting executed for every view controller which I guess it should:
Code:
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
	if ([viewController isKindOfClass:[UITableViewController class]])
	{
		UITableViewController *controller = (UITableViewController *)viewController;
		[controller.tableView reloadData];
	}
}
The problem is that I don't want every table in every view to be reloaded - just my SubscriptionDetailController. Is there any way to select that view to reload? Like, is there a way to determine which class is currently executing?
Also, one of my local variables is going out of scope. I'm not sure why, but I need to only reload just a particular table view controller. So how can I find out which view controller/class is executing? That's what I need to key off of for the reloadData.
Thanks!
I figured out my runtime problem and that's fixed. And my table refreshes!! The sweet taste of success. Thanks for your help.
But is there a way to identifier the current tableview so I can reload that table only?
hstaniloff is offline   Reply With Quote
Old 07-09-2009, 12:59 PM   #28 (permalink)
jsd
at this moment
 
Join Date: Mar 2009
Location: San Francisco, CA
Posts: 900
Default

Quote:
Originally Posted by hstaniloff View Post
Is there any way to select that view to reload? Like, is there a way to determine which class is currently executing?
All view controllers are always executing. Just because they aren't visible doesn't mean they aren't running. They only stop running when they are dealloced.
jsd is offline   Reply With Quote
Old 07-09-2009, 01:50 PM   #29 (permalink)
Registered Member
 
mnemonic_fx's Avatar
 
Join Date: Jun 2008
Posts: 419
Default

To run a more restrictive check.

Code:
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
	if ([viewController isKindOfClass:[SubscriptionDetailController class]])
	{
		SubscriptionDetailController *controller = (SubscriptionDetailController *)viewController;
		[controller.tableView reloadData];
	}
}
If you assign to the delegate of navigation controller from the exact subscription detail controller instance, I think it won't invoke that method in other controllers.
__________________
Visit Me

Writing code is not only about writing instructions to a machine / computer, but also about writing something that could be read, understood, and maintained by others. That's why, I like Cocoa.
mnemonic_fx is offline   Reply With Quote
Old 07-09-2009, 02:15 PM   #30 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: Setauket, NY
Posts: 133
Thumbs up

Quote:
Originally Posted by mnemonic_fx View Post
To run a more restrictive check.

Code:
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
	if ([viewController isKindOfClass:[SubscriptionDetailController class]])
	{
		SubscriptionDetailController *controller = (SubscriptionDetailController *)viewController;
		[controller.tableView reloadData];
	}
}
If you assign to the delegate of navigation controller from the exact subscription detail controller instance, I think it won't invoke that method in other controllers.
That did it!!!! Wow. Works great. Thanks for the learning experience and the help. You're my hero.
hstaniloff is offline   Reply With Quote
Reply

Bookmarks

Tags
refresh, uitableview, uitoolbar

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: 276
22 members and 254 guests
ADY, Bertrand21, Dani77, fkmtc, HemiMG, iDifferent, IphoneSdk, jakerocheleau, JasonR, jimbo, macquitzon216, MACralik, mer10, NSeven, prchn4christ, Rudy, silverwiz, spiderguy84, Sunny46, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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