Date   

Re: Assigning a Tester for an iOS app???

Alex Zavatone
 

Using TestFlight, you can do this. There are videos you can search for on Apple’s site that show you how to do it.

On Oct 4, 2018, at 6:41 AM, Dave <dave@...> wrote:

Hi All,

I’m a but rusty on this since I haven’t had to worry about it for a while as I’ve been working on Mac.

I have an active Apple Developer account.

I have an iOS app that I’d like to send to someone for testing. How do I go about doing this, the last time I had to do something like this you assigned someone as a Tester which allowed them to run a copy of the App for 30 days or some such.

Is this still possible? If someone could point to the right tool or documentation for this I’d be really grateful.

Thanks in advance.

All the Best
Dave


Problem with Manual Layout in Test App

Dave
 

Manual Layout on Mac using the “resizeWithOldSuperviewSize” way of doing things.

Hi,

I have a simple app which works 99% of the time, however every now and then it screws up. The app just has 4 views, all with a different background colour. All I want to happen for one view to track the bounds of the Window as the user resizes it and for all the other views to be inset within their superview by 20,20 pixels. 

The storyboard file (Main.storyboard) has Auto Layout tuned off in IB.

The App has a View Hierarchy as follows:

LTWSimpleWindowController
LTWSimpleWindow

LTWSimpleViewController
LTWWindowTrackerView .view property
LTWSimpleBaseView
LTWSimpleGreenView
LTWSimpleBlueView

The above are Class names in the project.

LTWSimpleWindow
Has ContentSize and MinSize set to 100,100 in IB.


LTWSimpleViewController
Has no real code, but logs the viewDidLoad method.


LTWWindowTrackerView
This view is set as the root view of the view controller (e.g. the .view property).
Has background color set to Red.


LTWSimpleBaseView
Has background color set to Black.
This view just sets its Frame Rect to the superview bounds Rect - 
self.frame = self.superview.bounds 
self.autoresizesSubviews = YES;
self.translatesAutoresizingMaskIntoConstraints = NO;


LTWSimpleGreenView
Has background color set to Green.
This view just sets its Frame Rect to the an inset of the superview bounds - 
self.frame = NSInsetRect(self.superview.bounds,20,20);
self.autoresizesSubviews = YES;
self.translatesAutoresizingMaskIntoConstraints = NO;

LTWSimpleBlueView
Has background color set to Blue.
This view just sets its Frame Rect to the an inset of the superview bounds - 
self.frame = NSInsetRect(self.superview.bounds,20,20);
self.autoresizesSubviews = YES;
self.translatesAutoresizingMaskIntoConstraints = NO;
 

The initWithCoder: method is overridden and the autoresizesSubviews and translatesAutoresizingMaskIntoConstraints properties are set here.
The resizeWithOldSuperviewSize: method is overridden and the frame is set here.
The isFlipped method is overridden and returns YES,

Super is called in both methods.

The NIB is set with the views initially in place, e.g. inset my 20,20 in their parent views.

I’m really confused as to what to set as the auto-resizing mask of all the views, at present its set as follows:

LTWWindowTrackerView has the markers on the outside edge of the view are set (Top, Left, Bottom, Right) and the ones on the inside of the view are off. in IB

All the other views have their autoresize masks off, e.g. no marks set in IB.

Is this correct?

When I run the App, the Window displays ok initially, if I resize the window *slowly* then it works ok. If however I make the window really big and then close it up to the minimum size *very-quickly* then  LTWSimpleBlueView and LTWSimpleGreenView are not positioned correctly. 

I’ve attached 3 images (not sure if they will get through), showing the initial window, the big window and the result of making it small again very quickly.

I’ve more or less got everything else working but just want to sort out this last problem and its driving me nuts! I can’t seem to find any working example of using the  “resizeWithOldSuperviewSize” way of doing things.

I can send the Test app if anyone wants to take a look.

All the Best
Dave
































Re: Segue

Dave
 

Hi,

I think you misunderstood what I meant, of course there maybe complex situations where using Storyboard/Segues/Auto-layout are a good idea, and one you describe maybe the best (or only) way to do it.

What I meant is that if you have a very simple case (on the Mac) whereby you just want a Splash Screen to display for a few seconds and then another window to appear (think a board game), then really what is the point of using a Storyboard (apart from the fact that this is the default action in XCode if you create a new single window App)? I’m asking if there are any benefits or if you *have* to use storyboards in order to make it work correctly.

The reason I ask, is because as an experiment (in a Test App) I broke the components of the Storyboard XCode generated into separate NIBs and the App that worked using a Storyboard began to behave differently and I’m trying to figure out if somehow a Storyboard is *needed* to make Manual Layout work.
By this I mean something that uses the:

-(void) resizeWithOldSuperviewSize:(NSSize) theOldSuperViewSize;

