IOS focus issue when presenting a view controller from a new storyboard
I'm back into my modular design phase where I build one part of the iOS application in one storyboard, then another part in another and just do a presentViewController with the root view or nav controller from the storyboard that contains it. This works almost as expected except for one thing. After the view controller is presented from the other storyboard, the first tap on the scene is always ignored. It's like the first tap brings the new view into focus and then once it's in focus, every other tap and gesture works as expected, just not the first one. If it matters. I'm calling the method to push a new viewController in a new storyboard from the viewDidAppear of the iOS 8 app's first viewController. Here's the method that I've got doing it and it works great besides that one issue. Any insight into this would be great. Thanks much - (void)launchModuleInOtherStoryboard { // Load a separate storyboard from the bundle to handle this. NSString *storyboardName = @Module; // If we need to specify the device idiom at the end of the name, we can. UIStoryboard *accountProvisioningStoryboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil]; // To push a new set of scenes with a new navigation Controller, it is done like this: // Declare the identifiers of the nav controller and view controller that start the storyboard // Don't use the initialViewController UIStoryboard method NSString *initialNavControllerIdentifier = @Nav Controller; NSString *initialViewControllerIdentifier = @Marketing Material; UINavigationController *accountProvisioningNC = [accountProvisioningStoryboard instantiateViewControllerWithIdentifier:initialNavControllerIdentifier]; UIViewController *accountProvisioningVC = [accountProvisioningStoryboard instantiateViewControllerWithIdentifier:initialViewControllerIdentifier]; [accountProvisioningNC pushViewController:accountProvisioningVC animated:NO]; [accountProvisioningNC setModalTransitionStyle:UIModalTransitionStyleCrossDissolve]; // Present the view controller; [self presentViewController:accountProvisioningNC animated:YES completion:NULL]; } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Playground
Tried Editor — Execute Playground received this: Playground execution terminated because the process stopped unexpectedly. On Jun 10, 2015, at 10:42 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jun 10, 2015, at 20:51 , David Grant dmgr...@infinitydigital.com mailto:dmgr...@infinitydigital.com wrote: import UIKit I was previously using a Mac playground. When I tried using an iOS playground, at first I got no output. Eventually, I had a status message saying some like “Running playground” which lingered for a minute or two. Eventually, I got the correct output. I think what’s happening is that Xcode internally disables a playground after some internal errors occur. After that, there are going to be no result displayed until you find a way to convince it to re-enble the playground. Try closing and re-opening, or try “Execute playground” from the Editor menu. Eventually, something should kick it off again, and then things should work. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: IOS focus issue when presenting a view controller from a new storyboard
Aaaand now it's working perfectly. Hope someone finds that little chunk of code useful. Cheers, Alex Zavatone On Jun 11, 2015, at 1:48 PM, Alex Zavatone wrote: I'm back into my modular design phase where I build one part of the iOS application in one storyboard, then another part in another and just do a presentViewController with the root view or nav controller from the storyboard that contains it. This works almost as expected except for one thing. After the view controller is presented from the other storyboard, the first tap on the scene is always ignored. It's like the first tap brings the new view into focus and then once it's in focus, every other tap and gesture works as expected, just not the first one. If it matters. I'm calling the method to push a new viewController in a new storyboard from the viewDidAppear of the iOS 8 app's first viewController. Here's the method that I've got doing it and it works great besides that one issue. Any insight into this would be great. Thanks much - (void)launchModuleInOtherStoryboard { // Load a separate storyboard from the bundle to handle this. NSString *storyboardName = @Module; // If we need to specify the device idiom at the end of the name, we can. UIStoryboard *accountProvisioningStoryboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil]; // To push a new set of scenes with a new navigation Controller, it is done like this: // Declare the identifiers of the nav controller and view controller that start the storyboard // Don't use the initialViewController UIStoryboard method NSString *initialNavControllerIdentifier = @Nav Controller; NSString *initialViewControllerIdentifier = @Marketing Material; UINavigationController *accountProvisioningNC = [accountProvisioningStoryboard instantiateViewControllerWithIdentifier:initialNavControllerIdentifier]; UIViewController *accountProvisioningVC = [accountProvisioningStoryboard instantiateViewControllerWithIdentifier:initialViewControllerIdentifier]; [accountProvisioningNC pushViewController:accountProvisioningVC animated:NO]; [accountProvisioningNC setModalTransitionStyle:UIModalTransitionStyleCrossDissolve]; // Present the view controller; [self presentViewController:accountProvisioningNC animated:YES completion:NULL]; } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com This email sent to z...@mac.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Playground
On Jun 11, 2015, at 10:58 , David Grant dmgr...@infinitydigital.com wrote: Playground execution terminated because the process stopped unexpectedly. Here’s what I would do: 1. Close all projects and any playground windows you have open. 2. Go to the Projects window (that’s been split out from the organizer), and delete any entries for various playgrounds you have previously created. I’m not sure this does anything useful, but there’s no “Clean” function for playgrounds, and it’s possible this will clean something out. 3. Quit and relaunch Xcode. Watch the status area in the toolbar to make sure you wait until it’s finished spinning after relaunch. You may even want to use Activity Monitor to check that Xcode goes pretty much idle. (It’s not necessarily a problem if it’s still doing something, but it gets confusing if that delays what you do next to the point of it seeming broken.) 4. Create a new iOS playground. Again, wait for it to go idle or crash or report an error. This might take a minute or so. 5. Click the “Show the Debug Area” button in the bottom left, and check there for error messages. 6. Check the system log (via Console utility) to see if anything has been logged there. 7. If you still don’t see the “Hello, playground” output, submit a bug report and attach the playground. You can then play around trying things like closing and re-opening the playground, quitting and relaunching Xcode, and using Editor - Execute Playground to see if you can get it to start working. The key is to try one thing at a time, and *wait* to see what happens, since some errors take a while to be logged. My guess is that if you can get it work once, it will work fine after that. If you can’t get it to work once, then there’s probably something corrupt in Derived Data (or a similar cache location) that’s preventing Xcode from running the playground process. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Playground
So I followed your instructions below, and the playground opened and I waited very very patiently for the wheel to stop spinning as it said “running playground”. Then I was met with the following pop up. Failed to launch iOS stub for playground execution: error: attach failed: lost connection.” On Jun 11, 2015, at 12:00 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jun 11, 2015, at 10:58 , David Grant dmgr...@infinitydigital.com wrote: Playground execution terminated because the process stopped unexpectedly. Here’s what I would do: 1. Close all projects and any playground windows you have open. 2. Go to the Projects window (that’s been split out from the organizer), and delete any entries for various playgrounds you have previously created. I’m not sure this does anything useful, but there’s no “Clean” function for playgrounds, and it’s possible this will clean something out. 3. Quit and relaunch Xcode. Watch the status area in the toolbar to make sure you wait until it’s finished spinning after relaunch. You may even want to use Activity Monitor to check that Xcode goes pretty much idle. (It’s not necessarily a problem if it’s still doing something, but it gets confusing if that delays what you do next to the point of it seeming broken.) 4. Create a new iOS playground. Again, wait for it to go idle or crash or report an error. This might take a minute or so. 5. Click the “Show the Debug Area” button in the bottom left, and check there for error messages. 6. Check the system log (via Console utility) to see if anything has been logged there. 7. If you still don’t see the “Hello, playground” output, submit a bug report and attach the playground. You can then play around trying things like closing and re-opening the playground, quitting and relaunching Xcode, and using Editor - Execute Playground to see if you can get it to start working. The key is to try one thing at a time, and *wait* to see what happens, since some errors take a while to be logged. My guess is that if you can get it work once, it will work fine after that. If you can’t get it to work once, then there’s probably something corrupt in Derived Data (or a similar cache location) that’s preventing Xcode from running the playground process. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Playground
On Jun 11, 2015, at 12:18 , David Grant dmgr...@infinitydigital.com wrote: So I followed your instructions below, and the playground opened and I waited very very patiently for the wheel to stop spinning as it said “running playground”. Then I was met with the following pop up. Failed to launch iOS stub for playground execution: error: attach failed: lost connection.” a. Bug report. b. Post in the new! deimproved! developer forums (Xcode-Swift section) that you’re getting this error message, and see if someone knows of a workaround. c. Keep fiddling with it to see if it starts working eventually. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
iOS version check
There’s a particular API that’s broken in iOS 8 (AVSpeechUtterance.rate), but not broken in iOS 7, and fixed in iOS 9. Using Xcode 7, therefore, I get the iOS 9 simulator, which means different speech behavior running in the simulator from running on an actual device (still running 8.3). So I’m looking for a version check that will allow me to set the property based on the running iOS version, something like this: if (floor(NSFoundationVersionNumber) = NSFoundationVersionNumber_iOS_8_0 floor (NSFoundationVersionNumber) NSFoundationVersionNumber_iOS_9_0) AVSpeechUtterance.rate = the wrong value that used to work else AVSpeechUtterance.rate = the right value but there’s no definition of NSFoundationVersionNumber_iOS_9_0 in the iOS 9 SDK. In fact, there’s nothing higher than NSFoundationVersionNumber_iOS_8_1 in the iOS 9 SDK. That means there’s no definition that lets me test against 8.2, 8.3 or 8.4. I’m confused about what to do here. The iOS 8.3 SDK itself has no NSFoundationVersionNumber_iOS_8_x definitions at all, so going back to Xcode 6 wouldn't solve the problem, except that the simulator would be 8.x, so the problem wouldn’t show up again until iOS 9 is released. I must be missing something really obvious here. (The app’s deployment target is currently set to 8.1, but I don’t think that makes any difference, except that I don’t care about iOS 7, which is unfortunately the one version I *could* check for.) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
3D file formats
Preview and QuickLook are able to show me the .obj files my company creates. But neither SceneKit nor Xcode seem to be able to open them, at least not directly. OS X 10.10.3 (for eventual use on iOS). Is there any way to leverage the support I see in Preview/QuickLook in my own apps? Is this even the right list for this question? Thanks! -- Rick Mann rm...@latencyzero.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: for case and if case (Swift 2)
On 12 Jun 2015, at 08:49, Roland King r...@rols.org wrote: Trying out some of the new Swift 2 features for pattern matching (What’s New In Swift around the 19m 35s + mark with Chris Lattner) but not having much success. I have this in a playground enum test { case one case two( Int ) case three( String, Int ) } let x = [ test.one, test.two( 123 ), test.three( xx, 1 ), test.one, test.three( rrr, 7 ), test.two( 9 ) ] for case test.two( let a ) in x { print( a is \(a) ) } Which follows the pattern shown on-screen, as I understand it at least, and in the updated Swift beta 2 book I get numerous errors on the ‘for case .’ line, the compiler clearly thinks the entire line is garbage. I’ve tried taking the ‘case’ word out, that doesn’t work, I’ve tried taking the ‘test.’ off the start of ‘test.two’, still no good, possibly worse. Tried a simple version in an if as well let y = test.two( 123 ) if case test.two( let a ) == y { } // variable binding in a condition requires an initializer I must have tried 10 other combinations as well without any success. I must have entirely misunderstood the new uniform case pattern matching, or it doesn’t work in seed 1. The ‘if case’ construct is going to be quite useful, anyone else have more success? I can answer the second half of my own question let y = test.two( 123 ) if case test.two( let a ) = y {} yes ‘=‘ instead of ‘==‘. I hit on that trying random things and don’t really understand it, an ‘=‘ in an if() test is something I’m having trouble getting my brain around. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: for case and if case (Swift 2)
On Jun 11, 2015, at 18:01 , Roland King r...@rols.org wrote: yes ‘=‘ instead of ‘==‘. I hit on that trying random things and don’t really understand it, an ‘=‘ in an if() test is something I’m having trouble getting my brain around. It’s not that strange. The statement contains an initializer (conceptually 'let a = y.assocatedValue’), so there’s gonna be a “=“. Note that in your original version: if case test.two( let a ) == y { } what’s on the LHS of the “==“ isn’t a value of any kind — what were you expecting the value of ‘a’ to be? I get the same error with the for … in version. The compiler appears to be treating x {…} as a closure, though I don’t know whether that’s cause or effect. I vaguely recall Chris saying somewhere in the session that some things weren’t implemented yet in the current compiler release. Maybe for case … in is one of them? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: for case and if case (Swift 2)
On 12 Jun 2015, at 09:14, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Jun 11, 2015, at 18:01 , Roland King r...@rols.org wrote: yes ‘=‘ instead of ‘==‘. I hit on that trying random things and don’t really understand it, an ‘=‘ in an if() test is something I’m having trouble getting my brain around. It’s not that strange. The statement contains an initializer (conceptually 'let a = y.assocatedValue’), so there’s gonna be a “=“. Note that in your original version: I see however the ‘=‘ feels like it’s in a strange place - need to get used to what case is doing. Perhaps a way to explain it to myself is that .two( int a ) = y sets a with the associated value from a .two() enum instance and the case succeeds if it’s possible to do it. I found a stranger one at the bottom of this post http://austinzheng.com/2015/06/08/swift-2-control-flow/ http://austinzheng.com/2015/06/08/swift-2-control-flow/. That one had me thinking a while. if case test.two( let a ) == y { } what’s on the LHS of the “==“ isn’t a value of any kind — what were you expecting the value of ‘a’ to be? I get the same error with the for … in version. The compiler appears to be treating x {…} as a closure, though I don’t know whether that’s cause or effect. I vaguely recall Chris saying somewhere in the session that some things weren’t implemented yet in the current compiler release. Maybe for case … in is one of them? Maybe - I just scanned that piece of the talk again and the only thing I saw mentioned as not in seed one is ‘indirect’ in the recursive structs. Thanks for trying it out. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: for case and if case (Swift 2)
yes ‘=‘ instead of ‘==‘. I hit on that trying random things and don’t really understand it, an ‘=‘ in an if() test is something I’m having trouble getting my brain around. It’s not that strange. The statement contains an initializer (conceptually 'let a = y.assocatedValue’), so there’s gonna be a “=“. Note that in your original version: if case test.two( let a ) == y { } what’s on the LHS of the “==“ isn’t a value of any kind — what were you expecting the value of ‘a’ to be? You extract each associated value as a constant (with the let prefix) or a variable (with the var prefix) for use within the switch case’s body...” Given that I’d expect if case to act as if I’d done roughly the same thing with a switch statement switch test { case .two(let a) // do something with .two’s associated value default: // do something else } Marc ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: for case and if case (Swift 2)
On Jun 11, 2015, at 19:48 , Marco S Hyman m...@snafu.org wrote: switch test { Roland “maliciously” misused capitalization of types. ‘test’ is actually an enum type, not a variable of enum type, so this switch statement isn’t valid either. The example in the video is this: for case .MyEnumCase (let value) in enumValues { One thing the video doesn’t show is what ‘enumValues’ is. Perhaps it’s something other than [MyEnum]. What’s odd about ‘for case’ (I think) is that there’s a two-level binding going on. There’s a retrieval of an element of the sequence (of some enum type), then there’s the retrieval of the associated value. Perhaps this is sufficiently complex to implement that it’s not actually done yet. The following works: for case test.two in x { so the pattern matching itself is implemented. The puzzle is how to correctly bind the associated value. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
for case and if case (Swift 2)
Trying out some of the new Swift 2 features for pattern matching (What’s New In Swift around the 19m 35s + mark with Chris Lattner) but not having much success. I have this in a playground enum test { case one case two( Int ) case three( String, Int ) } let x = [ test.one, test.two( 123 ), test.three( xx, 1 ), test.one, test.three( rrr, 7 ), test.two( 9 ) ] for case test.two( let a ) in x { print( a is \(a) ) } Which follows the pattern shown on-screen, as I understand it at least, and in the updated Swift beta 2 book I get numerous errors on the ‘for case .’ line, the compiler clearly thinks the entire line is garbage. I’ve tried taking the ‘case’ word out, that doesn’t work, I’ve tried taking the ‘test.’ off the start of ‘test.two’, still no good, possibly worse. Tried a simple version in an if as well let y = test.two( 123 ) if case test.two( let a ) == y { } // variable binding in a condition requires an initializer I must have tried 10 other combinations as well without any success. I must have entirely misunderstood the new uniform case pattern matching, or it doesn’t work in seed 1. The ‘if case’ construct is going to be quite useful, anyone else have more success? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Another NSTreeController/NSOutlineView/NSIndexPath Question
If you are going to use a data hierarchy, then use a data hierarchy. Look like you are attempting to use a linear array, which won¹t work. You need arrays of arrays and you bind the tree controller to the root array. On 6/10/15 10:45 PM, cocoa-dev-requ...@lists.apple.com cocoa-dev-requ...@lists.apple.com wrote: Hi All, Is there any documentation available on NSTreeController other than the Reference Manual? I¹ve found confusing and contradictory comments on NSTreeController and I¹d like clarification if possible. I¹m confused about how Index Paths are used. I have a ViewController that is uses a NIB based Outline View and Tree Controller, it is based on the SourceView project. This works fine, but now I¹ve got to add some data to another section. I have flat array of ID Strings that represent objects in a Hierarchy, these take the form: RootContainer RootContainer ~ContainerA RootContainer ~ContainerB RootContainer ~ContainerA~LeafA RootContainer ~ContainerA~LeafB RootContainer ~ ContainerB ~LeafA RootContainer ~ ContainerB ~LeafB The Array is sorted so that the lowest items in the Hierarchy appear in the list first. For instance for the above ID array, I would create: Root Node (Container) Index Path n (the next available section in the Root) ContainerA Index Path :n.0 ContainerB Index Path :n.1 LeafA Index Path :n.0.0 LeafB Index Path :n.0.1 LeafA Index Path :n.1.0 LeafB Index Path :n.1.1 I am using insertObject: atArrangedObjectIndexPath: to Insert Objects into the Tree. My confusion lies in how to compute the Index Paths. I had thought to scan the ViewController/TreeController ³ContentArray² to find the initial Index Path, but is this safe? I other words does the position of a Node in the ³ContentArray² Hierarchy correspond to the position I need to pass to insertObject: atArrangedObjectIndexPath:² ? The only other way I can see of doing it would be to use the TreeController¹s ³Current Selection² Methods, but they are quite cumbersome to use and seem to slow it down a *lot*, so I¹d rather avoid doing it this way if possible. Thanks for any help or suggestions. All the Best Dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com