lastest api for ios

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

Moderators: Lapo, Bax

ywl1024
Posts: 2
Joined: 04 May 2012, 07:51

lastest api for ios

Postby ywl1024 » 04 May 2012, 08:47

hi Lapo Bax , when I use the lastest api 1.04, an error occured , pls help to figure out, thanks. the error message as below :

2012-05-03 17:33:31.692 BWOnline[7692:207] [SFS - INFO]SFS2X API version: 1.0.4
2012-05-03 17:33:31.740 BWOnline[7692:207] AppDelegate::onConfigLoadSuccess
2012-05-03 17:33:31.759 BWOnline[7692:207] cfg: [Host: 192.168.0.188 Port: 9933 Zone: Wang]
2012-05-03 17:33:31.761 BWOnline[7692:207] +[NSStream getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent to class 0x1867a6c
2012-05-03 17:33:31.765 BWOnline[7692:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSStream getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent to class 0x1867a6c'
*** Call stack at first throw:
(
0 CoreFoundation 0x017fabe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0194f5c2 objc_exception_throw + 47
2 CoreFoundation 0x017fc7bb +[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x0176c366 ___forwarding___ + 966
4 CoreFoundation 0x0176bf22 _CF_forwarding_prep_0 + 50
5 BWOnline 0x00106fad -[BitSwarmClient connect:port:] + 493
6 BWOnline 0x00136d1c -[SmartFox2XClient connect:port:] + 588
7 BWOnline 0x00136d7f -[SmartFox2XClient connect] + 79
8 BWOnline 0x000a3ee3 -[Client init] + 245
9 BWOnline 0x000a3bd3 +[Client sharedClient] + 72
10 BWOnline 0x0009903c -[SelectServerViewController viewDidLoad] + 165
11 UIKit 0x004d465e -[UIViewController view] + 179
12 BWOnline 0x0009882b -[BaseViewLayer init] + 298
13 BWOnline 0x000985a2 +[SceneManager goBaseView:] + 65
14 BWOnline 0x00003153 -[BWOnlineAppDelegate applicationDidFinishLaunching:] + 962
15 UIKit 0x00427253 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1252
16 UIKit 0x0042955e -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
17 UIKit 0x00433db2 -[UIApplication handleEvent:withNewEvent:] + 1533
18 UIKit 0x0042c202 -[UIApplication sendEvent:] + 71
19 UIKit 0x00431732 _UIApplicationHandleEvent + 7576
20 GraphicsServices 0x01ca2a36 PurpleEventCallback + 1550
21 CoreFoundation 0x017dc064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
22 CoreFoundation 0x0173c6f7 __CFRunLoopDoSource1 + 215
23 CoreFoundation 0x01739983 __CFRunLoopRun + 979
24 CoreFoundation 0x01739240 CFRunLoopRunSpecific + 208
25 CoreFoundation 0x01739161 CFRunLoopRunInMode + 97
26 UIKit 0x00428fa8 -[UIApplication _run] + 636
27 UIKit 0x0043542e UIApplicationMain + 1160
28 BWOnline 0x00002d66 main + 104
29 BWOnline 0x00002cf5 start + 53
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: lastest api for ios

Postby A51Integrated » 04 May 2012, 13:16

How are you calling the connect method? Can you post some code please?
A51 Integrated
http://a51integrated.com / +1 416-703-2300
ywl1024
Posts: 2
Joined: 04 May 2012, 07:51

Re: lastest api for ios

Postby ywl1024 » 05 May 2012, 00:50

A51Integrated wrote:How are you calling the connect method? Can you post some code please?


thanks A51,

- (id)init
{
Listener *listener = [Listener sharedListener];


if (self = [[SmartFoxiPhoneClient alloc] initSmartFoxWithDebugMode:YES delegate:listener])
{
[self loadConfig:@"config.xml" connectOnSuccess:NO];

self.logger.loggingLevel = LogLevel_DEBUG;
[self connect];
}

return self;
}
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: lastest api for ios

Postby A51Integrated » 05 May 2012, 01:29

You have to wait for the onConfigLoadSuccess event before you call connect.
http://docs2x.smartfoxserver.com/api-do ... oadSuccess:
A51 Integrated

http://a51integrated.com / +1 416-703-2300

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 40 guests