way of doing things, rather than “layout” and constraints.

This is dangerously close to an insult — I don't intend one, this is for the archive — but make sure it's not just a matter of sentiment. You still run into people who won't use Instruments (except at release minus one week) or even a debugger, because they feel moment-to-moment pressure telling them they don't have time to learn.
I really can’t see what could be construed at an insult! But why would you run instruments unless they is a problem? I used to run it quite often in order to check for leaks, but since ARC has been around I’ve not found the need. Especially since I “Analyse” quite often. As for the using the debugger, I don’t know any developer that doesn’t use it, however, if you sprinkle Logging about the place, this can be quicker at identifying where the problem lies than stepping through with the debugger. I’ve found a combination of the two to be the most effective tool in debugging.

All the Best
Dave


Assigning a Tester for an iOS app???

Dave
 

Hi All,

I’m a but rusty on this since I haven’t had to worry about it for a while as I’ve been working on Mac.

I have an active Apple Developer account.

I have an iOS app that I’d like to send to someone for testing. How do I go about doing this, the last time I had to do something like this you assigned someone as a Tester which allowed them to run a copy of the App for 30 days or some such.

Is this still possible? If someone could point to the right tool or documentation for this I’d be really grateful.

Thanks in advance.

All the Best
Dave


When to create subviews in custom NSView

Steve Mills
 

I'm needing to create a custom NSView that will layout a grid of other NSViews, and none of the builtin classes will work well for all my needs. What I'm having a really hard time figuring out is exactly when I should create the subviews and when to install their constraints. The subviews will need to be re-created any time the number of rows/cols changes or by other such changes. Is viewWillDraw the right place to create them? Also, I've overridden updateConstraintsForSubtreeIfNeeded, which installs all the constraints on the subviews, but it's never being called.

--
Steve Mills
Drummer, Mac geek


Re: Segue

Fritz Anderson
 

I can't answer for your habits of thought. A constellation of XIBs plus code to coordinate them could possibly reproduce the user's experience of an application built with storyboards. (I'm sure I'm forgetting something, don't hit me, I wear glasses.) My thoughts in no good order:

It's cognitively easier to coordinate the appearance and flow of an application in a single window. If the design is too big for a single view, you can link to another storyboard.

Not every controller transition fits the model of a simple segue, but most do. Those transitions are so routine you may not even realize they're in your app. You can create them by hand, but drawing and configuring a line is five minutes, not thirty (> O(n)), and easier to maintain.

Most remaining potential segues (such as jumps between branches of a hierarchy) aren't that hard to subclass, and again you have a picture.

I don't want even to think about handmade unwind segues.

I don't want to think hard about managing potentially-broad nav hierarchies that might change during development, without segues, so yes my concerns about segues are relevant to good (reliable, maintainable) practice.

Embedded controllers, one example: A static-cell UITableView must be run by UITableViewController, which can't include auxiliary controls like Cancel/Save. Embed it in a wrapper controller with a toolbar. The scene for the table controller follows the size of the embedding view.

Scene layout. If a controller is stacked in a nav controller within a tab controller, you get the correct aperture for free, even if you change the wrapper controllers. Also, the root views of children of tab controllers include the icon and label of the corresponding tab. This is orthogonal to whether you use Auto Layout.

This is dangerously close to an insult — I don't intend one, this is for the archive — but make sure it's not just a matter of sentiment. You still run into people who won't use Instruments (except at release minus one week) or even a debugger, because they feel moment-to-moment pressure telling them they don't have time to learn.

I'm not saying storyboards solve every problem or obviate every XIB.

— F

On Oct 3, 2018, at 8:55 AM, Dave <dave@...> wrote:

I’ve been looking over the pro and cons of using storyboards and for the life of me I can’t see what is gained by using them? I thought it would make development quicker but actually I don’t think that do you save time using a Storyboard. IMO, using old old fashioned NIB and code is the same or quicker than using a NIB that the while thing is so much more maintainable and reliable. Unless I’m missing something……


Re: Segue

Dave
 



On 21 Sep 2018, at 08:27, Quincey Morris <quinceymorris@...> wrote:

On Sep 20, 2018, at 22:50 , Gerriet M. Denkmann <g@...> wrote:

This is probably self-evident (and probably also well documented),

It is self-evident after you read the documentation, but it takes about a day to read the documentation …

but it took me more than a day to figure this out.

… and if you’d spent the day reading the documentation, it wouldn’t have taken a day to figure out. ;)

A day is a day, so no gain either way and that assumes that the documentation is accurate (which it may be in this case but in so many other cases its not or at least ambiguous). 

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.

I’ve been looking over the pro and cons of using storyboards and for the life of me I can’t see what is gained by using them? I thought it would make development quicker but actually I don’t think that do you save time using a Storyboard. IMO, using old old fashioned NIB and code is the same or quicker than using a NIB that the while thing is so much more maintainable and reliable. Unless I’m missing something……

