Search results for

eskimo

34,986 results found

Post

Replies

Boosts

Views

Activity

Reply to Xcode switching languages
Xcode is taking the class class responsible for that scene (which you set in the Identity inspector after selecting the scene’s view controller), finding the implementation of that class, and showing you that. If that class is implemented in Objective-C, that’s what you get.Xcode can’t automatically translate Objective-C to Swift, so if you want this class to be in Swift you will have to do something like this:create a replacement class with a slightly different namewrite a Swift version of the existing Objective-C codeuse the Identity inspector to change the class of the scene’s view controller to your new classoptionally, once everything is done, delete the old Objective-C class and rename the Swift class back to the original nameShare and Enjoy — Quinn The Eskimo! Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’15
Reply to iOS TCP Client: downloading big text file
eskimo. First of all, thank you so much for bearing with me and providing me with your extremely useful support. Reading your explanation helps me a lot.1) I do not get the .EndEncountered event after the text has been loaded. I only get it when the server gets closed. This is printed after I have closed the server:NSStreamEvent.HasBytesAvailableNSStreamEventEndEncounteredCLOSE NETWORK CONNECTIONUntil then, the connection remains open (no NSStreamEventEndEncountered).2) The text is simple. I will try to illustrate what exactly I meant. The text is a number of blocks of lines separated by a space. Each line represents a comma separated data. The first element of each line is a key that I use to pull the appropriate data. For example, 'A' stands for airport and I try to extract its id and name from the line that has this key. And this is what I get (some lines are removed to mind the space). Look at the highlighted text. Once the first buffer is read, it extracts the id and name just fine. Then the sec
Sep ’15
Reply to Why does NSHost.names only return one result?
As NSHost does not the trick I came up with two variants that were proposed to work the way I want. But only Variant 1 actually does the trick, and with even less code than Variant 2.Both variants are thought to be run in a Swift playgound.Variant 1: Using Goode Olde gethostbyaddr()//: # How to retrieve a host name and associated aliases from an IP address //: Rename the file extension to `playground` and run it directly in Xcode 7 with Swift 2. import Cocoa //: ## Using the C `struct`s in Swift //: We can safely use a Swift `String` for storing the IP address in charachter format as Swift supports toll-fee bridging to C strings. let ip = 17.172.224.47 //: In order to use the `hostent` C structure as a reference value (pointer) we have to declare it as an `UnsafeMutablePointer` of the corresponding type. //: We use `let` as the value itself will never change, but only the reference to the value. As such, the value (not the reference, or pointer for that matter) will be a constant. let he: UnsafeMutablePointer
Sep ’15
Reply to Why works on swift 2 beta 1 not on beta 6
What does this result mean? It's a problem of iOS 9?What’s happening here is that iOS 9 delivers explicit authentication challenges (NSURLAuthenticationMethodHTTPBasic and NSURLAuthenticationMethodHTTPDigest) rather than the meta challenge that older systems used ( NSURLAuthenticationMethodDefault). I was in a hurry so I just wrote code to handle the latter. Line 26 of my code should look like this: if [NSURLAuthenticationMethodDefault, NSURLAuthenticationMethodHTTPBasic, NSURLAuthenticationMethodHTTPDigest].contains(challenge.protectionSpace.authenticationMethod) {Unfortunately I can’t test what happens from there because the server now rejects the previous password:$ curl -u hroman:javierA17 -is http://apps.solu4b.com/beepinservice/BeepInDataService.svc | head -1 HTTP/1.1 401 UnauthorizedShare and Enjoy — Quinn The Eskimo! Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Sep ’15
Reply to iOS TCP Client: downloading big text file
1) I do not get the .EndEncountered event after the text has been loaded. I only get it when the server gets closed. This is printed after I have closed the server:…Until then, the connection remains open (no NSStreamEventEndEncountered).Hmmm, OK. I was under the impression that the server closes the connection after sending you all the data. Clearly that’s not the case.That makes things tricky because you have to decide when to close the connection. Is there something in the data that indicates an EOF? If not, you’ll have to use some heuristic (like a timer).Regardless, I don’t think this should impact on how you parse the data, as I’ll discuss below.2) The text is simple.Indeed, we’re talking ASCII level simple here. Which is good news because it eliminates (literally) a world of potential complexity.The text is a number of blocks of lines separated by a space.By a space? Or a blank line?From the example you posted it looks like a blank line. Presumably it’s reasonable to put a bound on the size of these bl
Sep ’15
Reply to Why does NSHost.names only return one result?
I have a bunch of issues with gethostbyaddr: You can make it do (kinda) the right thing with IPv6 but it’s pretty ugly. At the end of this post you’ll find the code I used for this.Note On the IPv6 front, it won’t do the right thing with scope identifiers because it can’t ‘see’ sin6_scope_id.It’s synchronous, which is rarely a good idea IMO.It relies on thread local storage to be thread safe.It’s distinction between h_name and h_aliases doesn’t really match the way DNS works. DNS doesn’t have an “official name of host”, rather, there are PTR records that map from xxx.in-addr.arpa. to A records and from xxx.ip6.arpa. to AAAA records.Curiously, while digging into this issue I found this in the Wikipedia on reverse DNS lookup:having multiple PTR records for the same IP address is generally not recommendedIt’s is not, then, surprising that NSHost, CFHost and so on all return a single name.Share and Enjoy — Quinn The Eskimo! Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEm
Sep ’15
Reply to Network Error -1005 Lost Connexion with iOS8
It’s hard to say what’s going on here because there are lots of potential causes for problems like this. I took a look at the articles you linked to and there seems to be a lot of speculation and not much in the way of concrete info. For example, folks say that they’ve reported the bug to Apple but then don’t give the bug number, which makes it hard to track down the report.I will say that the explanation you quoted sounds overly simplistic to me:If iOS 8 receives a HTTP response with a Keep-Alive header, it keeps this connection to re-use later (as it should), but it keeps it for more than the timeout parameter of the Keep-Alive header and then when a second request comes it tries to re-use a connection that has been dropped by the server.That’s because HTTP keep alive timeouts are inherently racy, so the client always has to deal with the possibility that the server might have closed the connection just as it was trying to reuse it for a new request.I have a couple of suggestions here:Try reproducing the pr
Sep ’15
Reply to Is XPC the right tool for this job?
You have to understand that there’s a difference between XPC (the inter-process communication library) and XPC Services (a mechanism to bundle helper processes within an app whose lifetime is managed by the system and whose IPC is implemented using XPC). XPC Services are a common use of XPC but you can use XPC in other scenerios (for example, both launchd daemons and agents can advertise themselves via XPC).The system does not currently support multiple instances of third-party XPC Services.Personally I’d do this by using XPC for my IPC (because it’s by far the simplest way of doing IPC) and then have the daemon/agent/XPC Service create child processes for each high-level unit of work. XPC endpoints make it possible for the client to communicate directly with the worker process.Share and Enjoy — Quinn The Eskimo! Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Sep ’15
Reply to How to delete a certificate from KEYCHAIN using IOS keychain api
Yes, my question is all about certificates but not sure how to refer [them] like kSecClassKey or kSecClassGenericPassword.Two things:That would be either kSecClassCertificate or kSecClassIdentity, depending on whether you are actually talking about certificates or digital identities.I’ll note that these values are in the header and documentation right next to the other values, so it's really not that hard to find them.Apropos the certificate vs digital identity issue, the answer quoted above seems to contradict this answer:I am talking about certificate & private key and as you said its been used as validating user credentials for authentication.It's going to be hard to help here unless you can nail down some of the basics.Share and Enjoy — Quinn The Eskimo! Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: Privacy & Security SubTopic: General Tags:
Sep ’15
Reply to Can my app get permission to rename one of its files when installed in Applications on OSX?
That seems to pass on the codesigning in that the app will happily run assuming it's happy with the filename in its code.Running isn’t really a good test of the code signature. You should either:validate the code signature, as I described in my earlier postput the app on a server somewhere, download it from there, and then see if it passes the Quarantine checkLast I checked OS X does not check the entire code signature of the app every time it launches the app; rather, the full check is done as part of the un-Quarantine process.Share and Enjoy — Quinn The Eskimo! Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: Privacy & Security SubTopic: General Tags:
Sep ’15
Reply to Open() is not working after sandbox turning on.
What I want is to read the drive sector by sector,which is of course outside app’s container, but sendboxing is not allowing to do so.I presume you’re sandboxing because you want to ship on the Mac App Store. If so, you won’t be able to do the above. Mac App Store apps are not allowed to elevate privileges and doing block level I/O on a disk requires elevated privileges.With regards the apps you mentioned, in general I’m not able to comment on other developer’s apps, for reasons which I’m sure you’ll understand. A while back I posted my general answer to questions like this.However, in the case of EaseUS Data Recovery Wizard, their Mac App Store description is very straightforward:The app store version can only recover lost data from DMG.Share and Enjoy — Quinn The Eskimo! Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: Code Signing SubTopic: General Tags:
Sep ’15
Reply to How to listen for sms reception in ios 8 ?
I want my application to be notified when a sms received so that I can fill a field in my application with a verification code received by sms to verify the user mobile number , is that possible ?No. iOS apps have no access to incoming SMS messages.At this point I usually suggest that folks file an enhancement request for an API to meet their needs. However, in this case there’s very little point: it’s hard to imagine how we could reconcile access to the SMS database with our privacy goals.Do you control the format of the SMS message? If so, it’s possible you could put stuff in the message to make the process smoother. An obvious example would be a URL that the user could tap.Share and Enjoy — Quinn The Eskimo! Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: Programming Languages SubTopic: General Tags:
Sep ’15
Reply to What is the process for creating a Framework?
The magic here is workspaces (trust me, in Xcode the magic is always workspaces :-).To test this, I did the following in Xcode 6.4:I created a new framework project, “QFramework”, from the OS X > Framework & Library > Cocoa Framework template, selecting Swift as the language.I created a new file, TF.swift, and set its contents to: public class TF { public init() { } public func f1() { println(works) } }IMPORTANT I tweaked your code to add a public initialiser.I created a new app project, “QApp”, from the OS X > Application > Cocoa Application template, also selecting Swift as the language.Note The Swift runtime makes command line tools tricky, so I recommend that you start out with the simple case of an app.I closed both projects.I created a new workspace.I added both projects (the *.xcodeproj files) to the workspace.IMPORTANT When adding, make sure Copy items into destination group’s folder is not checked.In the Link Binaries with Libraries section of the Build Phases tab of the app’s target,
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’15
Reply to taskIdentifer throws error (NSUrlSessionDataTask)
var placesTask = NSURLSessionDataTask() You can’t construct an NSURLSessionDataTask like that. Rather, tasks must be created by a session. You do this correctly elsewhere in the code, so I’m not entirely sure why you’re doing it wrongly here.Share and Enjoy — Quinn The Eskimo! Apple Developer Relations, Developer Technical Support, Core OS/Hardware let myEmail = eskimo + 1 + @apple.com
Topic: Programming Languages SubTopic: Swift Tags:
Sep ’15