mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #131] Please tell me I'm totally missing something… #80
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#80
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ts on GitHub (Oct 21, 2015).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/131
New to Swift, and for all intents and purposes, iOS and Cocoa in general. That said, what is going on in
OAuthSwifttClient.getthat I don't seem to understand? It returnsNSDataand I can't for the life of me parse anything useful out of it.My simple test is as follows:
To which I get the raw
NSDataas expected, but without anything following.I'm sure I just don't understand Swift/Cocoa/Xcode or something because this is extremely simple stuff and there is no way it should be this difficult to work with.
@phimage commented on GitHub (Oct 21, 2015):
Just to debug try convert the NSData to String or NString
You cast as NSDico.. add an else {...} or remove the cast
@ts commented on GitHub (Oct 21, 2015):
Sounds like the right thing to do, but again, I'm kneecapped by Swift and the new territory I've found myself in. When I
print(String(data))I get exactly the same result as before (raw NSData), which isn't human-readable or yet usable (hence trying to useNSJSONSerializationit in the first place…) so I'm not sure what to do now.@phimage commented on GitHub (Oct 22, 2015):
Look for NSData to NString, encoding must ne specified in init
let datastring = NSString(data: myData, encoding:NSUTF8StringEncoding)