Cheers
Dave





Advice on using Storyboards

Dave
 

Mac Project

Hi,

I’m trying to figure out the best way start up my Mac Application when launched.

I’m not sure if its better to use Storyboards or just to stick with simple NIBs. This is a very simple App in that there are only two windows and one of those is the Splash Screen. When the games launches, I’d like it to display the Splash Screen for a few seconds, then dismiss it and open the main window (which contains a complex manual layout view Hierarchy). At the moment, I’m trying to figure out how the best way to make this happen.

The test App I used to develop the Main window is just a one window app and is all in one Storyboard. If I continue to use Storyboards, then I’d need to add another storyboard file for the Main Window as it is manual layout and the other Splash screen window is Auto-Layout and also I think its better to keep it in a separate file as its quite big and I find it faster to keep the files as small as possible. Is it possible for the Splash Screen (located in main.storyboard) to link to a WindowController/Window/ViewController in another storyboard file after a small delay?

The other way I could do it, is to manually use a WindowController, Window and ViewController and create the Window Controller from the App Delegate via a NIB.

Any suggestion on the way forward greatly appreciated.

All the Best
Dave


Re: Word detection without separating spaces

 



On Sep 27, 2018, at 5:21 AM, Sandor Szatmari <admin.szatmari.net@...> wrote:

I’d like to be able to take something like AREALLYLONGSTRING and turn it into ‘a really long string’ or ‘a_really_long_string’ or basically insert whatever separator I want.

NSLinguisticTagger provides a lot of operations like finding word boundaries and identifying parts of speech. I don’t know if it can be made to identify English words without spaces between them.* Apple has added some newer APIs that use machine-learning to analyze natural language, but I can’t remember what the framework is called; maybe it has some support for that?

—Jens

* It does, however, detect word breaks in East Asian languages that don’t put any separator characters between words.


iOS kCLAuthorizationStatusAuthorizedAlways

Gerriet M. Denkmann
 

My iOS 12 app has two modes;

1. needs kCLAuthorizationStatusAuthorizedWhenInUse
2. needs kCLAuthorizationStatusAuthorizedAlways

When the user has never been asked about kCLAuthorizationStatusAuthorizedAlways then requestAlwaysAuthorization shows a nice panel asking for permission and stating NSLocationAlwaysAndWhenInUseUsageDescription.

But when the user has once allowed “WhenInUse” but declined “Always” then no panel will come up.

In this case I would like to do:

