Re: NSTableCellView Constraints?

2015-01-28 Thread Kyle Sluder
On Tue, Jan 27, 2015, at 07:25 PM, Thomas Wetmore wrote:
> I defer to the experts. But for me view-based tables no longer work 'as
> expected’ (how they worked with cell-based tables). That is, one now has
> to explicitly add constraints in order to get the text in cells to widen
> and shrink properly as the user widens and shrinks column headers.

You can use a regular NSControl subclass as the cell view of a table
view. It does not need to be embedded in an NSTableCellView. Then you
don't need to specify any constraints at all.

> To me,
> a non expert, this is disconcerting when first encountered, and seems
> sloppy, and like something overlooked. It is just one more of thousands
> of little irksome details that I must fight may way through to learning
> in order to get a good looking Mac app. But thanks to this list I can add
> constraints in order to get that expected behavior.

It sounds like a good enhancement request to file here might be: "When
converting a table view from cell-based to view-based, Interface Builder
should automatically add constraints that fill the cell views."

--Kyle Sluder

___

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: Torrential logging output from AVPlayer

2015-01-28 Thread Kyle Sluder
On Tue, Jan 27, 2015, at 06:41 PM, SevenBits wrote:
> On Tuesday, January 27, 2015, Graham Cox  wrote:
> 
> > When I use AVPlayer to play a video file, I get a massive number of
> > messages logged from mpeg2parser, e.g:
> >
> 
> This happens to me as well when streaming audio on 10.10 using AVPlayer.
> I'd appreciate a solution as well.

Please file a Radar.

--Kyle Sluder
___

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 6 and 6 plus artwork

2015-01-28 Thread Mazzaroth M.
hi all, I have a graphical asset that is 320x107 @1x. what are its required
dimensions for iphone 6 and iphone 6 plus?

@2x the image is 640x214 px. It looks fine on 4S/5/5S

But my @3x artwork is 960x321 .. but it gets vertically `squished` on
iphone 6 and 6plus. The image needs to span the width of the device.
___

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 6 and 6 plus artwork

2015-01-28 Thread David Duncan

> On Jan 28, 2015, at 9:54 AM, Mazzaroth M.  wrote:
> 
> hi all, I have a graphical asset that is 320x107 @1x. what are its required
> dimensions for iphone 6 and iphone 6 plus?
> 
> @2x the image is 640x214 px. It looks fine on 4S/5/5S
> 
> But my @3x artwork is 960x321 .. but it gets vertically `squished` on
> iphone 6 and 6plus. The image needs to span the width of the device.


The screen size vended for an iPhone 6 is 375x667@2x, and for an iPhone 6 Plus 
414x736@3x (in normal mode, in zoomed mode you see iPhone 5/5S dimensions on an 
iPhone 6, and iPhone 6 dimensions @3x on an iPhone 6 Plus).

You probably want to master larger images for those devices.
--
David Duncan


___

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

How to wire up document exporting?

2015-01-28 Thread Charles Jenkins
To save my app’s native document format, I overrode NSDocument’s 
fileWrapperOfType:error:. I have assumed that the reason I produce data 
something else actually writes out is because the OS has security features, and 
a sandboxed app is not allowed to create arbitrary files on the filesystem.  

I need to have a File > Export command to save the document in OpenXML format. 
I’ve done some research in the Developer Library, and the best clues I’ve found 
so far are in the Sketch app. Sketch manages multiple output types by 
overriding NSDocument’s dataOfType:error: and paying attention to the requested 
type name. Somehow that gets called by saveDocumentTo:

My app needs to work more like Pages, by presenting a dialog confirming export 
options before the OpenXML file is generated. I can see where I might have to 
do this by overriding saveDocumentTo: so my options dialog will appear and 
eventually dataOfType:error: will be called. But I’m worried that dataOfType 
and fileWrapperOfType can’t both be used???

Am I on the right track here, or is there some other path Export menu items 
should take?

—

Charles Jenkins

___

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

Allow tap events outside a custom UIPresentationController on iPad(iOS 8)

