freshOS / Arrow

🏹 Parse JSON with style
MIT License
387 stars 27 forks source link

Value of type 'JSON' has no member 'collection' #18

Closed theabhishek2511 closed 8 years ago

theabhishek2511 commented 8 years ago

Hi, I'm trying to iterate a JSON like so

if let collection = json.collection {
        for jsonEntry in collection {
            // things
        }
    }

and it says there is no member 'collection' in json. Checking the source code here shows that there actually is a 'collection'. I tried readding the libraries through Carthage as well but no dice.

MontakOleg commented 8 years ago

@theabhishek2511 this is because collection has internal access modifier by default (https://github.com/s4cha/Arrow/blob/master/Source/JSON.swift#L24)

I think it should be public.

s4cha commented 8 years ago

@MontakOleg Nice catch! For some obscure reasons I could access it on my end :/ @theabhishek2511 This should be fixed now in latest version (2.0.2)

Cheers,