Comments (6)
I'm confused, the library itself is causing this generic problem with NSArray?
Your test code is rather silly, that loop would never execute. Can you provide an example of how you're using it with the library.
Also look into upgrading to Xcode 6.3/Swift 1.2. Because I'm not going to be applying fixes to pre-2.0
from socket.io-client-swift.
Your questions are reasonable. I admit this issue does appear ridiculous upon first glance. Please allow me to elaborate:
- Yes, the library itself is causing the problem. Removing the import statement causes the build to succeed.
- Yes, the test code is silly, and the loop would never execute. Here is the point: The only interaction this code has with the library is that this code is in the same project as the "import Socket_IO_Client_Swift" statement. This code could be in a different file, and the compile error still occurs.
However, to satisfy your question: Imagine I have a json object represented somewhere in my Swift code. That json could be something like this:
{
"things": [{
"foo": 1
},{
"foo": 2
}]
}
In Swift I could then do something like:
if let json = NSJSONSerialization.JSONObjectWithData(...) as? NSDictionary {
if let array = json["things"] as? NSArray {
for thing in array {
let foo = thing["foo"]
// Do something with foo
}
}
}
I also agree that Swift 1.2 is the future. Perhaps we've discovered an issue with the Apple compiler.
from socket.io-client-swift.
That's really strange, I don't think I'm doing anything that should interfere with NSArray or NSDictionary
from socket.io-client-swift.
I'm downloading Xcode 6.3 now to test it with that. I'll continue investigating.
from socket.io-client-swift.
This works fine with Xcode 6.3 and version 2.0.2 of this library.
from socket.io-client-swift.
That's strange, well if it works I'll close the issue
from socket.io-client-swift.
Related Issues (20)
- Why can't I find a single tutorial or sample that ACTUALLY WORKS with socket io?
- Can't receive events HOT 2
- SocketIOClientOption.cookies ignored in Starscream with HTTPCookieStorage HOT 1
- starscream version (4.0.6) HOT 28
- Error: compiling for iOS 10.0, but module 'Starscream' has a minimum deployment target of iOS 11.0 HOT 1
- New release to solve the Starscream compile issue HOT 2
- Socket io gives a connection error when connecting back from going to background
- How to emit Audio Data to the Socket IO HOT 1
- How to Read ByteAarray Data received my Socket IO
- getting compilaton error
- Socket.IO-Client-Swift version 16 Crash on iOS 16, built with Xcode 15 HOT 6
- Does the library support socks proxy?
- Reconnect Auth Behavior
- socket.emitWithAck(...)timingOut(...) timeout callback never called HOT 2
- LOG SocketManager: Tried connecting an already active socket
- Cannot connect to server, when android client can connect HOT 3
- Privacy Manifest HOT 3
- Potential Memory Management Issue with emitWithAck and timingOut(after:) HOT 1
- How can i use SocketIO without Rosetta on Apple Silicon
- Compiling for iOS 10.0, but module 'Starscream' has a minimum deployment target of iOS 12.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socket.io-client-swift.