NSURL *url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
[ UIApplication.sharedApplication openURL: url options: [NSDictionary dictionary] completionHandler: …

But how do I know whether the user has been asked (and declined) this question already?

Also: I cannot always direct the user to the Settings app, because when the question about “Always” has never come up, there will be no option for “Always” in the Setting app.


Gerriet.


Re: Changing Colours in an NSImage

Alex Zavatone
 

Check out the tint.

On Sep 29, 2018, at 7:59 AM, Dave <dave@...> wrote:

Hi,

I have an Image that has a transparent background, the foreground image is made up totally of the (NSColor blackColor), is this an easy way to replace the “blackColor” with another Color? As an example:

I have a Letter “A” in a 128 x 128 image, the “A” is Black and the background is transparent, I want to change the Colour (in the same way as you would change the colour by changing a Text Attribute).

Thanks for any insights!

All the Best
Dave






Changing Colours in an NSImage

Dave
 

Hi,

I have an Image that has a transparent background, the foreground image is made up totally of the (NSColor blackColor), is this an easy way to replace the “blackColor” with another Color? As an example:

I have a Letter “A” in a 128 x 128 image, the “A” is Black and the background is transparent, I want to change the Colour (in the same way as you would change the colour by changing a Text Attribute).

Thanks for any insights!

All the Best
Dave


Re: resizeWithOldSuperviewSize not getting called on added Subview

Dave
 

There is a problem wit the way this is coded that means that the same image is being resized up and down which isn’t the best. I’ve changed it to load all the images ahead of time and always resize from the original full size image…...

On 28 Sep 2018, at 20:21, Dave <dave@...> wrote:

Hi,

This makes it work:

-(NSImage*) resizeImage:(NSImage*) theImage withImageRect:(NSRect) theImageRect
{
CGImageRef myCGImageRef;
NSImage* myImage;

myCGImageRef = [theImage CGImageForProposedRect:&theImageRect context:NULL hints:nil];
myImage = [[NSImage alloc] initWithCGImage:myCGImageRef size:theImageRect.size];
self.image = myImage;

return myImage;
}


-(void) layoutViewWithOldSuperviewSize:(NSSize) theOldSuperViewSize
{
NSRect myBoundingRect;
NSRect myFrameRect;
NSImage* myImage;

myBoundingRect = self.superview.bounds;
myFrameRect = NSInsetRect(myBoundingRect,2,2);
myImage = [self resizeImage:self.image withImageRect:myFrameRect];
self.image = myImage;

self.frame = myFrameRect;
}



-(void) resizeWithOldSuperviewSize:(NSSize) theOldSuperViewSize
{
[super resizeWithOldSuperviewSize:theOldSuperViewSize];

[self layoutViewWithOldSuperviewSize:theOldSuperViewSize];
}

Also you need:

self.translatesAutoresizingMaskIntoConstraints = NO;

Somewhere in the initialisation.


Hope this helps someone along the way.

If anyone know of a better/faster solution then please let me know!

All the Best
Dave


On 28 Sep 2018, at 19:31, Dave <dave@...> wrote:

Ahhhh, found something interesting:

self.translatesAutoresizingMaskIntoConstraints = NO;

Then resizeWithOldSuperviewSize gets called!!! BUT the image no longer resizes inside the Image View. Is there a way I can so this manually?

All the Best
Dave


On 28 Sep 2018, at 19:21, Dave <dave@...> wrote:

I did the resizing in the viewDidEndLiveResize method and it does resize correctly, but the problem is that the image stays at the old size until the User stops re-sizing the window (e.g. mouseUp’s) and then it resizes them, which won’t do!

I’ll keep digging!

On 28 Sep 2018, at 19:15, Dave <dave@...> wrote:

Hi Again,

After digging around a little I find this:

https://lists.apple.com/archives/cocoa-dev///2005/Oct/msg00476.html

It seems that someone else has noticed this way back in 2005! From looking at the article, it mentions:

-(void) viewDidEndLiveResize

While I added to the GameImageView class and it does get called, I’m not sure if I can use it or not, but I’d really, really, really like to know if resizeWithOldSuperviewSize is a known bug or if I’m doing something wrong?

All the Best
Dave

On 28 Sep 2018, at 12:34, Dave <dave@...> wrote:

This is a Mac Project.

I’ve not found anything obvious on this, so I’m trying to get to the bottom of why the auto-resizing mechanism is not working with Class that inherits from NSImageView called GameImageView. An object is created and added to the view hierarchy at run time.

The view hierarchy is actually setup in a Storyboard/NIB and looks something like this:

WindowTrackerView
GameBaseView
TopAreaView
BottomAreaView
LeftAreaView
RightAreaView
GameBoardView
GameClusterView1
GameCellView1
GameCellView2
GameCellViewN
GameClusterView2
GameCellView1
GameCellView2
GameCellViewN
GameClusterViewN
GameCellView1
GameCellView2
GameCellViewN


I am adding  GameImageView to each of the GameCellView's at runtime. All the Views are now using resizeWithOldSuperviewSize to resize themselves and it works wonderfully EXCEPT then this mechanism is not working on the run-time added GameImageView’s, e.g. GameImageView ::resizeWithOldSuperviewSize never gets called, although it does get called in the GameCellView’s.

If I do this in the GameCellView:: resizeWithOldSuperviewSize method it works ok (e.g. the Image resized when I resize the window):

myCellStartPosition = [self getCellXYPosition];

myBoundingRect = self.superview.bounds;
myFrameRect = [self calculateFrameRectWithSuperViewRect:myBoundingRect];

myFrameRect.origin.x = (int) (3 + (myCellStartPosition.x * (myFrameRect.size.width + 2)));
myFrameRect.origin.y = (int) (3 + (myCellStartPosition.y * (myFrameRect.size.height + 2)));

self.frame = myFrameRect;

//**
//**  Setup the Image View Frame based on the Cell’s view   *********************
//**
myImageFrameRect = NSInsetRect(self.bounds,2,2);
self.pCellImageView.frame = myImageFrameRect;

e.g. if I set the the frame of the GameImageView in the Superclass it works ok. If I don’t do this expecting GameCellView:: resizeWithOldSuperviewSize to be called then the image does NOT resize, since it isn’t called!! I’m trying to understand why this doesn’t work as expected, I’m not doing anything different (apart from adding it as a subview at runtime) from the other classes in the hierarchy and they all work wonderfully.

I’ve more or less got it working, but this last part is driving me nuts, so if anyone can shed some light on what could be going wrong I’m be really grateful.

Thanks in advance.

All the Best
Dave


On 27 Sep 2018, at 20:10, Dave <dave@...> wrote:

Hi,

I’m using Manual Layout on a Mac project. The View Hierarchy is built in Interface Builder and during run time I add a subview to one of the views. However, resizeWithOldSuperviewSize is not being called on these subviews. The subview in question is a subclass of NSImageView. 

I’ve explicitly set autoresizesSubviews = YES in the view that adds the subview (actually is all the views in the Hierarchy).

Anyone have half an idea why resizeWithOldSuperviewSize is not being called? The frame of the parent rectangle is definitely being set…..

All the Best
Dave





















Re: resizeWithOldSuperviewSize not getting called on added Subview

Dave
 

Hi,

This makes it work:

-(NSImage*) resizeImage:(NSImage*) theImage withImageRect:(NSRect) theImageRect
{
CGImageRef myCGImageRef;
NSImage* myImage;

myCGImageRef = [theImage CGImageForProposedRect:&theImageRect context:NULL hints:nil];
myImage = [[NSImage alloc] initWithCGImage:myCGImageRef size:theImageRect.size];
self.image = myImage;

return myImage;
}


-(void) layoutViewWithOldSuperviewSize:(NSSize) theOldSuperViewSize
{
NSRect myBoundingRect;
NSRect myFrameRect;
NSImage* myImage;

myBoundingRect = self.superview.bounds;
myFrameRect = NSInsetRect(myBoundingRect,2,2);
myImage = [self resizeImage:self.image withImageRect:myFrameRect];
self.image = myImage;

self.frame = myFrameRect;
}



-(void) resizeWithOldSuperviewSize:(NSSize) theOldSuperViewSize
{
[super resizeWithOldSuperviewSize:theOldSuperViewSize];

[self layoutViewWithOldSuperviewSize:theOldSuperViewSize];
}

Also you need:

self.translatesAutoresizingMaskIntoConstraints = NO;

Somewhere in the initialisation.


Hope this helps someone along the way.

If anyone know of a better/faster solution then please let me know!

All the Best
Dave

On 28 Sep 2018, at 19:31, Dave <dave@...> wrote:

Ahhhh, found something interesting:

self.translatesAutoresizingMaskIntoConstraints = NO;

Then resizeWithOldSuperviewSize gets called!!! BUT the image no longer resizes inside the Image View. Is there a way I can so this manually?

All the Best
Dave


On 28 Sep 2018, at 19:21, Dave <dave@...> wrote:

I did the resizing in the viewDidEndLiveResize method and it does resize correctly, but the problem is that the image stays at the old size until the User stops re-sizing the window (e.g. mouseUp’s) and then it resizes them, which won’t do!

I’ll keep digging!

On 28 Sep 2018, at 19:15, Dave <dave@...> wrote:

Hi Again,

After digging around a little I find this:

https://lists.apple.com/archives/cocoa-dev///2005/Oct/msg00476.html

It seems that someone else has noticed this way back in 2005! From looking at the article, it mentions:

-(void) viewDidEndLiveResize

While I added to the GameImageView class and it does get called, I’m not sure if I can use it or not, but I’d really, really, really like to know if resizeWithOldSuperviewSize is a known bug or if I’m doing something wrong?

All the Best
Dave

On 28 Sep 2018, at 12:34, Dave <dave@...> wrote:

This is a Mac Project.

I’ve not found anything obvious on this, so I’m trying to get to the bottom of why the auto-resizing mechanism is not working with Class that inherits from NSImageView called GameImageView. An object is created and added to the view hierarchy at run time.

The view hierarchy is actually setup in a Storyboard/NIB and looks something like this:

WindowTrackerView
GameBaseView
TopAreaView
BottomAreaView
LeftAreaView
RightAreaView
GameBoardView
GameClusterView1
GameCellView1
GameCellView2
GameCellViewN
GameClusterView2
GameCellView1
GameCellView2
GameCellViewN
GameClusterViewN
GameCellView1
GameCellView2
GameCellViewN


I am adding GameImageView to each of the GameCellView's at runtime. All the Views are now using resizeWithOldSuperviewSize to resize themselves and it works wonderfully EXCEPT then this mechanism is not working on the run-time added GameImageView’s, e.g. GameImageView ::resizeWithOldSuperviewSize never gets called, although it does get called in the GameCellView’s.

If I do this in the GameCellView:: resizeWithOldSuperviewSize method it works ok (e.g. the Image resized when I resize the window):

myCellStartPosition = [self getCellXYPosition];

myBoundingRect = self.superview.bounds;
myFrameRect = [self calculateFrameRectWithSuperViewRect:myBoundingRect];

myFrameRect.origin.x = (int) (3 + (myCellStartPosition.x * (myFrameRect.size.width + 2)));
myFrameRect.origin.y = (int) (3 + (myCellStartPosition.y * (myFrameRect.size.height + 2)));

self.frame = myFrameRect;

//**
//** Setup the Image View Frame based on the Cell’s view *********************
//**
myImageFrameRect = NSInsetRect(self.bounds,2,2);
self.pCellImageView.frame = myImageFrameRect;

e.g. if I set the the frame of the GameImageView in the Superclass it works ok. If I don’t do this expecting GameCellView:: resizeWithOldSuperviewSize to be called then the image does NOT resize, since it isn’t called!! I’m trying to understand why this doesn’t work as expected, I’m not doing anything different (apart from adding it as a subview at runtime) from the other classes in the hierarchy and they all work wonderfully.

I’ve more or less got it working, but this last part is driving me nuts, so if anyone can shed some light on what could be going wrong I’m be really grateful.

Thanks in advance.

All the Best
Dave


On 27 Sep 2018, at 20:10, Dave <dave@...> wrote:

Hi,

I’m using Manual Layout on a Mac project. The View Hierarchy is built in Interface Builder and during run time I add a subview to one of the views. However, resizeWithOldSuperviewSize is not being called on these subviews. The subview in question is a subclass of NSImageView.

I’ve explicitly set autoresizesSubviews = YES in the view that adds the subview (actually is all the views in the Hierarchy).

Anyone have half an idea why resizeWithOldSuperviewSize is not being called? The frame of the parent rectangle is definitely being set…..

All the Best
Dave









Re: resizeWithOldSuperviewSize not getting called on added Subview

Dave
 

Ahhhh, found something interesting:

self.translatesAutoresizingMaskIntoConstraints = NO;

Then resizeWithOldSuperviewSize gets called!!! BUT the image no longer resizes inside the Image View. Is there a way I can so this manually?

All the Best
Dave

On 28 Sep 2018, at 19:21, Dave <dave@...> wrote:

I did the resizing in the viewDidEndLiveResize method and it does resize correctly, but the problem is that the image stays at the old size until the User stops re-sizing the window (e.g. mouseUp’s) and then it resizes them, which won’t do!

I’ll keep digging!

On 28 Sep 2018, at 19:15, Dave <dave@...> wrote:

Hi Again,

After digging around a little I find this:

https://lists.apple.com/archives/cocoa-dev///2005/Oct/msg00476.html

It seems that someone else has noticed this way back in 2005! From looking at the article, it mentions:

-(void) viewDidEndLiveResize

While I added to the GameImageView class and it does get called, I’m not sure if I can use it or not, but I’d really, really, really like to know if resizeWithOldSuperviewSize is a known bug or if I’m doing something wrong?

All the Best
Dave

On 28 Sep 2018, at 12:34, Dave <dave@...> wrote:

This is a Mac Project.

I’ve not found anything obvious on this, so I’m trying to get to the bottom of why the auto-resizing mechanism is not working with Class that inherits from NSImageView called GameImageView. An object is created and added to the view hierarchy at run time.

The view hierarchy is actually setup in a Storyboard/NIB and looks something like this:

WindowTrackerView
GameBaseView
TopAreaView
BottomAreaView
LeftAreaView
RightAreaView
GameBoardView
GameClusterView1
GameCellView1
GameCellView2
GameCellViewN
GameClusterView2
GameCellView1
GameCellView2
GameCellViewN
GameClusterViewN
GameCellView1
GameCellView2
GameCellViewN


I am adding GameImageView to each of the GameCellView's at runtime. All the Views are now using resizeWithOldSuperviewSize to resize themselves and it works wonderfully EXCEPT then this mechanism is not working on the run-time added GameImageView’s, e.g. GameImageView ::resizeWithOldSuperviewSize never gets called, although it does get called in the GameCellView’s.

If I do this in the GameCellView:: resizeWithOldSuperviewSize method it works ok (e.g. the Image resized when I resize the window):

myCellStartPosition = [self getCellXYPosition];

myBoundingRect = self.superview.bounds;
myFrameRect = [self calculateFrameRectWithSuperViewRect:myBoundingRect];

myFrameRect.origin.x = (int) (3 + (myCellStartPosition.x * (myFrameRect.size.width + 2)));
myFrameRect.origin.y = (int) (3 + (myCellStartPosition.y * (myFrameRect.size.height + 2)));

self.frame = myFrameRect;

//**
//** Setup the Image View Frame based on the Cell’s view *********************
//**
myImageFrameRect = NSInsetRect(self.bounds,2,2);
self.pCellImageView.frame = myImageFrameRect;

e.g. if I set the the frame of the GameImageView in the Superclass it works ok. If I don’t do this expecting GameCellView:: resizeWithOldSuperviewSize to be called then the image does NOT resize, since it isn’t called!! I’m trying to understand why this doesn’t work as expected, I’m not doing anything different (apart from adding it as a subview at runtime) from the other classes in the hierarchy and they all work wonderfully.

I’ve more or less got it working, but this last part is driving me nuts, so if anyone can shed some light on what could be going wrong I’m be really grateful.

Thanks in advance.

All the Best
Dave


On 27 Sep 2018, at 20:10, Dave <dave@...> wrote:

Hi,

I’m using Manual Layout on a Mac project. The View Hierarchy is built in Interface Builder and during run time I add a subview to one of the views. However, resizeWithOldSuperviewSize is not being called on these subviews. The subview in question is a subclass of NSImageView.

I’ve explicitly set autoresizesSubviews = YES in the view that adds the subview (actually is all the views in the Hierarchy).

Anyone have half an idea why resizeWithOldSuperviewSize is not being called? The frame of the parent rectangle is definitely being set…..

All the Best
Dave








Re: resizeWithOldSuperviewSize not getting called on added Subview

Dave
 

I did the resizing in the viewDidEndLiveResize method and it does resize correctly, but the problem is that the image stays at the old size until the User stops re-sizing the window (e.g. mouseUp’s) and then it resizes them, which won’t do!

I’ll keep digging!

On 28 Sep 2018, at 19:15, Dave <dave@...> wrote:

Hi Again,

After digging around a little I find this:

https://lists.apple.com/archives/cocoa-dev///2005/Oct/msg00476.html

It seems that someone else has noticed this way back in 2005! From looking at the article, it mentions:

-(void) viewDidEndLiveResize

While I added to the GameImageView class and it does get called, I’m not sure if I can use it or not, but I’d really, really, really like to know if resizeWithOldSuperviewSize is a known bug or if I’m doing something wrong?

All the Best
Dave

On 28 Sep 2018, at 12:34, Dave <dave@...> wrote:

This is a Mac Project.

I’ve not found anything obvious on this, so I’m trying to get to the bottom of why the auto-resizing mechanism is not working with Class that inherits from NSImageView called GameImageView. An object is created and added to the view hierarchy at run time.

The view hierarchy is actually setup in a Storyboard/NIB and looks something like this:

WindowTrackerView
GameBaseView
TopAreaView
BottomAreaView
LeftAreaView
RightAreaView
GameBoardView
GameClusterView1
GameCellView1
GameCellView2
GameCellViewN
GameClusterView2
GameCellView1
GameCellView2
GameCellViewN
GameClusterViewN
GameCellView1
GameCellView2
GameCellViewN


I am adding  GameImageView to each of the GameCellView's at runtime. All the Views are now using resizeWithOldSuperviewSize to resize themselves and it works wonderfully EXCEPT then this mechanism is not working on the run-time added GameImageView’s, e.g. GameImageView ::resizeWithOldSuperviewSize never gets called, although it does get called in the GameCellView’s.

If I do this in the GameCellView:: resizeWithOldSuperviewSize method it works ok (e.g. the Image resized when I resize the window):

myCellStartPosition = [self getCellXYPosition];

myBoundingRect = self.superview.bounds;
myFrameRect = [self calculateFrameRectWithSuperViewRect:myBoundingRect];

myFrameRect.origin.x = (int) (3 + (myCellStartPosition.x * (myFrameRect.size.width + 2)));
myFrameRect.origin.y = (int) (3 + (myCellStartPosition.y * (myFrameRect.size.height + 2)));

self.frame = myFrameRect;

//**
//**  Setup the Image View Frame based on the Cell’s view   *********************
//**
myImageFrameRect = NSInsetRect(self.bounds,2,2);
self.pCellImageView.frame = myImageFrameRect;

e.g. if I set the the frame of the GameImageView in the Superclass it works ok. If I don’t do this expecting GameCellView:: resizeWithOldSuperviewSize to be called then the image does NOT resize, since it isn’t called!! I’m trying to understand why this doesn’t work as expected, I’m not doing anything different (apart from adding it as a subview at runtime) from the other classes in the hierarchy and they all work wonderfully.

I’ve more or less got it working, but this last part is driving me nuts, so if anyone can shed some light on what could be going wrong I’m be really grateful.

Thanks in advance.

All the Best
Dave


On 27 Sep 2018, at 20:10, Dave <dave@...> wrote:

Hi,

I’m using Manual Layout on a Mac project. The View Hierarchy is built in Interface Builder and during run time I add a subview to one of the views. However, resizeWithOldSuperviewSize is not being called on these subviews. The subview in question is a subclass of NSImageView. 

I’ve explicitly set autoresizesSubviews = YES in the view that adds the subview (actually is all the views in the Hierarchy).

Anyone have half an idea why resizeWithOldSuperviewSize is not being called? The frame of the parent rectangle is definitely being set…..

All the Best
Dave














Re: resizeWithOldSuperviewSize not getting called on added Subview

Dave
 

Hi Again,

After digging around a little I find this:

https://lists.apple.com/archives/cocoa-dev///2005/Oct/msg00476.html

It seems that someone else has noticed this way back in 2005! From looking at the article, it mentions:

-(void) viewDidEndLiveResize

While I added to the GameImageView class and it does get called, I’m not sure if I can use it or not, but I’d really, really, really like to know if resizeWithOldSuperviewSize is a known bug or if I’m doing something wrong?

All the Best
Dave

On 28 Sep 2018, at 12:34, Dave <dave@...> wrote:

This is a Mac Project.

I’ve not found anything obvious on this, so I’m trying to get to the bottom of why the auto-resizing mechanism is not working with Class that inherits from NSImageView called GameImageView. An object is created and added to the view hierarchy at run time.

The view hierarchy is actually setup in a Storyboard/NIB and looks something like this:

WindowTrackerView
GameBaseView
TopAreaView
BottomAreaView
LeftAreaView
RightAreaView
GameBoardView
GameClusterView1
GameCellView1
GameCellView2
GameCellViewN
GameClusterView2
GameCellView1
GameCellView2
GameCellViewN
GameClusterViewN
GameCellView1
GameCellView2
GameCellViewN


I am adding GameImageView to each of the GameCellView's at runtime. All the Views are now using resizeWithOldSuperviewSize to resize themselves and it works wonderfully EXCEPT then this mechanism is not working on the run-time added GameImageView’s, e.g. GameImageView ::resizeWithOldSuperviewSize never gets called, although it does get called in the GameCellView’s.

If I do this in the GameCellView:: resizeWithOldSuperviewSize method it works ok (e.g. the Image resized when I resize the window):

myCellStartPosition = [self getCellXYPosition];

myBoundingRect = self.superview.bounds;
myFrameRect = [self calculateFrameRectWithSuperViewRect:myBoundingRect];

myFrameRect.origin.x = (int) (3 + (myCellStartPosition.x * (myFrameRect.size.width + 2)));
myFrameRect.origin.y = (int) (3 + (myCellStartPosition.y * (myFrameRect.size.height + 2)));

self.frame = myFrameRect;

//**
//** Setup the Image View Frame based on the Cell’s view *********************
//**
myImageFrameRect = NSInsetRect(self.bounds,2,2);
self.pCellImageView.frame = myImageFrameRect;

e.g. if I set the the frame of the GameImageView in the Superclass it works ok. If I don’t do this expecting GameCellView:: resizeWithOldSuperviewSize to be called then the image does NOT resize, since it isn’t called!! I’m trying to understand why this doesn’t work as expected, I’m not doing anything different (apart from adding it as a subview at runtime) from the other classes in the hierarchy and they all work wonderfully.

I’ve more or less got it working, but this last part is driving me nuts, so if anyone can shed some light on what could be going wrong I’m be really grateful.

Thanks in advance.

All the Best
Dave


On 27 Sep 2018, at 20:10, Dave <dave@...> wrote:

Hi,

I’m using Manual Layout on a Mac project. The View Hierarchy is built in Interface Builder and during run time I add a subview to one of the views. However, resizeWithOldSuperviewSize is not being called on these subviews. The subview in question is a subclass of NSImageView.

I’ve explicitly set autoresizesSubviews = YES in the view that adds the subview (actually is all the views in the Hierarchy).

Anyone have half an idea why resizeWithOldSuperviewSize is not being called? The frame of the parent rectangle is definitely being set…..

All the Best
Dave








Re: Mail Icon for iOS

Quincey Morris
 

Not necessarily. I don’t have a documentation link, but I’m pretty sure that Apple won’t let you use one of their icons for a function (e.g. “Send Mail”) in your own app. If you’re using the icon to represent the app itself (e.g. to choose an app to use for sending mail from a list of apps), then I think it’s OK, but I seem to recall that you can’t just appropriate Apple iconography.

On Sep 28, 2018, at 06:00 , Steve Mills via Groups.Io <sjmills@...> wrote:

I would think that would be a fair use


Re: Mail Icon for iOS

Steve Mills
 

On Sep 28, 2018, at 00:39:24, Gerriet M. Denkmann <g@...> wrote:


Well, I was thinking of the AppIcon of Mail.app. On macOS I could do:
[NSRunningApplication runningApplicationsWithBundleIdentifier: “com.apple.main”].firstObject.icon

But there seems to be no RunningApplication on iOS.

And even if: Apple might not appreciate my usage of their Mail icon.
Probably not worth the trouble.
I would think that would be a fair use - click this to send an email with Mail.app. No different than how tons of apps show icons of other apps for launching or doing actions with them. Is there no icon service sort of thing on iOS for looking up an icon by UTI, where something like com.apple.mail might be the UTI to request?

--
Steve Mills
Drummer, Mac geek


Re: Word detection without separating spaces

Jeremy Hughes
 

You could try taking the first n characters of a word (where n is 1 to maximum word length) and spell checking that string. When you a string that spell-checks, continue for the next n characters, and so on. If you get to a point where you can’t find a word for the remaining characters, backtrack and look for a longer word in the previous characters.

Some strings might have multiple answers:

findale could be find ale or fin dale

Jeremy

641 - 660 of 1457