2015-01-28 Thread Mazzaroth M.
I want to have a custom `modal` appear over the Master portion of a
UISplitViewController. So far, I've managed to cobble together a
UIViewControllerTransitioningDelegate, a UIPresentationController subclass.

chartSummaryNavigationController.transitioningDelegate =
_transitioningDelegate;
[self presentViewController:chartSummaryNavigationController
animated:YES completion:NULL];

in the UIPresentationViewController subclass, I override

-frameOfPresentedViewInContainerView
and
-sizeForChildContentContainer:withParentContainerSize:

so far. Just hoping to get it `working` and in
-sizeForChildContentContainer:withParentContainerSize: return a smaller
width than the landscape iPad. Voila, the modal does a standard
presentation transition from the bottom of the screen. However, tapping
anywhere around the presented modal results in no events, which is what I
actually want. In -frameOfPresentedViewInContainerView I noticed that
self.containerView.frame returns a frame the size of the entire iPad. Is
that why I get no events around the presentedViewController? If so, how do
I reduce the frame of self.containerView to match that of the presented
controller?

If that's not the problem, is there another way to allow tap events outside
a presented view controller?

Michael
___

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: How to wire up document exporting?

2015-01-28 Thread Quincey Morris
On Jan 28, 2015, at 16:16 , Charles Jenkins  wrote:
> 
> I need to have a File > Export command to save the document in OpenXML 
> format. I’ve done some research in the Developer Library, and the best clues 
> I’ve found so far are in the Sketch app. Sketch manages multiple output types 
> by overriding NSDocument’s dataOfType:error: and paying attention to the 
> requested type name. Somehow that gets called by saveDocumentTo:
> 
> My app needs to work more like Pages, by presenting a dialog confirming 
> export options before the OpenXML file is generated. I can see where I might 
> have to do this by overriding saveDocumentTo: so my options dialog will 
> appear and eventually dataOfType:error: will be called. But I’m worried that 
> dataOfType and fileWrapperOfType can’t both be used???


(It's not clear whether you really want File -> Export, or whether you want an 
alternative document type for a regular Save/Save As/etc. …)

There’s no set in stone way of handling export, but I think a rational place to 
start is to think of it as writing a file format that’s incompatible with your 
document editing environment. That is, any file formats in which you can save 
your data model without loss of information are a document type, while an 
export type implies you can’t re-open the exported file and have the document 
data you started with.

This can get a little confusing, because your plist might have “document” type 
definitions in your plist for types that your document can’t save as — if you 
can view or import other file formats, for example.

But generally, document types are handled by the NSDocument save mechanism, 
exports aren’t. So, when the user chooses an export function:

— If necessary, put up a sheet asking for the export parameters.

If this information is simple, you can add it as an accessory view of the save 
panel, and skip this step. However, some things are awkward to do from the save 
panel, particularly validation of user choices, so it’s often easier to use a 
separate sheet first.

— Put up a NSSavePanel asking for the destination of the save. (This will 
automatically take care of sandboxing restrictions.)

— If necessary, customize the save panel to allow the user to choose an export 
format. (Often, the export format is determined by the originally chosen export 
function, or is chosen in the export parameters sheet, but sometimes it’s 
clearer to let the specific format be chosen at the same time as the file is 
named.)

Once you’ve collected all this information, you can write the export file 
directly, not using the NSDocument save mechanism. The only thing you have to 
take care with is concurrency issues with the document/model, especially if you 
move the export to a background thread to avoid blocking the main thread.



___

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: drawRect runs twice, bounds are changed in between

2015-01-28 Thread N!K
Uti, 

Looking further into your uncertainty about where temp comes from (see previous 
email, below) reveals a possible memory leak. 

NSBezierPath* temp;  is in the list of declarations.
This snippet is in drawRect:

