Send public Message with storyboard

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

brandonautry
Posts: 8
Joined: 11 Dec 2013, 08:37

Send public Message with storyboard

Postby brandonautry » 11 Dec 2013, 15:21

I'm having a problem with the simpleChat example. While the example uses xib's and I am using the storyboard I believe this is where my problem is.
- (void)onPublicMessage:(SFSEvent *)evt
{
NSLog(@"AppDelegate::onPublicMessage");
ChatViewController * cvc = (ChatViewController *)_viewController;
if ([cvc respondsToSelector:@selector(onPublicMessage:)])
{
[cvc onPublicMessage:evt];
}
}
The onPublicMessage event method in the appDelegate is called when i debug however it never is called on the chatViewController. So my scrollView never has the messages loaded. :?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Send public Message with storyboard

Postby Lapo » 12 Dec 2013, 14:43

This is not very related to the SFS API in itself, but more on how you have organized your views in the code. It's pretty difficult to guess what might be wrong.
We do have an example that uses the Storyboard and it's this one:
http://docs2x.smartfoxserver.com/ExamplesIOS/signup

I'd suggest to take a look and see how we organized the code there.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
brandonautry
Posts: 8
Joined: 11 Dec 2013, 08:37

Re: Send public Message with storyboard

Postby brandonautry » 26 Jan 2014, 22:00

I was able to figure it out! I didn't understand how it worked, after some research I now understand the api. Thank you!
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Send public Message with storyboard

Postby Lapo » 28 Jan 2014, 09:46

Great, cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 22 guests