Search results for

“translate scheme”

6,671 results found

Post

Replies

Boosts

Views

Activity

Reply to iOS TCP Client: downloading big text file
I’ve moved your question over to Core OS > Networking because this is more about networking than about Swift.There’s more than one issue here. guywithmazda spotted one, which is cool because I probably wouldn’t have spotted it myself. OTOH, I have a few more comments which I’ll outline below.First, code like this:while (self.inputStream!.hasBytesAvailable) { … }is incorrect. It’ll probably work but it’s not how you’re supposed to use NSStream. Rather, when you get a .HasBytesAvailable event, you should do one read, process those bytes, and then return. Continuing to work while the -hasXxxAvailable returns true can cause subtle problems. For example: On a fast network you can end up ‘stuck’ in your stream event handler, which prevents anything else on that thread doing any work (which is bad if it’s the main thread). This can happen on both the send and receive sides.On the send side, you end up being incompatible with TCP_NOTSENT_LOWAT. See WWDC 2015 Session 719 Your App and Next Generation Networks.Your d
Sep ’15
Reply to Universal Links in Web Markup
Applinks and twitter cards' markup are their own thing and I haven't seen either comment on changes for iOS 9. I would wait until they say something before you change it. The custom URL schemes you setup for your app could still be used by JavaScript to check availability since to my knowledge js will have no way to know if a link is a universal linkAs far as native apps knowing your app is installed the options are now pretty limited unless there is a predefined relationship you setup in your plist because canOpenURL now returns NO for anything not found under the new LSApplicationQueriesSchemes key.
Topic: App & System Services SubTopic: General Tags:
Sep ’15
Reply to Universal Links in Web Markup
Well there is always smart app banners. They now want you to use the universal link for that but it has the App Store ID (as do some of the other meta schemes) but that doesn't give you any way to open the app. The smart app banner open/download logic is all controlled by Apple. The best the rest of us can do with an App Store ID is send someone to the download page.While I'm sure Apple wants to move away from the custom URL schemes. They are still acknowledging that the other schemes like Twitter cards and Applinks use custom URL schemes. I think the custom schemes are ok for the time being, especially if you support pre 9. I say that because even the new web markup validation tool acknowledges them:https://search.developer.apple.com/appsearch-validation-tool
Topic: App & System Services SubTopic: General Tags:
Sep ’15
Reply to Downgrade El capitan to Yosemite but get halt logo on boot
Hi Generav,Some 3rd party USB installer creators don't seem to be operating properly for Yosemite and El Capitan, producing the halt symbol you are seeing. Follow these steps and your USB installer will work.The drive must be 8GB or more and USB 3 will be quicker.If you haven't still got the Yosemite installer then first download it from the Mac App Store in the Purchases section (you may need to hold alt/option while selecting Purchases. Once it's downloaded, just quit the installer and set the downloaded file's name to InstallOSXYosemite.app (make sure only .app, not .app.app)Plug in your USB drive into the computer and open Disk Utility (in Applications).Select the USB drive from the left sidebar and click on Erase tab.Set the name be YosemiteInstaller - leave Format on Mac OS Extended (Journaled) and Scheme as GUID Partition TableNow click on Erase button and wait until the format process completes.Launch the Terminalapp (in Applications/Utilities) and copy-paste the following command in, and the
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’15
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
Test session exited(-1) without checking in
Currently i'm using GitLab CI to run unit tests. It does this by calling the test script over shell.xcodebuild -workspace project.xcworkspace -scheme Project -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.4' testThe line above works fine local on my machine. But when it's executed via GitLab CI it fails every single time on the following error:Testing failed: Test target Project Tests encountered an error (Test session exited(-1) without checking in. If you believe this error represents a bug, please attach the log file at /var/folders/my/_940yjks21n_xd218d6707k40000gq/T/com.apple.dt.XCTest-status/Session-2015-09-07_13:17:08-MNG7kE.log)The last lines from the .log file:2015-09-07 13:17:10.138 Launch session started, setting a disallow-finish-token on the run operation.2015-09-07 13:17:10.163 Adding console adaptor for test process.2015-09-07 13:17:15.353 Test operation failure: Test session exited(-1) without checking in.2015-09-07 13:17:15.353 _finishWithError:Error Dom
1
0
701
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 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
Network Extension Framework and bindToRequest
I am currently upgrading our app from Captive Network Framework to Network Extenstions Framework(i.e. NEHotspotHelper).So, I come to the following in our code: [myReq bindToCommand:cmdRef];Where myReq is an NSMutableURLRequest and cmdRef is a CNPluginCommandRef. The bindToCommand is documented in the CaptiveNetowrkPlugin Handbook (page 12) as:Making Network Connections Any network connection that the CNPlugin opens to authenticate to the network MUST be bound to the supplied command. This ensures that the network traffic goes over the authenticating interface and not the default interface that the system might choose automatically. When using NSMutableURLRequest, use the following objective C method: @interface NSMutableURLRequest (CaptiveNetworkPlugin) - (void)bindToCommand:(CNPluginCommandRef)cmd;In other words, we bind the CNP command to the NSMutableURLRequest then perform our usual setup and (my guess is) that NSMutableURLRequest handles the rest under the covers. (If I misunderstand, please clarify:)As fa
6
0
1.1k
Sep ’15
QCView in Xcode 6 issues
Hi everyone,I'm completely new to Xcode. For a project, I need to build a simple little program. The goal is, to start the program which should just view a Quartz Composer file with a second window which shows some settings (published ports in Quartz).For testing purposes I made a Quartz Composition with only one Sprite and published the X and Y transition ports. Now I fired up Xcode 6, made a new Cocoa project (tried it with Objective-C and with Swift). I also added the Quartz.framework in the Linked Frameworks and Libraries. Then I made a new Window and added the Quartz Composer View to it. Afterwards I created a secon Window with the Quartz Composition Parameter View. I linked the Parameter View (Ctrl Click) to the QCView.In the QCView I loaded my Composition. When I'm in the Interface Builder the Composition loads perfectly. But when I press the Build and then run the current scheme button my program starts, but the QCView stays black and the QC Composition Parameter View shows nothing. I also ch
1
0
318
Sep ’15
Reply to Reference Counting Issue?
Ah... this was new to me Because of the memory management rules, though, it is more common for objects to end up in the autorelease pool with convenience constructors and the Objective-C literals than with alloc/init. I had always lumped them into the same memory management scheme. I appreciate the exposition. Really helpful. I did update my original codebase (the example was obviously that.. just a whittled down example to post here) with @autoreleasepool and it worked as expected. I was able to go back to my convience methods of @[]. I will be using @autoreleaspools in the threaded lambdas from now on!Thanks again!
Sep ’15
Reply to My Apple Watch not Enable Device in developer site.
I was had same issue, but solved.I talked chat with Apple Support.And,Apple said Please talk Apple Specialist.I talked Apple Specialist this issue.Then, Apple said Please send email me datails.Today, Apple sent this email.(Translated English)We have kept you waiting for Apple Watch, which is registered in the overlap as a test device.Since the Apple Watch, which has been registered in the overlap we removed from your account, we will contact you. Although it is very sorry to trouble, we will add the Apple Watch of again hope as a test device like, thank you.If you have any questions, Thank, etc., any questions, please do not hesitate to contact us.You use the Apple Developer Program, Thank you very much.Best Regards,Apple Inc.How to fix this problem? Contact Apple supportI think so.Thanks!
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’15
Reply to Where to start
I'd say Swift is here to stay, and Obj-C will be pushed on its way out (not anytime soon though !), so for someone wishing to learn developing apps today, I'd recommend Swift.Here are some pros / cons for using Swift :+ HUGE gain of productivity over Obj-C : less code, less housekeeping, and some really useful tricks only available in Swift (#available, guard, defer...)+ Apple provides a free iBook for learning Swift development, which only focuses on the standard library and is very good.- You'll find less documentation and topics on StackOverflow about problems you could encounter with Swift that in ObjC, although most problems are related to Cocoa Touch, so you'll just need to translate.- Swift runtime is embedded into your app for compatibility purposes, meaning that an app using Swift will weigh (much) more than its Obj-C counterpart.+- Swift is still under active development, and you must expect changes to come very quickly. I personnally find the additions of Swift 2 to be gamechangers.+- Comp
Sep ’15
Reply to iOS TCP Client: downloading big text file
I’ve moved your question over to Core OS > Networking because this is more about networking than about Swift.There’s more than one issue here. guywithmazda spotted one, which is cool because I probably wouldn’t have spotted it myself. OTOH, I have a few more comments which I’ll outline below.First, code like this:while (self.inputStream!.hasBytesAvailable) { … }is incorrect. It’ll probably work but it’s not how you’re supposed to use NSStream. Rather, when you get a .HasBytesAvailable event, you should do one read, process those bytes, and then return. Continuing to work while the -hasXxxAvailable returns true can cause subtle problems. For example: On a fast network you can end up ‘stuck’ in your stream event handler, which prevents anything else on that thread doing any work (which is bad if it’s the main thread). This can happen on both the send and receive sides.On the send side, you end up being incompatible with TCP_NOTSENT_LOWAT. See WWDC 2015 Session 719 Your App and Next Generation Networks.Your d
Replies
Boosts
Views
Activity
Sep ’15
Reply to Universal Links in Web Markup
Applinks and twitter cards' markup are their own thing and I haven't seen either comment on changes for iOS 9. I would wait until they say something before you change it. The custom URL schemes you setup for your app could still be used by JavaScript to check availability since to my knowledge js will have no way to know if a link is a universal linkAs far as native apps knowing your app is installed the options are now pretty limited unless there is a predefined relationship you setup in your plist because canOpenURL now returns NO for anything not found under the new LSApplicationQueriesSchemes key.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to Universal Links in Web Markup
Well there is always smart app banners. They now want you to use the universal link for that but it has the App Store ID (as do some of the other meta schemes) but that doesn't give you any way to open the app. The smart app banner open/download logic is all controlled by Apple. The best the rest of us can do with an App Store ID is send someone to the download page.While I'm sure Apple wants to move away from the custom URL schemes. They are still acknowledging that the other schemes like Twitter cards and Applinks use custom URL schemes. I think the custom schemes are ok for the time being, especially if you support pre 9. I say that because even the new web markup validation tool acknowledges them:https://search.developer.apple.com/appsearch-validation-tool
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to URI Schemes Broken?
I haven't tried with the telephone action specifically, but I haven't had an issue with repeated clicked to a scheme eventually causing it to stop working so far.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to Downgrade El capitan to Yosemite but get halt logo on boot
Hi Generav,Some 3rd party USB installer creators don't seem to be operating properly for Yosemite and El Capitan, producing the halt symbol you are seeing. Follow these steps and your USB installer will work.The drive must be 8GB or more and USB 3 will be quicker.If you haven't still got the Yosemite installer then first download it from the Mac App Store in the Purchases section (you may need to hold alt/option while selecting Purchases. Once it's downloaded, just quit the installer and set the downloaded file's name to InstallOSXYosemite.app (make sure only .app, not .app.app)Plug in your USB drive into the computer and open Disk Utility (in Applications).Select the USB drive from the left sidebar and click on Erase tab.Set the name be YosemiteInstaller - leave Format on Mac OS Extended (Journaled) and Scheme as GUID Partition TableNow click on Erase button and wait until the format process completes.Launch the Terminalapp (in Applications/Utilities) and copy-paste the following command in, and the
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’15
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:
Replies
Boosts
Views
Activity
Sep ’15
Test session exited(-1) without checking in
Currently i'm using GitLab CI to run unit tests. It does this by calling the test script over shell.xcodebuild -workspace project.xcworkspace -scheme Project -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6,OS=8.4' testThe line above works fine local on my machine. But when it's executed via GitLab CI it fails every single time on the following error:Testing failed: Test target Project Tests encountered an error (Test session exited(-1) without checking in. If you believe this error represents a bug, please attach the log file at /var/folders/my/_940yjks21n_xd218d6707k40000gq/T/com.apple.dt.XCTest-status/Session-2015-09-07_13:17:08-MNG7kE.log)The last lines from the .log file:2015-09-07 13:17:10.138 Launch session started, setting a disallow-finish-token on the run operation.2015-09-07 13:17:10.163 Adding console adaptor for test process.2015-09-07 13:17:15.353 Test operation failure: Test session exited(-1) without checking in.2015-09-07 13:17:15.353 _finishWithError:Error Dom
Replies
1
Boosts
0
Views
701
Activity
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
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
Sep ’15
Network Extension Framework and bindToRequest
I am currently upgrading our app from Captive Network Framework to Network Extenstions Framework(i.e. NEHotspotHelper).So, I come to the following in our code: [myReq bindToCommand:cmdRef];Where myReq is an NSMutableURLRequest and cmdRef is a CNPluginCommandRef. The bindToCommand is documented in the CaptiveNetowrkPlugin Handbook (page 12) as:Making Network Connections Any network connection that the CNPlugin opens to authenticate to the network MUST be bound to the supplied command. This ensures that the network traffic goes over the authenticating interface and not the default interface that the system might choose automatically. When using NSMutableURLRequest, use the following objective C method: @interface NSMutableURLRequest (CaptiveNetworkPlugin) - (void)bindToCommand:(CNPluginCommandRef)cmd;In other words, we bind the CNP command to the NSMutableURLRequest then perform our usual setup and (my guess is) that NSMutableURLRequest handles the rest under the covers. (If I misunderstand, please clarify:)As fa
Replies
6
Boosts
0
Views
1.1k
Activity
Sep ’15
QCView in Xcode 6 issues
Hi everyone,I'm completely new to Xcode. For a project, I need to build a simple little program. The goal is, to start the program which should just view a Quartz Composer file with a second window which shows some settings (published ports in Quartz).For testing purposes I made a Quartz Composition with only one Sprite and published the X and Y transition ports. Now I fired up Xcode 6, made a new Cocoa project (tried it with Objective-C and with Swift). I also added the Quartz.framework in the Linked Frameworks and Libraries. Then I made a new Window and added the Quartz Composer View to it. Afterwards I created a secon Window with the Quartz Composition Parameter View. I linked the Parameter View (Ctrl Click) to the QCView.In the QCView I loaded my Composition. When I'm in the Interface Builder the Composition loads perfectly. But when I press the Build and then run the current scheme button my program starts, but the QCView stays black and the QC Composition Parameter View shows nothing. I also ch
Replies
1
Boosts
0
Views
318
Activity
Sep ’15
Reply to Reference Counting Issue?
Ah... this was new to me Because of the memory management rules, though, it is more common for objects to end up in the autorelease pool with convenience constructors and the Objective-C literals than with alloc/init. I had always lumped them into the same memory management scheme. I appreciate the exposition. Really helpful. I did update my original codebase (the example was obviously that.. just a whittled down example to post here) with @autoreleasepool and it worked as expected. I was able to go back to my convience methods of @[]. I will be using @autoreleaspools in the threaded lambdas from now on!Thanks again!
Replies
Boosts
Views
Activity
Sep ’15
Reply to No MKMapKit & WebKit ???
I'd suspect the TVML simply defines layout that is translated to native UI elements and the JS is processed by JavaScript Core. I doubt there is much if any hybrid going on at the end of the day. The lack of MapKit seems odd.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to My Apple Watch not Enable Device in developer site.
I was had same issue, but solved.I talked chat with Apple Support.And,Apple said Please talk Apple Specialist.I talked Apple Specialist this issue.Then, Apple said Please send email me datails.Today, Apple sent this email.(Translated English)We have kept you waiting for Apple Watch, which is registered in the overlap as a test device.Since the Apple Watch, which has been registered in the overlap we removed from your account, we will contact you. Although it is very sorry to trouble, we will add the Apple Watch of again hope as a test device like, thank you.If you have any questions, Thank, etc., any questions, please do not hesitate to contact us.You use the Apple Developer Program, Thank you very much.Best Regards,Apple Inc.How to fix this problem? Contact Apple supportI think so.Thanks!
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’15
Reply to Where to start
I'd say Swift is here to stay, and Obj-C will be pushed on its way out (not anytime soon though !), so for someone wishing to learn developing apps today, I'd recommend Swift.Here are some pros / cons for using Swift :+ HUGE gain of productivity over Obj-C : less code, less housekeeping, and some really useful tricks only available in Swift (#available, guard, defer...)+ Apple provides a free iBook for learning Swift development, which only focuses on the standard library and is very good.- You'll find less documentation and topics on StackOverflow about problems you could encounter with Swift that in ObjC, although most problems are related to Cocoa Touch, so you'll just need to translate.- Swift runtime is embedded into your app for compatibility purposes, meaning that an app using Swift will weigh (much) more than its Obj-C counterpart.+- Swift is still under active development, and you must expect changes to come very quickly. I personnally find the additions of Swift 2 to be gamechangers.+- Comp
Replies
Boosts
Views
Activity
Sep ’15