Re: Updating to Xcode 10
John Brownie
Because it needs the GNU standard library. It's not just STL, but other things there that are different to the current standard library.
toggle quoted messageShow quoted text
Alex Zavatone via Groups.Io wrote on 22/9/18 00:30:
How is this not solved by adding libc++.tbd to the project’s Link Binary With Libraries phase?On Sep 21, 2018, at 8:52 AM, John Brownie <john_brownie@sil.org> wrote: --
John Brownie Mussau-Emira language, New Ireland Province, Papua New Guinea Kouvola, Finland
|
|
Re: Updating to Xcode 10
Alex Zavatone
How is this not solved by adding libc++.tbd to the project’s Link Binary With Libraries phase?
toggle quoted messageShow quoted text
On Sep 21, 2018, at 8:52 AM, John Brownie <john_brownie@sil.org> wrote:
|
|
Re: Updating to Xcode 10
Xcode stopped supporting the GNU C++ lib a few releases ago. You’ll need to use Clang’s libc++ instead. Hopefully there should be few compatibility problems. —Jens
|
|
Re: More Layout Questions
Quincey Morris
On Sep 21, 2018, at 08:07 , Dave <dave@...> wrote:
I mean that if you have disabled auto-layout, then you shouldn’t be trying to use auto-layout. Implementing the “layout” method comes under the heading of “trying to use auto-layout”, as the documentation says. It may be possible that “layout” gets called anyway (it would have no effect unless you overrode it to do something), but the behavior isn’t documented in that case. You can’t rely on it to behave in any meaningful way.
|
|
Re: Updating to Xcode 10
Sean McBride
On Fri, 21 Sep 2018 16:52:32 +0300, John Brownie said:
I bit the bullet and deleted Xcode 10 and reinstalled Xcode 9.4.1, andHow could rewriting in a different language be easier/faster than tweaking your C++ to work with a different STL library? Most C++ code should be agnostic towards which STL lib is being used anyway, no? Sean
|
|
Re: More Layout Questions
Dave
I meant to say:
|
|
Re: More Layout Questions
Dave
Typical! The way I chose to do it, layout sets in own frame rectangle and calls layout on its subviews, however, it seems to work wonderfully, so not sure what is going on! Any comments?
Noted, thanks.
Not sure what you mean by this? There are no constraints define in this Storyboard/NIB. In the following hierarchy: WindowTrackerView .view) SubviewA SubviewB SubviewC WindowTrackerView::layout sets the frame of SubviewA. SubviewA::layout sets the frame of SubviewB SubviewB::layout sets the frame of SubviewC Thanks a lot for the help All the Best Dave
|
|
Re: More Layout Questions
Quincey Morris
On Sep 21, 2018, at 05:36 , Dave <dave@...> wrote:
You seem to be way off base here. “Manual layout” is just the absence of auto-layout. The layout method is part of the auto-layout system, as the documentation says: "Perform layout in concert with the constraint-based layout system.” It’s a way of customizing auto-layout, not doing manual layout. It sounds like you’re trying to auto-layout, but without any constraints. That’s certainly possible, but an auto-layout pass is still an auto-layout pass. is there a particular way in which the NSView “layout” method is supposed to work or is it up to the developer to choose? Yes, there’s a particular way. It needs to lay out its subviews (adjust the size and position of its subviews) by doing whatever isn’t being done by constraints. That means setting frames of its subviews. A view should not change *its own* frame in its "layout” method. That invalidates the layout of the superview, which is explicitly prohibited by the documentation you quoted.
No. Do *not* call “setNeedsLayout” from a “layout” method. That will trigger another layout pass, and layout will loop forever. As above, views are prohibited from setting their own frame in their own “layout” method.
Do not call “setNeedsDisplay” routinely here. The “layout” method is about layout, and you aren’t concerned with drawing here. (If changing the layout resizes some subviews, the resizing itself will trigger drawing as necessary. That’s the normal consequence of resizing views. You don’t have to do anything extra.) But, yes, you need to set the frame of each subview that isn’t going to be (before "[super layout]”) or hasn’t been ("after [super layout]”) set by auto-layout constraints.
|
|
Re: More Layout Questions
Sandor Szatmari
On Sep 21, 2018, at 08:36, Dave <dave@...> wrote:
Sandor
|
|
Re: Updating to Xcode 10
John Brownie
I bit the bullet and deleted Xcode 10 and reinstalled Xcode 9.4.1, and that solves the issue for now. I'd better get a move on with the Swift rewrite!
Thanks for all the help. John -- John Brownie Mussau-Emira language, New Ireland Province, Papua New Guinea Kouvola, Finland
|
|
Re: Adjusting Font Size to fit View Rectangle
Dave
This is a Mac project and those methods are not available…..
toggle quoted messageShow quoted text
On 20 Sep 2018, at 19:58, Ben Kennedy <ben-groups@zygoat.ca> wrote:On 20 Sep 2018, at 2:51 am, Dave <dave@looktowindward.com> wrote:UILabel has `adjustsFontSizeToFitWidth` and `minimumScaleFactor` properties that aim to support that type of thing automatically. Could you employ it?
|
|
Re: Can NSView and NSImageView respond to Mouse Clicks?
Dave
Thanks a lot, I actually found this yesterday and now have it working using the mouseDown method to display a Popup - work a treat!
toggle quoted messageShow quoted text
All the Best Dave
|
|
More Layout Questions
Dave
Hi,
I have a couple of questions related to manual layout on the Mac. Using manual layout, does setting the “frame: of a view cause “layout” to be called or do I need to call “setNeedsLayout” specifically? In general, is there a particular way in which the NSView “layout” method is supposed to work or is it up to the developer to choose? From the docs: Override this method if your custom view needs to perform custom layout not expressible using the constraint-based layout system. In this case you are responsible for setting You may not invalidate any constraints as part of your layout phase, nor invalidate the layout of your superview or views outside of your view hierarchy. You also may not invoke a drawing pass as part of layout. You must call Should the “layout” method change the value of their “frame” property or should this be done by the superview? I have a View Hierarchy and when the window resizes, I change the sizes and positions of the views within each subview. It seem to me that there are two ways of doing it given the following Hierarchy: WindowTrackingView (.view) LeftAreaView ContainerViewA RightAreaView ContainerViewB So, when the window resized, WindowTrackingView::layout gets called with its “frame” property set to the new size. At this point there are two options: 1. WindowTrackingView::layout simply calls “setNeedsLayout” for each of its subviews and each subview sets their own frame based on the “frame" rectangle of the superview via their own “layout” method. 2. WindowTrackingView::layout calculates and sets the frame of each of its subviews based on its own “frame” in this case and then calls “setNeedsDisplay” (unless this is already done if the “frame” changes?). Is any of these methods preferred or is it up to the developer to choose based on the job in hand? Any help on this greatly appreciated, I’ve written a test app and have almost got my head around manual layout, I just need to understand if this last bit. Thanks in advance. All the Best Dave
|
|
Re: Updating to Xcode 10
John Brownie
Oh boy. I am only
targeting macOS (10.9 for this release), so it should still be doable.
This will be a stop-gap while I work on the migration of the whole code
base to Swift. I'm relying on a third-party base, Nano, which is coded
with the GNU stdlib in mind, and that's one more reason to move to Swift.
toggle quoted messageShow quoted text
In the meantime, is it going to be possible to add a version of libstdc++ to Xcode? Given code signing and all that, I guess it wouldn't be possible to stick it into the SDK, so it would have to be /usr/include or /usr/local/include. Is the best way to go through the whole gcc installation, or is there a shortcut I can make? Thanks for pointing out the release notes. Life is too short to read everything when trying to catch up after several months away from the project! John Jack Brindle via Groups.Io wrote on 21/9/18 15:22:
John; --
John Brownie Mussau-Emira language, New Ireland Province, Papua New Guinea Kouvola, Finland
|
|
Re: Updating to Xcode 10
Jack Brindle
John;
toggle quoted messageShow quoted text
It’s usually a good thing to read the release notes for each version of Xcode. The Xcode 10 release notes directly mention the issue you are facing: Building with libstdc++ was deprecated with Xcode 8 and is not supported in Xcode 10 when targeting iOS. C++ projects must now migrate to libc++ and are recommended to set a deployment target of macOS 10.9 or later, or iOS 7 or later. Besides changing the C++ Standard Library build setting, developers should audit hard-coded linker flags and target dependencies to remove references to libstdc++ (including -lstdc++, -lstdc++.6.0.9, libstdc++.6.0.9.tbd, and libstdc++.6.0.9.dylib). Project dependencies such as static archives that were built against libstdc++ will also need to be rebuilt against libc++. (40885260) Libgcc is obsoleted. Xcode 10 can no longer build apps with deployment targets of macOS 10.4 and 10.5. (42818150, 38035243) It looks like they really want you to change libraries to use libc++. Jack
|
|
How to end a UIKeyboardTypeDecimalPad
Gerriet M. Denkmann
I got a UITextField which has a UIKeyboardTypeDecimalPad.
With a normal TextField (UIKeyboardTypeDefault) the user can enter Return, the UITextFieldDelegate gets textFieldShouldReturn and all is well. But how should the user tell the app that enough digits have been entered, as the DecimalPad has no Return key? Gerriet.
|
|
Re: Updating to Xcode 10
John Brownie
I discovered one thing that is a bug in Xcode. In the section Apple Clang - Language - C++, if you set the C++ Standard Library to the option libstdc++ (GNU C++ Standard Library), it generates the -std=libstdc++. When it fails to find it, it generates the erroneous warning.
toggle quoted messageShow quoted text
Anyway, it looks as though the issue is that the C++ library that I rely on is built with the GNU C++ Standard Library in mind, and that is not present on my machine. I assume that it disappeared at some point in the past, possibly between Xcode 9.2 (which was the last version I was using) and Xcode 10.0. Is there a way to get it back? John Alex Zavatone via Groups.Io wrote on 20/9/18 21:24:
Did you change your linked library to the new C++ one?On Sep 20, 2018, at 2:32 AM, John Brownie <john_brownie@sil.org> wrote: --
John Brownie Mussau-Emira language, New Ireland Province, Papua New Guinea Kouvola, Finland
|
|
Re: Segue
Quincey Morris
On Sep 20, 2018, at 22:50 , Gerriet M. Denkmann <g@...> wrote:
It is self-evident after you read the documentation, but it takes about a day to read the documentation …
… and if you’d spent the day reading the documentation, it wouldn’t have taken a day to figure out. ;) TBH, it’s a bit frightening how abstruse the controller interactions have become on iOS over the years. If you study the master-detail app template in Xcode, you’ll see that it gives the iPad *both* a split view controller *and* a navigation controller, and it switches between the two dynamically, depending on how the split view interacts with a compact dimension. If you want to make your head hurt, you can spend another day figuring out how the machinery in the App Delegate and the MasterViewController, and the cross-linked navigation controllers in the storyboard all work together to do some very clever things. I particular like this comment in the helper method near the end of the App Delegate: // Return true to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded.
|
|
Re: Segue
Gerriet M. Denkmann
On 20 Sep 2018, at 22:19, Rick Aurbach via Groups.Io <rlaurb=me.com@groups.io> wrote:You are quite right. The Xcode template “Master-Detail App” uses a SplitViewController, and it works fine. And it works for both iPad and iPhone. But you can do (iPhone only ?) without a SplitViewController as well: UINavigationController → UIViewController (Master) → UIViewController (Detail) works as expected. Three important points: 1. The Master *must* be preceded by an UINavigationController 2. There must be *no* UINavigationController between Master and Detail. 3. The Segue Master to Detail *must* be of Kind: Show (e.g. Push) This is probably self-evident (and probably also well documented), but it took me more than a day to figure this out. Kind regards, Gerriet.
|
|
Re: Can NSView and NSImageView respond to Mouse Clicks?
Jack Brindle
NSView inherits from NSResponder. That gives NSView access to mouseDown, mouseUp and a whole host of other important calls.
toggle quoted messageShow quoted text
What this really means is that you can implement - (void)mouseDown:(NSEvent *)event; or v- (void) mouseUp:(NSEvent *)event; in your NSView subclass and handle mouse events the way you like, which includes generating IBAction calls to other objects that need to be notified of mouse events in your view. The event object will contains information about where the cursor was when the mouse down or up even occurred, which you can use to determine exactly where in the view the hit occurred, and even when. Note that any control embedded in the view will take precedence over the view itself, so that it gets a chance to handle the mouse down first. After all these years, I still find it really cool the way events and the responder chain works, and gives us so much power to create great user interfaces. Jack
On Sep 20, 2018, at 4:36 AM, Dave <dave@looktowindward.com> wrote:
|
|