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-2010, 04:32 AM   #1 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 57
Conor.Higgins is on a distinguished road
Default didReceiveRemoteNotification and Tab Bar App updating view controllers

Hi I have a question which I would imagine should be pretty straight forward but I'm stumped.

I am working with remote push notifications in a tab bar application. Each tab in the application has a navigation controller, each of which has a series of view controllers that are pushed and popped in different instances.

I have a home view controller which is shown on the first tab (index 0), and when it appears I am calling and parsing xml from an external php file, using the viewDidAppear method. Based on the xml data that is returned, the view controller changes graphically including the position of a slider, and a series of labels and images. This all works perfectly when I am clicking through the app so most of the hard work is done as far as I can see.

Each time I send a push notification to the app I want it to basically perform a similar task as the viewdidappear method. It would be very handy if I could just simply call the viewdidappear method again from inside the app delegate once the remote notification is received by the app but I can't figure out how to do this. I've tried setting up a public method and copying and pasting in the code I use in the viewDidAppear method but I am getting warnings like this:

instance variable 'example' accessed in class method

Has anyone got a suggestion for this? I am quickly approaching a very close deadline so if someone can help it would be really appreciated.
Conor.Higgins is offline   Reply With Quote
Old 10-06-2010, 04:03 AM   #2 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 2
Mikelsoft is on a distinguished road
Default

Hi Conor.Higgins,
have the same problem.... did you solve it already and if yes may I ask you how?
thanks a lot
cheers
Mikelsoft is offline   Reply With Quote
Old 10-06-2010, 04:15 AM   #3 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 57
Conor.Higgins is on a distinguished road
Default

Quote:
Originally Posted by Mikelsoft View Post
Hi Conor.Higgins,
have the same problem.... did you solve it already and if yes may I ask you how?
thanks a lot
cheers
Mikelsoft, I fixed this to an extent by using my app delegate to create a new instance of the viewcontroller I was trying to access and then calling the function I needed to access. This works fine for updating data and other things like that. What sort of method are you trying to call?

Conor
Conor.Higgins is offline   Reply With Quote
Old 10-06-2010, 09:00 AM   #4 (permalink)
Registered Member
 
Join Date: Jun 2010
Posts: 2
Mikelsoft is on a distinguished road
Default

Quote:
Originally Posted by Conor.Higgins View Post
Mikelsoft, I fixed this to an extent by using my app delegate to create a new instance of the viewcontroller I was trying to access and then calling the function I needed to access. This works fine for updating data and other things like that. What sort of method are you trying to call?

Conor
Hi Conor,
I want to update a tabbaritem.badgevalue of the tabbarcontroller with a method in the appdelegate. The error says: "instance variable 'tabBarItem1' accessed in class method"and "instance variable 'tabBarItem2' accessed in class method"
Appdelegate.h

@interface AppDelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> {
UIWindow *window;
UITabBarController *tabBarController;
UITabBarItem *tabBarItem1;
UITabBarItem *tabBarItem2;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
@property (nonatomic, retain) IBOutlet UITabBarItem *tabBarItem1;
@property (nonatomic, retain) IBOutlet UITabBarItem *tabBarItem2;
+ (void) updateBadgeValue;

Appdelegate.m

@synthesize tabBarController, tabBarItem1, tabBarItem2;

+ (void) updateBadgeValue
{
tabBarItem1.badgeValue = "Test1";
tabBarItem2.badgeValue = "Test2";
}

I try to call this from one of the two viewcontrollers by using:
[AppDelegate updateBadgeValue];

It looks like there is a problem with the +(void) !!??
Thanks for your help, Mikel
Mikelsoft is offline   Reply With Quote
Reply

Bookmarks

Tags
notification, tabbarcontroller

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: 347
12 members and 335 guests
2ndSegment, cgokey, djohnson, Domele, Hamad, markuschow, mistergreen2011, Objective Zero, pungs, revg, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

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