NSAffineTransform* tfm = [[NSAffineTransform alloc] init];
[tfm scaleXBy:scaleX yBy:scaleY];
temp  = [tfm transformBezierPath:_path];
NSLog(@“\n\n temp = %p\n\n",temp);

drawRect runs many times while  dragging the corner of the window. 
transformBezierPath: creates a new object each time. 
A new temp is created each time. Just one memory location is not used 
repeatedly. 

Here’s a list of temp addresses — not temp content  —   (from NSLog %p above) 
while dragging the corner of the window slightly. They are all different.

2015-01-28 16:27:44.042 CVone[780:303] 

 temp = 0x608000320960

2015-01-28 16:27:44.094 CVone[780:303] 

 temp = 0x60800013fd60

2015-01-28 16:27:49.465 CVone[780:303] 

 temp = 0x6080003212c0

2015-01-28 16:27:49.484 CVone[780:303] 

 temp = 0x6013ff40

2015-01-28 16:27:49.501 CVone[780:303] 

 temp = 0x608000321180

2015-01-28 16:27:49.523 CVone[780:303] 

 temp = 0x608000320be0

2015-01-28 16:27:49.541 CVone[780:303] 

I hope ARC keeps cleaning them up. Or do I have a memory leak? If so, I’d 
appreciate some guidance on how to fix it.

Nick



On Jan 16, 2015, at 5:30 AM, Uli Kusterer  wrote:

> On 15 Jan 2015, at 07:58, Quincey Morris 
>  wrote:
>> Putting those two ideas together leads to a better approach. Create the 
>> bezier path once, relative to an arbitrary bounding rect — say 1000 x 1000. 
>> (But any rect would do.) When you need to draw the path, set the CTM of the 
>> context to scale 1000 x 1000 (the reference bounds) to the context’s width x 
>> height (the view bounds). Then just draw the original path and AppKit will 
>> scale the bezier path for you.
> 
> That's not the be-all end-all, though. Scaling the CTM scales line widths and 
> heights as well. So if you for example want to skew the path, you'd get lines 
> that are wider than they are tall (kind of calligraphic). Also, changing the 
> CTM means that mouse click coordinates will be in a different coordinate 
> system then your drawing, so if you’re e.g. implementing a graphics editor, 
> you'll have to manually translate the coordinates each time.

> 
> A better idea might be to have a list of original objects and projected 
> objects. The list of projected objects is generated by transforming the 
> paths. Whenever your view's bounds change, you rebuild this list of projected 
> objects from the originals (thus keeping rounding errors etc. to a minimum as 
> they can't accumulate). The drawing code just draws this projected list.
> 
> As I don't know where 'temp' comes from in N!K’s code,

NSBezierPath* temp;  is in the list of declarations.

_path is created once, in -(id)initWithCoder:(NSCoder*)coder . 
_path is scaled to the new size and assigned to  temp each time drawRect is 
called. Thus, there is no error buildup.

> this may be what's already happening, in which case I find that a better 
> approach than mangling the CTM if your interest is in having a shape drawn 
> crisply in a window. If you're instead looking to scale a drawing (whether 
> vector or otherwise), where you want lines to be skewed, then Quincy.s 
> approach is preferrable.
> 
> -- Uli


Nick
___

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: drawRect runs twice, bounds are changed in between

2015-01-28 Thread Graham Cox

> On 29 Jan 2015, at 3:05 pm, N!K  wrote:
> 
> NSBezierPath* temp;is in the list of declarations.
> This snippet is in drawRect:
> 
>NSAffineTransform* tfm = [[NSAffineTransform alloc] init];
>[tfm scaleXBy:scaleX yBy:scaleY];
>   temp  = [tfm transformBezierPath:_path];
>   NSLog(@“\n\n temp = %p\n\n",temp);
> 
> 
> I hope ARC keeps cleaning them up. Or do I have a memory leak? If so, I’d 
> appreciate some guidance on how to fix it.


You're fine leaks-wise, but your code might be cleaner. The bezier path 
returned by [tfm transformBezierPath] is autoreleased. ARC cleans up tfm, temp 
is released at the end of the event cycle. If temp is an ivar, and it's not 
used anywhere else, just make it a local var (it will be stale after the event 
cycle completes anyway). If it's an ivar and it is referenced elsewhere, you 
probably should make it a strong property instead.

--Graham



___

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