Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 5    Views: 76

Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
12/22/12 11:35 PM (12 years ago)

How can I call game center from app delegate?

I'm trying to figure out how to call a game center leaderboard from the app delegate I've been able to do this successfully in menuButtons.m using this code - GKLeaderboardViewController *leaderboardController = [[GKLeaderboardViewController alloc] init]; if (leaderboardController != nil) { leaderboardController.leaderboardDelegate = self; leaderboardController.timeScope = GKLeaderboardTimeScopeToday; leaderboardController.category = @"leaderboard1"; [self presentViewController: leaderboardController animated: YES completion:nil]; } - but pasting that same code in the app delegate I get issues with using "self" - what is the alternative to "self" that I can use in the app delegate?
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
12/23/12 06:08 AM (12 years ago)
Do you want the button bring up the leaderboard once pressed.
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
12/23/12 09:08 AM (12 years ago)
Why do you want to call the leaderboard from the app delegate? I though the app delegate was just a place to control how the app works when it's initially loaded, loaded form, idle etc and stored global variables.
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
12/23/12 01:42 PM (12 years ago)
Yeah I want it to bring up the leaderboard - the reason I'm callin it in the app delegate is because my Game Center button is located in the navbar on the home menu I guess I could also do it from menu_buttons.m because that is the home menu screen - I'll have to give that a shot later
 
Kittsy
buzztouch Evangelist
Profile
Posts: 2251
Reg: Feb 22, 2012
Liverpool
31,360
like
12/23/12 02:19 PM (12 years ago)
I've got a plugin made that will do that it's basically a screen. It was made so it could be accessed from any button or menu. Pm me your email and I'll send it to you when I'm next at a computer
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
12/24/12 03:18 PM (12 years ago)
Thanks for the offer, but I did manage to get it working by calling it in menuButtons.m instead
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.