+[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent

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

Moderators: Lapo, Bax

mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

+[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent

Postby mmilen » 21 May 2019, 17:42

I'm succesful compiling Shark bridge with XCode Version 10.2.1 (10E1001) MacOS 10.14.4. At run time I get this crash when try to load confign and connect to my server instance. .

2019-05-21 13:32:20.850874-0400 SharkBridge Dev[26622:38272510] [SFS - INFO]SFS2X API version: 1.7.8
2019-05-21 13:32:20.851035-0400 SharkBridge Dev[26622:38272510] /Volumes/Time Machine/XCode/DerivedData/SharkBridge-geiyucqczlxixmdxisfqlbkplqxr/Build/Products/Debug/SharkBridge Dev.app/Contents/Resources/common.bundle/Contents/Resources/data/config_sfs.xml
2019-05-21 13:35:41.621562-0400 SharkBridge Dev[26622:38272510] +[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent to class 0x7fff991f3ff0
2019-05-21 13:35:41.622179-0400 SharkBridge Dev[26622:38272510] [General] +[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent to class 0x7fff991f3ff0
2019-05-21 13:35:41.622685-0400 SharkBridge Dev[26622:38272574] [] nw_socket_handle_socket_event [C5.1:1] Socket SO_ERROR [54: Connection reset by peer]
2019-05-21 13:35:41.625549-0400 SharkBridge Dev[26622:38272510] [General] (
0 CoreFoundation 0x00007fff412c1cf9 __exceptionPreprocess + 256
1 libobjc.A.dylib 0x00007fff6be55a17 objc_exception_throw + 48
2 CoreFoundation 0x00007fff4133ba56 __CFExceptionProem + 0
3 CoreFoundation 0x00007fff412640ef ___forwarding___ + 1485
4 CoreFoundation 0x00007fff41263a98 _CF_forwarding_prep_0 + 120
5 SFS2XAPIOSX 0x0000000100ebcc2b -[BitSwarmClient connect:port:] + 731
6 SFS2XAPIOSX 0x0000000100efa537 -[SmartFox2XClient connect:port:] + 679
7 SFS2XAPIOSX 0x0000000100ef9fe6 -[SmartFox2XClient onConfigLoadSuccess:] + 582
8 SFS2XAPIOSX 0x0000000100ec23a8 -[ConfigLoader loadConfig:delegate:] + 2184
9 SFS2XAPIOSX 0x0000000100efa64c -[SmartFox2XClient loadConfig:connectOnSuccess:] + 156
10 SharkBridge Dev 0x00000001002df555 -[SmartFoxCommunicator loadConfig:connectOnSuccess:] + 853
11 SharkBridge Dev 0x00000001004e9cd5 -[OnlineViewController awakeFromNib] + 2869
12 AppKit 0x00007fff3e889563 -[NSIBObjectData nibInstantiateWithOwner:options:topLevelObjects:] + 1656
13 AppKit 0x00007fff3ea1a7ff -[NSNib _instantiateNibWithExternalNameTable:options:] + 679
14 AppKit 0x00007fff3ea1a45b -[NSNib _instantiateWithOwner:options:topLevelObjects:] + 136
15 AppKit 0x00007fff3ea196c5 -[NSViewController loadView] + 343
16 AppKit 0x00007fff3ea155b4 -[NSViewController _loadViewIfRequired] + 72
17 AppKit 0x00007fff3ea15522 -[NSViewController view] + 30
18 SharkBridge Dev 0x0000000100280016 -[MainWindowController showOnlineClub:] + 1062
19 AppKit 0x00007fff3eb83e80 -[NSApplication(NSResponder) sendAction:to:from:] + 312
20 AppKit 0x00007fff3ebee196 -[NSControl sendAction:to:] + 86
21 AppKit 0x00007fff3ebee0c8 __26-[NSCell _sendActionFrom:]_block_invoke + 136
22 AppKit 0x00007fff3ebedfca -[NSCell _sendActionFrom:] + 178
23 AppKit 0x00007fff3ec1ad4f -[NSButtonCell _sendActionFrom:] + 96
24 AppKit 0x00007fff3ebec8e5 -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2375
25 AppKit 0x00007fff3ec1aaa0 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 698
26 AppKit 0x00007fff3ebeb322 -[NSControl mouseDown:] + 791
27 SharkBridge Dev 0x00000001003c18e8 -[SharkButton mouseDown:] + 120
28 AppKit 0x00007fff3eac716f -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 5724
29 AppKit 0x00007fff3e9fd9de -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2295
30 AppKit 0x00007fff3e9fce9f -[NSWindow(NSEventRouting) sendEvent:] + 478
31 AppKit 0x00007fff3e89c6c3 -[NSApplication(NSEvent) sendEvent:] + 331
32 AppKit 0x00007fff3e88aee8 -[NSApplication run] + 755
33 AppKit 0x00007fff3e87a3f0 NSApplicationMain + 777
34 SharkBridge Dev 0x0000000100233e22 main + 34
35 libdyld.dylib 0x00007fff6d6833d5 start + 1
)
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: +[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent

Postby Lapo » 22 May 2019, 15:39

We have tested on XCode 10.1 using all kinds of combination of iOS targets and simulators with iOS version from 10.x to 12.x and we are not able to see any issues.

What is your iOS Deployment target and what is the version of iOS you're using for testing?

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: +[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent

Postby mmilen » 22 May 2019, 15:46

The issue is with the MacOS framework. I'm building for Mac OS 10.10 or newer.
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: +[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent

Postby Lapo » 22 May 2019, 17:02

Ok. Sorry, since you posted under the iPhone/iOS section, this wasn't clear.
The problem seems confirmed under OSX. We should be able to send you an update to test soon.

I'll post the link here when it's ready.
Lapo

--

gotoAndPlay()

...addicted to flash games
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: +[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent

Postby Lapo » 23 May 2019, 09:08

Please download the update from here.
Let us know if it fixes the issue.

We'll be releasing the official update soon as well.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: +[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent

Postby mmilen » 25 May 2019, 02:07

Indeed it has corrected the issue. As we are at it, when I get new update I have to alwasy run this script to fix the framework location at runtime, it might be something you want to look at.

install_name_tool -id @executable_path/../Frameworks/SFS2XAPIOSX.framework/SFS2XAPIOSX path_to_framework/SharkBridge/SFS2XAPIOSX.framework/SFS2XAPIOSX
User avatar
Lapo
Site Admin
Posts: 22999
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: +[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent

Postby Lapo » 25 May 2019, 06:33

Hi,
I am not sure what you mean that. The framework should go in your Library folder, as it is the default path for OSX.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
mmilen
Posts: 298
Joined: 09 Nov 2010, 00:48
Contact:

Re: +[NSStream qNetworkAdditions_getStreamsToHostNamed:port:inputStream:outputStream:]: unrecognized selector sent

Postby mmilen » 28 May 2019, 19:38

In a distribution the framework is included in the .app bundle Frameworks folder, but when the App is running ensuring it is copied to the /Library folder could be a challenge, permission, sandboxing ect. Plus some other App might over-write it with incompatible version. So the library is package with the executable in .app bundle. The only way I could make is work is to run the command i posted after I download new version of the framework. I'm not sure what it does exactly but one thing it changes the the location where the Framework is expected to the .App bundle.

I just saw there is a new topic about it and responded with the command I have found to work well a while ago.

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 10 guests