Send public Message with storyboard

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

Moderators: Lapo, Bax

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

Send public Message with storyboard

Post by brandonautry »

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: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Send public Message with storyboard

Post by Lapo »

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

Post by brandonautry »

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: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Send public Message with storyboard

Post by Lapo »

Great, cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply