Re: UIDocumentBrowserViewController and file package documents

2017-06-20 Thread Kyle Sluder
On Tue, Jun 20, 2017, at 03:40 PM, davel...@mac.com wrote:
> I'm trying out the new UIDocumentBrowserViewController in iOS 11 (using
> the iPad simulator). I can get it to create a new document (which is a
> file package) for my app, but tapping on the document in the
> UIDocumentBrowserViewController does not cause the delegate method
> documentBrowser(_ controller: UIDocumentBrowserViewController,
> didPickDocumentURLs documentURLs: [URL]) to get called.
> 
> It does get called for another document type that is a flat file (not a
> file package), but it doesn't work with the file package document created
> by NSFileWrapper.
> 
> Am I doing something wrong or is this a bug with file packages?

Please file a bug report and send me the number so I can ensure the
correct team sees it.

Thanks,
--Kyle

> 
> Thanks,
> 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


Re: Using Quartz Debug to simulate Retina display broken?

2017-04-06 Thread Kyle Sluder
On Thu, Apr 6, 2017, at 06:05 PM, Sean McBride wrote:
> Hi all,
> 
> It's been a few years since I tried to simulate a Retina display on my
> non-Retina monitor.  I used Quartz Debug (version 4.2 (182)) as described
> here:
> 
> <https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Testing/Testing.html>
> 
> and despite letting it log me out, there are no "HiDPI" options available
> in System Preferences > Displays.  I'm on 10.12.4 on a MacPro5,1.  
> 
> Anyone used this successfully recently?

Quartz Debug’s capabilities are tied pretty closely to your specific
hardware configuration, which for your model of Mac in particular can
vary widely. Please take a sysdiagnose and file a bug report.

--Kyle Sluder


> 
> Thanks,
> 
> -- 
> 
> Sean McBride, B. Eng s...@rogue-research.com
> Rogue Researchwww.rogue-research.com 
> Mac Software Developer  Montréal, Québec, Canada
___

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: Sierra Document Handling

2017-04-06 Thread Kyle Sluder
On Thu, Apr 6, 2017, at 06:28 PM, Richard Charles wrote:
> 
> > On Apr 6, 2017, at 11:38 AM, Kyle Sluder <k...@ksluder.com> wrote:
> > 
> > Do you have “Desktop & Documents Folders” enabled in System Preferences 
> > iCloud > iCloud Drive Options…?
> 
> No. But the problem occurs if this is on or off. It does not matter.
> 
> As a side note enabling iCloud Drive “Desktop & Documents Folders” can be
> very dangerous. When this is enabled and then disabled the entire content
> of the Desktop and Documents folders will be removed. A very disturbing
> event. Your content however, is still available on iCloud drive.
> 
> This is absolutely crazy. This endless push to dumb down the mac platform
> at all costs is not appreciated. The individuals at Apple that
> implemented this feature must have lost their minds.
> 
> > Take a sysdiagnose (sudo sysdiagnose in Terminal, or
> > Command-Option-Control-Shift-Period key combo). Then file a bug report
> > at https://bugreport.apple.com.
> 
> Further testing has shown that this problem also occurs with a new Xcode
> project template (core data document based application). It occurs on my
> development machine and also on my 11 inch MacBook Air.
> 
> I discovered others have had similar issues.
> 
> https://github.com/coteditor/CotEditor/issues/591
> 
> https://forums.developer.apple.com/message/79226
> 
> So it appears like this is an Apple problem with basic document
> functionality so I think I will forgo submitting a bug report. (I have
> come to the conclusion that in many if not most cases bug reports are a
> waste of time.)

Neither of these links mentions bug report numbers. If the participants
of those threads have chosen to withhold their bug reports like you
have, is it any wonder it hasn’t been fixed?

If you encounter a bug, please file a bug report.

--Kyle Sluder

> 
> Thanks for your help.
> 
> --Richard Charles
> 
___

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: Reference to embedded view controller in IB?

2017-04-06 Thread Kyle Sluder


On Thu, Apr 6, 2017, at 04:25 PM, Jean-Daniel wrote:
> 
> > Le 6 avr. 2017 à 22:35, Kyle Sluder <k...@ksluder.com> a écrit :
> > 
> > On Wed, Apr 5, 2017, at 03:42 PM, Doug Hill wrote:
> >> I have a view controller that I instantiate in my Storyboard. This view
> >> controller has an embedding view inside it's view, and this embedding
> >> view has another view controller in it.
> >> 
> >> I need to configure this embedded view controller but I don't know a way
> >> to make it available to my container VC in Interface Builder. For
> >> example, it would be great to create an outlet in my container view
> >> controller to the embedded view controller. But I don't see any way to do
> >> this.
> >> 
> >> Can this be done? Are there other ways to get a reference to the embedded
> >> view controller at runtime?
> > 
> > Give an identifier to the embed segue and implement -prepareForSegue: in
> > your root VC to check for this segue and grab its destination VC.
> > 
> > --Kyle Sluder
> 
> Is prepareForSegue called for all kinds of segue, including embedding VC
> ? This is definitely not the case on macOS, but the behavior may be
> different on iOS.

It is not called for all segues, but it should be called for embed
segues created by dragging out a Container View from the Object Library.

Some things which Interface Builder models as relationship segues (like
a navigation controller’s Root View Controller relationship segue) are
not actually implemented with UIStoryboardSegue at runtime, so those
don’t get -prepareForSegue:. Embed segues are real segues which fire at
-viewDidLoad time.

--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: Reference to embedded view controller in IB?

2017-04-06 Thread Kyle Sluder
On Wed, Apr 5, 2017, at 03:42 PM, Doug Hill wrote:
> I have a view controller that I instantiate in my Storyboard. This view
> controller has an embedding view inside it's view, and this embedding
> view has another view controller in it.
> 
> I need to configure this embedded view controller but I don't know a way
> to make it available to my container VC in Interface Builder. For
> example, it would be great to create an outlet in my container view
> controller to the embedded view controller. But I don't see any way to do
> this.
> 
> Can this be done? Are there other ways to get a reference to the embedded
> view controller at runtime?

Give an identifier to the embed segue and implement -prepareForSegue: in
your root VC to check for this segue and grab its destination VC.

--Kyle Sluder

> 
> Thanks.
> 
> Doug Hill
> https://github.com/djfitz/SFFontFeatures
___

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: Sierra Document Handling

2017-04-06 Thread Kyle Sluder
On Wed, Apr 5, 2017, at 03:27 PM, Richard Charles wrote:
> Since switching to macOS 10.12 Sierra I am getting tons of document
> handling messages in the Xcode debug console for my document based
> application.
> 
> // Delete existing document then launch app.
> 
> 2017-04-05 13:58:13.795408 MyApp[42310:2124840]
> Item: myFile [9FC1873C-34CA-4E66-9155-99480B47CB11]
> - URL:file:///Users/richard/Desktop/myFile
>   1   SharedFileList   0x7fffa0089549 -[SFLList removeItem:]
>   + 57
>   2   SharedFileList   0x7fffa009d089
>   LSSharedFileListItemRemove + 176
>   3   Foundation   0x7fffa061f2d9
>   __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 7
>   4   Foundation   0x7fffa061efbc -[NSBlockOperation
>   main] + 101
>   5   Foundation   0x7fffa061d6e4 -[__NSOperationInternal
>   _start:] + 672
>   6   Foundation   0x7fffa061959b __NSOQSchedule_f + 201
>   7   libdispatch.dylib0x0001013b9f5c
>   _dispatch_client_callout + 8
>   8   libdispatch.dylib0x0001013d1a59
>   _dispatch_queue_serial_drain + 205
>   9   libdispatch.dylib0x0001013c3489 _dispatch_queue_invoke
>   + 1174
>   10  libdispatch.dylib0x0001013bc1d7
>   _dispatch_root_queue_drain + 671
>   11  libdispatch.dylib0x0001013bbee8
>   _dispatch_worker_thread3 + 114
>   12  libsystem_pthread.dylib  0x00010143189a _pthread_wqthread +
>   1299
>   13  libsystem_pthread.dylib  0x000101431375 start_wqthread + 13
> 
> // Save document using save panel.
> 
> 2017-04-05 14:00:40.696444 MyApp[42368:2127556] [default] [ERROR] Failed
> getting container for URL: file:///Users/richard/Desktop/, error: Error
> Domain=BRCloudDocsErrorDomain Code=12 "App library not found:
> 'com.apple.Desktop'" UserInfo={NSDescription=App library not found:
> 'com.apple.Desktop'}
> 
> // Launch app and choose File > Open.
> 
> 2017-04-05 14:05:53.192756 MyApp[42529:2134332] [default] [ERROR] Failed
> getting container for URL: file:///Users/richard/Desktop/, error: Error
> Domain=BRCloudDocsErrorDomain Code=12 "App library not found:
> 'com.apple.Desktop'" UserInfo={NSDescription=App library not found:
> 'com.apple.Desktop'}
> 
> This never happened before Sierra. The app is signed but with no
> entitlements. Everthing seems to be working correctly, I just get tons of
> messages in the console.

Do you have “Desktop & Documents Folders” enabled in System Preferences
> iCloud > iCloud Drive Options…?

Take a sysdiagnose (sudo sysdiagnose in Terminal, or
Command-Option-Control-Shift-Period key combo). Then file a bug report
at https://bugreport.apple.com.

--Kyle

> 
> --Richard Charles
___

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: Rect for centered text in UILabel?

2017-04-04 Thread Kyle Sluder


On Thu, Mar 30, 2017, at 10:18 AM, Eric E. Dolecki wrote:
> I have a very wide UILabel that will take different text over time.
> Single
> line. No attributed.
> 
> I would like to position an image to the left of the first character in
> the
> label any time it's updated. So I need to get a CGRect or something of
> the
> text within the UILabel itself. I know I did this years ago, but I can't
> remember how I did it.
> 
> Looking to do this in Swift. Any ideas or things I'm blanking on?

I think you’re looking for
UILabel.textRect(forBounds:limitedToNumberOfLines:).

--Kyle Sluder

> 
> Thanks,
> Eric
___

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: Menu Item Shortcuts Without Menu Items?

2017-03-16 Thread Kyle Sluder


On Mon, Mar 13, 2017, at 04:50 PM, Ken Thomases wrote:
> On Mar 13, 2017, at 5:12 PM, Frank D. Engel, Jr. <fde...@fjrhome.net>
> wrote:
> > 
> > I need to create the equivalent of a menu item shortcut, but without the 
> > menu item... or, to assign two different shortcuts to the same menu item.
> > 
> > More precisely: I have a menu item with a shortcut of Command+L.
> > 
> > I need Command+Shift+L to do exactly the same thing, but it doesn't look 
> > right having two copies of the menu item just to support a second shortcut.
> 
> Mark the second menu item as an alternate.  That is, set its "alternate"
> property to true.  It will "hide" in the same slot of the menu as the
> other item and only show when the extra modifier (Shift, in this case) is
> pressed.

One downside of this approach might be that the menu item appears twice
in VoiceOver. (I haven’t tried it myself.)

A more targeted approach might be to attach a delegate to the menu that
contains the aliased item, and implement
-menuHasKeyEquivalent:forEvent:target:action: to return the Command+L
menu item’s target and action if it sees Command+Shift+L.

--Kyle Sluder

> 
> Cheers,
> Ken

___

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: Issue with addTitlebarAccessoryViewController on 10.10

2017-03-05 Thread Kyle Sluder
On Fri, Mar 3, 2017, at 08:39 AM, Mark Allan wrote:
> Hi all,
> 
> I've got an NSWindow which has an NSToolbar added programmatically. The
> window does not use a shared title/toolbar.  I now want to add a little
> bit of text/button to the window's titlebar, so for OS X 10.6 to 10.9,
> I'm doing it the old way playing around with NSWindow subviews, which
> works fine.
> 
> On versions 10.10+ I'm using addTitlebarAccessoryViewController which
> works great on 10.11 and 10.12, but for some reason it shifts the toolbar
> buttons out of position on 10.10.
> 
> Judging by the AppKit release notes, this is a known issue which was
> fixed in 10.11, and also by linking on 10.11
> 
> > For applications linked on 10.11 and higher, a 
> > NSTitlebarAccessoryViewController with the layoutAttribute set to 
> > NSLayoutAttributeRight will no longer right indent toolbar items, unless 
> > the titleVisibility == NSWindowTitleHidden. This allows placing a 
> > view/button/textfield (etc) above the toolbar without right indenting the 
> > toolbar. However, for the NSWindowTitleHidden, there is still a desire to 
> > indent the toolbar on the right to leave space for the accessory view.
> 
> I'm currently building on macOS 10.12 (with target of 10.6) but the issue
> still shows up for users on OS X 10.11, even with the viewcontroller's
> layoutAttribute = NSLayoutAttributeRight.
> 
> Does anyone know of a fix or workaround I could use please?

Is it possible to reproduce this in a sample app? This should be
behaving as documented in the release notes.

--Kyle Sluder

> 
> If it comes to it, I could still use the old subview manipulation method
> on 10.10 and users would just have to put up with seeing junk in the log
> about adding an unknown subview, but I'd rather avoid that if possible!
> 
> Would appreciate any help.
> 
> Many thanks
> Mark
___

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: Sometimes all my menus are disabled

2017-02-12 Thread Kyle Sluder

>> On Feb 12, 2017, at 12:36 PM, Andreas Falkenhahn <andr...@falkenhahn.com> 
>> wrote:
> 
> 
>> On 12.02.2017 at 21:29 Kyle Sluder wrote:
>> 
>> You’ve wired up every single menu item to a single action in your app
>> delegate? That’s certainly non-standard.
> 
> It's really old code. It's an Xcode project I originally created on a
> PowerPC Mac some 10 years ago, so I don't really remember how I used
> Interface Builder back then. All I see is that every single menu item
> has an entry under "Sent Actions" that links to "AppDelegate: menuClick".
> The menu events are then processed in the "menuClick" method of my
> app delegate.
> 
>> By default, menus automatically enable/disable their items based on
>> whether the target can perform the action. Perhaps your app delegate is
>> being deallocated, and thus the menu is walking the responder chain and
>> failing to find a responder that responds to -menuClick:?
> 
> But how can that possibly happen? I'm certainly not deallocating the
> app delegate myself...

There are plenty of ways to write refcounting bugs. But the refcounting bug is 
just a theory. All we know for sure is that something is disabling the menu 
items. I assume you have not turned off the default autoenablesItems property 
on the menu, so that leaves a few possibilities:

1. The target of your menu items is being replaced with an object that does not 
respond to -menuClick:.
2. The target of your menu items is being deallocated, and a new object is 
being allocated in its place that does not respond to -menuClick:.
3. The target of your menu items is being deallocated, and NSMenuItem’s weak 
target pointer is being nilled out (special case of #1).
4. The menu has a delegate, and it implements of one of the menu update 
callbacks to disable the menu items.
5. Some arbitrary object in your app is grabbing a reference to the menu items 
and disabling them.

--Kyle Sluder

> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.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: Sometimes all my menus are disabled

2017-02-12 Thread Kyle Sluder


On Sun, Feb 12, 2017, at 11:01 AM, Andreas Falkenhahn wrote:
> I'm experiencing a strange issue with my app. Sometimes, maybe in 1 out
> of 10
> programs starts, all menus of my app are grayed out, including standard
> menus
> like "Services", "Hide XXX", "Hide Others", "Show All", "Minimize",
> "Zoom",
> "Bring All To Front", really everything is grayed out right after my app
> has
> launched!
> 
> I don't really know what to do about this because I don't have any actual
> code
> in my app that relates to menus. The menu is created in Interface Builder
> and
> the individual items are connected to "AppDelegate menuClick:" in the 
> "Sent Actions" part of Xcode. That's pretty much all I have.

You’ve wired up every single menu item to a single action in your app
delegate? That’s certainly non-standard.

By default, menus automatically enable/disable their items based on
whether the target can perform the action. Perhaps your app delegate is
being deallocated, and thus the menu is walking the responder chain and
failing to find a responder that responds to -menuClick:?

--Kyle Sluder

> 
> What could be the problem here? How can I find out what's going awry
> here?
> 
> As I said, in 9 of 10 attempts everything works fine, but in maybe 1 of
> 10
> attempts all menus are grayed out right after my app has launched, making
> it
> impossible to use my app :-(
> 
> -- 
> Best regards,
>  Andreas Falkenhahn 
>  mailto:andr...@falkenhahn.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: Enabling UISearchBar cancel button?

2017-01-23 Thread Kyle Sluder
On Wed, Jan 11, 2017, at 10:17 PM, Rick Mann wrote:
> I'm creating and displaying a UISearchBar without using
> UISearchController (it gets in the way).
> 
> My UISearchBar is installed in the storyboard via IB. I animate it into
> position in my UI when the user taps a button. However, the Cancel button
> is disabled. I pre-load the search bar with the text of the last search,
> so the button should be enabled.
> 
> Before, when I was using UISearchController, it was enabled. Now it's
> not, until the user taps on it!
> 
> Any idea how to enable it? Thanks!

Sorry, Rick. There is no supported way to enable a UISearchBar’s Cancel
button while it isn’t active.

--Kyle Sluder

> 
> -- 
> 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: Connecting NSTextStorage to a string

2016-12-28 Thread Kyle Sluder
> On Fri, Dec 23, 2016, at 09:16 PM, Daryle Walker wrote:
> The text controls on macOS use a NSTextStorage object to retain their
> text. That object is a extension of an attributed string. Let's say you
> use a NSString (or similar) in your document model. How should I get
> changes on one string to get mirrored on the other?

It depends on what you’re trying to do. The Cocoa text system is set up for two 
modes: editing rich text, and editing non-rich text.

In the rich-text case, the NSTextStorage object is intended to *be* the model 
object. It’s a long-lived object with its own optimized mutation scheme 
(-beginEditing/-endEditing and the mutators it inherits from 
NSMutableAttributedString), which is married to one particular NSTextView 
instance in the window. This of course means it’s not a great fit for 
frameworks like Core Data or Cocoa Bindings which expect model object 
properties to be simple value types. You can bridge this gap with various 
techniques, such as registering an object as the NSTextStorage’s delegate that 
posts your own notifications or triggers change notifications for a synthesized 
Core Data property.

The non-rich-text mode is more straightforward. In this mode, the NSTextStorage 
is permanently married to the window’s field editor, and as focus moves around 
the window its contents are batch-replaced with the underlying control’s 
stringValue as focus moves around the window. The controller is expected to 
listen to NSControl text editing notifications (possibly by acting as the 
control’s delegate) to know when to push values to the model. It is expected to 
use some other means, such as KVO, to push values from the model to the 
control. Cocoa Bindings intends to do this two-way marshaling on your behalf.

--Kyle Sluder

> 
> I think there are begin/end-editing flag methods on text controls, but
> how would I go the other way?
> 
> Sent from my iPhone


___

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: AVFoundation and the main thread

2016-12-20 Thread Kyle Sluder
On Tue, Dec 20, 2016, at 08:59 AM, Andreas Falkenhahn wrote:
> So everybody knows that all things relating to UIKit have to be done
> on the main thread.
> 
> But what about AVFoundation functions which bear some resemblance to
> UIKit APIs? Do these have to be called on the main thread too or can
> they also be called from a worker thread?
> 
> For example, when adding an AVPlayerLayer to a view using addSubview()
> I have to do this on the main thread of course.
> 
> But what about changing the frame size of an AVPlayerLayer using
> setFrame()? AVPlayerLayer inherits from CALayer which is part of the
> QuartzCore framework, not UIKit. But of course CALayer methods like
> setFrame() bear a strong resemblance to their UIKit counterparts so
> I'm wondering whether it is really allowed to call setFrame() from
> a worker thread?

Since AVPlayerLayer is a layer, not a view, it cannot be added with
addSubview. It can either be added as a sublayer to your view’s layer,
or it can be wrapped in a view and *that view* added as a subview.

The distinction is important in many ways, but in this case the answer
is the same for both: don’t do this from a background thread.

(Caveat: it is technically possible to do CALayer-level work on a
background thread, but you have to manage many aspects of the
CATransaction yourself. It’s not easy to do correctly, and it gets
_very_ complex when manipulating a layer tree from multiple threads
simultaneously. And as soon as one of these layers belongs to a view,
you must only touch it from the main thread.)

--Kyle Sluder

> 
> Also, what about AVPlayerLayer methods like removeFromSuperlayer()?
> Is this main thread only as well?

___

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: Substituting instance of cell subclass for instance of superclass

2016-11-11 Thread Kyle Sluder
On Fri, Nov 11, 2016, at 07:34 PM, James Walker wrote:
> I want to replace (for example) an instance of NSButtonCell with an 
> instance of my own subclass of NSButtonCell on the fly.  Now, I know 
> that's not a common thing to want to do; normally, you'd edit the nib to 
> use whatever cell class you want.  But I'd like to be able to do it to 
> an NSAlert, for which I don't have a nib.

You also have no idea if the NSAlert is already using a custom
NSButtonCell subclass—or whether it uses NSControl at all.

Your only option here is to reimplement the alert.

--Kyle Sluder

> 
> So, my thought was to first make an instance of my cell class that 
> copies all the state of the NSButtonCell instance, and then use 
> -[NSControl setCell:].  The documentation on setCell: does say:
> "Use this method with great care as it can irrevocably damage the 
> affected control; specifically, you should only use this method in 
> initializers for subclasses of NSControl."
> Anyone know what kind of damage we're talking about?
> 
> Anyway, as far as copying the cell state, I tried this:
> 
> - (id) initCopyingBaseCell: (NSButtonCell*) oldCell
> {
>   NSData* archive = [NSKeyedArchiver
>   archivedDataWithRootObject: oldCell];
>   NSKeyedUnarchiver* coder = [[[NSKeyedUnarchiver alloc]
>   initForReadingWithData: archive] autorelease];
>   
>   self = [super initWithCoder: coder];
>   if (self != nil)
>   {
>   
>   }
>   return self;
> }
> 
> However, the new cell has failed to copy much of the state of the old 
> one.  Things like title, font, target, action, bezelStyle...  I can 
> manually copy anything that I notice is missing, but I'm just wondering 
> why the keyed archiver approach here doesn't 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: How to count Atoms

2016-10-07 Thread Kyle Sluder


On Fri, Oct 7, 2016, at 11:24 AM, Jens Alfke wrote:
> 
> > On Oct 7, 2016, at 1:14 AM, Quincey Morris 
> > <quinceymor...@rivergatesoftware.com> wrote:
> > 
> > One straightforward way is to use dispatch_semaphore. IIRC it’s lightweight 
> > unless it blocks (that is, unless its count is zero when you wait), so it’s 
> > good for this situation where actual contention is rare (assuming actual 
> > contention is rare).
> 
> IMO dispatch_semaphore is overkill for this; it’s not just an atomic
> counter, it’s also got blocking behaviors for use in e.g. managing a pool
> of resources. I’ll bet that most Mac/iOS programmers don’t know about it,
> let alone people coming from other platforms.
> 
> The simplest solution is just to use an atomic operation. Even if there
> isn’t a standard atomic API in C (as there is in C++), anyone reading the
> code is probably going to understand what OSAtomicIncrement32() does just
> from its name.

OSAtomic.h (except for OSAtomicQueue) is deprecated. Don’t use
OSAtomicIncrement32 in new code.

--Kyle Sluder

> 
> —Jens

___

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: PDFKit on 10.12

2016-10-05 Thread Kyle Sluder
On Wed, Oct 5, 2016, at 04:08 AM, Jonathan Mitchell wrote:
> 
> > On 5 Oct 2016, at 07:52, Antonio Nunes <devli...@sintraworks.com> wrote:
> > 
> > On 04 Oct 2016, at 14:26, Jonathan Mitchell <li...@mugginsoft.com> wrote:
> >> 
> >> PDFKit seems a bit disturbed on Sierra.
> >> The 10.12 beta 3 seems to improve things but there are still some 
> >> rendering stutters etc.
> > 
> > 1. Why are you referring to a beta, when 10.12 has been out for weeks now?
> 
> Oops. that should have been 10.12.1 Beta (16B2338c)..
> 
> > Whatever is going on with PDFKit, it’s not good.
> 
> 
> I agree with that.
> 
> PDFKit is long in the tooth and the documentation is a bit patchy.
> However there is no way I can just write it off.
> 
> My solution involves assembling multipage PDFs from templates that
> incorporate a static base PDF over which I write text derived from my
> object model.
> The composed PDF is then viewed, printed or exported.
> On 10.9 to 10.11 peace reigns.
> 
> The 10.12 issues are rather unpredictable.
> Some documents render fine others don’t.
> Obviously this makes tracking down the source of the issues tough.
> It also makes it difficult to come up with meaningfully directed bug
> reports to send back in to bugreporter.apple.com.
> 
> It would be helpful if someone from the PDFKit development team would
> chip in with insight into how the kit has changed in 10.12.
> 
> If not I might need to go down the route of a TSI.

The first thing DTS will ask you is, “what are your bug numbers?” So
work on filing those first. A minimally-useful bug report is better than
no bug report at all.

--Kyle Sluder

> 
> Jonathan

___

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: Triggering a segue from code

2016-09-23 Thread Kyle Sluder
On Sep 22, 2016, at 10:13 PM, Shane Stanley <sstan...@myriad-com.com.au> wrote:
> 
>> On 23 Sep. 2016, at 1:17 pm, Kyle Sluder <k...@ksluder.com> wrote:
>> 
>> -close used to render windows more thoroughly dead
> 
> So can we assume that the close button generally calls -close?

No. You can assume it is morally similar to -performClose, but that is all the 
documentation promises.

> 
> On a tangent here...
> 
> In Safari, it used to be that if a script asked for the app's windows, 
> -orderedWindows would return a list of open windows. Under Sierra, however, 
> the list returned can include windows that have been closed via the close box 
> -- you might have closed them half-an-hour ago. They show with a visible 
> property of false, but by setting it to true they reappear -- no Web 
> contents, but the URL, title, etc all intact. And the only way to close them 
> is again via script -- their close buttons do nothing.
> 
> It's probably just a bug, although DTS don't seem to think so, but these 
> windows seem surprisingly resistant to death.

Did you file a Radar or merely contact DTS? Note that starting in Sierra you 
can use Cmd-Z to unclose more than just the most-recently-closed tab.

--Kyle Sluder

> 
> -- 
> Shane Stanley <sstan...@myriad-com.com.au>
> , 
> 
> 


___

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: Triggering a segue from code

2016-09-22 Thread Kyle Sluder
On Thu, Sep 22, 2016, at 02:47 PM, Quincey Morris wrote:
> On Sep 22, 2016, at 12:34 , Kyle Sluder <k...@ksluder.com> wrote:
> > 
> > -close asks the window’s delegate (via -windowShouldClose:) if it should
> > close. If the window is owned by a window controller that’s associated
> > with a document, the document will also get a chance to weigh in via
> > -shouldCloseWindowController:…. It will also send
> > NSWindowWillCloseNotification.
> > 
> > -orderOut: just hides the window (removes it from the window list). You
> > can always order it back in again later.
> 
> Yes, but ignore for a moment the “shouldClose…” interaction, and assume
> the window is NOT set to release on close. What *else* does “close” do
> vs. “orderOut”?

This question sounds vaguely similar to “What have the Romans done for
us?” from Life of Brian. ;-)

> 
> The example app mentioned in this thread demonstrates that “close” has
> some other effect beyond what “orderOut” does. In particular, a
> “single”-mode storyboard segue re-uses an ordered-out window, but not a
> closed one.

I must first admit, especially for the benefit of anyone who read the
documentation after I replied to you, that I was mistaken.
-shouldCloseWindowController: and -windowShouldClose: are only sent from
-performClose:, not from -close. Which makes sense: -close is the
unconditional way for an app (that might have even implemented its own
confirmation flow) to close a window.

Having made my apologies, -orderOut: and -close live at two levels of
abstraction. -orderOut deals with the window’s order and membership in
the window list. -close deals with higher-level semantics like window
controllers, documents, and notifications. As part of these higher-level
semantics, -close calls -orderOut:. For document-based apps, it also
dissociates the window from the document (and the window controller the
document made for it). And as Eric has discovered, it instructs the
Storyboard runtime to create a new instance of the window controller
rather than unhiding the existing one.

(-close used to render windows more thoroughly dead in the era of
releaseWhenClosed and one-shot backing stores. But those days are in the
past.)

--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: Triggering a segue from code

2016-09-22 Thread Kyle Sluder
On Mon, Sep 19, 2016, at 10:07 PM, Quincey Morris wrote:
> On Sep 19, 2016, at 18:10 , mail...@ericgorr.net
> <mailto:mail...@ericgorr.net> wrote:
> > 
> > The strange behavior I am now seeing is that when I show & hide the panel 
> > using the buttons are what appears to be two (not three, not four, etc.) 
> > different instances of the inspector panel. The autosave information only 
> > appears to apply to one but not the other.
> 
> A couple of things:
> 
> 1. You’re keeping the panel window instance reference in
> InspectorWindowController.sharedInstance, but not keeping a reference to
> its window controller. That causes its window controller to be
> deallocated early, although that likely has nothing to with the rest of
> the problem, since the panel doesn’t have any custom behavior yet. You
> should keep a reference to the window controller instead, and that will
> keep the panel alive too.
> 
> 2. You’re doing a “performClose” to hide the panel. If you do an orderOut
> instead, you get the behavior you want.
> 
> Note that you are getting a new instance of the panel because the window
> segue mechanism decides the first one has disappeared. Again because it’s
> not documented how window segues work, there’s no way of knowing what the
> “correct” behavior is supposed to be. (Your panel window is correctly set
> to “Single” mode in the storyboard, which is what’s supposed to prevent
> multiple instances from appearing.)
> 
> Also undocumented — forever AFAIK although others on this list may know
> more about this — is what a window “close” (or “performClose”) does,
> other than ordering out the window and (if it’s set to release on close)
> to release it.

-performClose: is documented to highlight the Close button, so that it
is highlighted if any “unsaved changes” confirmation sheets are
displayed. That helps the user understand what will happen to the
document window if they confirm the Save panel.

-close asks the window’s delegate (via -windowShouldClose:) if it should
close. If the window is owned by a window controller that’s associated
with a document, the document will also get a chance to weigh in via
-shouldCloseWindowController:…. It will also send
NSWindowWillCloseNotification.

-orderOut: just hides the window (removes it from the window list). You
can always order it back in again later.

--Kyle Sluder

> Whatever a “close” actually does, it’s making the
> storyboard mechanism unable to find the panel instance, so it creates a
> new one. (Your panel is *not* set to release on close, and I was able to
> verify that it’s not being released regardless, so this is not anything
> you appear to be doing wrong.)
> 
> ___
> 
> 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/kyle%40ksluder.com
> 
> This email sent to k...@ksluder.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: Re: Passing param by reference then using within block throws exception

2016-09-22 Thread Kyle Sluder
On Wed, Sep 21, 2016, at 09:22 AM, Steve Mills wrote:
> On Sep 21, 2016, at 08:53 AM, Alex Zavatone  wrote:
> 
> Stab in the dark here, but I'm stabbing blank. Is there an Instruments
> tool or debugging option to detect this? 
> 
> Thanks for getting stabby. Fourvel appreciates it (only relevant if
> you're a CBB fan). It doesn't appear that anything will detect this. When
> zombies is on, it says an address is attempting to be retained but was
> previously released. That's a bit of a red herring, since the only 2
> variables being uses have just been declared and initialized right before
> the call to the method. If anything, the process of converting to ARC or
> the static analyzer should've flagged this as a problem.

Are you able to reproduce this in a sample app? I tried the following
but got no crash:

#include 
#import 

static void foo(NSString **fillMeIn) {
[@[@"a"] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx,
BOOL *stop) {
*fillMeIn = obj;
*stop = YES;
}];
}

int main(int argc, char **argv) {
@autoreleasepool {
NSString *out;
foo();
printf("%s", out.UTF8String);
}
return 0;
}


--Kyle
___

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: NSMenuItem’s userKeyEquivalent lost if changing title

2016-09-20 Thread Kyle Sluder
On Tue, Sep 20, 2016, at 02:56 AM, Allan Odgaard wrote:
> Minor improvement on the code below, when title is equal to plainTitle 
> we can set attributedTitle to nil.
> 
> This restores proper rendering of disabled items.
> 
> Finder should be able to do the same, as when its dynamic menu items are 
> disabled, they would normally not contain the dynamic part (info about 
> selected items).

Sounds like a great UI bug report to file, Allan. :)

--Kyle Sluder

> 
> 
> On 20 Sep 2016, at 9:37, Allan Odgaard wrote:
> 
> > Thanks, I’ll switch to using this category method for setting 
> > dynamic titles:
> >
> > - (void)setDynamicTitle:(NSString*)plainTitle
> > {
> > if(self.userKeyEquivalent && ![self.userKeyEquivalent 
> > isEqualToString:@""])
> > {
> > NSString* title = plainTitle;
> > plainTitle = self.title;
> >
> > NSFont* font = self.menu.font ?: [NSFont menuFontOfSize:0];
> > self.attributedTitle = [[NSAttributedString alloc] 
> > initWithString:title attributes:@{ NSFontAttributeName : font }];
> > }
> > self.title = plainTitle;
> > }
> ___
> 
> 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/kyle%40ksluder.com
> 
> This email sent to k...@ksluder.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: Strange toolbar item error

2016-09-18 Thread Kyle Sluder
On Sat, Sep 17, 2016, at 09:24 PM, Shane Stanley wrote:
> On 18 Sep 2016, at 3:12 AM, Kyle Sluder <k...@ksluder.com> wrote:
> > 
> >> For anyone seeing the same thing, the solution seems to be to change the
> >> max size of the toolbar items to the unexpected "expected" size.
> > 
> > Yes, the intent of the warning message is to get you to do that. But
> > since you’re linking against and deploying to Mavericks, I fear you’ll
> > wind up with too-big buttons on older OSes. Could you please file a bug
> > report with a sample project attached, and send me the bug number?
> 
> Will do. So if I understand you correctly, my options are:
> 
> * Change the max size as above, and have toolbar items potentially appear
> the wrong size pre-Sierra;
> 
> * Ignore the warning and have everything appear as it should in each
> version;
> 
> * Perhaps set the max size in code, based on the running OS version.

Your understanding matches mine. (I don’t work on the team that manages
NSToolbar, so I will let them have the final say in the response to your
bug report.) In the meantime, I would go with option #2.

--Kyle Sluder

> 
> FWIW, I'm also seeing it on another project, which is more complex: the
> toolbar items are all moderately subclassed, it doesn't use autolayout,
> and it's all done in code rather than a nib. I've tried a few things, but
> I can't see any way to make the warning go away. 
> 
> I think I understand the point of the message, but the adamant tone is
> going to put developers in an invidious position if users start logging
> bugs with them over it.
> 
> >> I
> >> thought I'd already tried this without success, until I realized what was
> >> happening: I had edited the values, then closed the toolbar editor in IB.
> >> I've now realised that the changes were not being saved; when I reopened
> >> the toolbar editor, the old values were still showing. Running once with
> >> the toolbar editor open seems to have made the changes 'take". (And yes,
> >> I tried cleaning at various stages.)
> > 
> > This sounds worthy of investigation. Could you please file a bug report
> > detailing the _exact_ steps that resulted in your changes being
> > forgotten? Send me that bug number too please.
> 
> It's #28348587.
> 
> >> Along the way I discovered another problem in Xcode 8: setting a button
> >> to image-only in IB still shows any title if there is one.
> > 
> > I think we have a bug report on this already.
> 
> I've already filed #28348535, which includes a simple example.
> 
> -- 
> Shane Stanley <sstan...@myriad-com.com.au>
> , 
> 
> 

___

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: Strange toolbar item error

2016-09-17 Thread Kyle Sluder


On Fri, Sep 16, 2016, at 11:11 PM, Shane Stanley wrote:
> On 15 Sep 2016, at 2:54 PM, Kyle Sluder <k...@ksluder.com> wrote:
> > 
> > On Wed, Sep 14, 2016, at 07:50 PM, Shane Stanley wrote:
> >> Under 10.12 GM, I'm seeing entries like this in Console:
> >> 
> >> NSToolbarItem () had to adjust the size of
> >>  from {38, 25} to the expected size of {40,
> >> 27}. Make sure that this toolbar item view has a valid frame/min/max
> >> size. This is an app bug, please do not file a bug against AppKit or
> >> NSToolbar! Break on _NSToolbarAdjustedBorderedControlSizeBreakpoint
> >> 
> >> I'm seeing it in a couple of apps -- one using a standard nib approach,
> >> and one generating the toolbar fully in code. 
> >> 
> >> In the nib one, the toolbar has buttons on the toolbar items, and IB
> >> won't even allow any size other than 25px deep. I've tried fiddling with
> >> the toolbar item sizes, to no avail. I added the suggested breakpoint,
> >> but I don't see it break. If the message weren't so adamant, I'd be
> >> inclined to question it.
> >> 
> >> Anyone else seen it, or have suggestions?
> > 
> > What’s your app’s deployment target? What’s the deployment target of
> > your nib (listed in the file inspector while the nib is open for
> > editing)?
> 
> I checked under the latest(?) GM, and it's still showing "Deployment
> Target(10.9)".
> 
> For anyone seeing the same thing, the solution seems to be to change the
> max size of the toolbar items to the unexpected "expected" size.

Yes, the intent of the warning message is to get you to do that. But
since you’re linking against and deploying to Mavericks, I fear you’ll
wind up with too-big buttons on older OSes. Could you please file a bug
report with a sample project attached, and send me the bug number?

> I
> thought I'd already tried this without success, until I realized what was
> happening: I had edited the values, then closed the toolbar editor in IB.
> I've now realised that the changes were not being saved; when I reopened
> the toolbar editor, the old values were still showing. Running once with
> the toolbar editor open seems to have made the changes 'take". (And yes,
> I tried cleaning at various stages.)

This sounds worthy of investigation. Could you please file a bug report
detailing the _exact_ steps that resulted in your changes being
forgotten? Send me that bug number too please.

> 
> Along the way I discovered another problem in Xcode 8: setting a button
> to image-only in IB still shows any title if there is one.

I think we have a bug report on this already. In the meantime, if you
clear out the Title property, please make sure to populate the relevant
Accessibility properties.

--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: Strange toolbar item error

2016-09-14 Thread Kyle Sluder
On Wed, Sep 14, 2016, at 07:50 PM, Shane Stanley wrote:
> Under 10.12 GM, I'm seeing entries like this in Console:
> 
> NSToolbarItem () had to adjust the size of
>  from {38, 25} to the expected size of {40,
> 27}. Make sure that this toolbar item view has a valid frame/min/max
> size. This is an app bug, please do not file a bug against AppKit or
> NSToolbar! Break on _NSToolbarAdjustedBorderedControlSizeBreakpoint
> 
> I'm seeing it in a couple of apps -- one using a standard nib approach,
> and one generating the toolbar fully in code. 
> 
> In the nib one, the toolbar has buttons on the toolbar items, and IB
> won't even allow any size other than 25px deep. I've tried fiddling with
> the toolbar item sizes, to no avail. I added the suggested breakpoint,
> but I don't see it break. If the message weren't so adamant, I'd be
> inclined to question it.
> 
> Anyone else seen it, or have suggestions?

What’s your app’s deployment target? What’s the deployment target of
your nib (listed in the file inspector while the nib is open for
editing)?

--Kyle

___

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 set up my NSViews?

2016-09-06 Thread Kyle Sluder
On Tue, Sep 6, 2016, at 01:38 PM, Andreas Falkenhahn wrote:
> On 06.09.2016 at 18:51 Ken Thomases wrote:
> 
> > On Sep 6, 2016, at 11:41 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> > wrote:
> 
> >> My NSWindow contains an NSView which I use to draw custom graphics to. It 
> >> doesn't
> >> contain any widgets like buttons at all, just custom graphics drawn in 
> >> drawRect().
> 
> >> Now I'd like to have an AVPlayerView NSView on top of this view. Thus, I 
> >> tried to
> >> add this AVPlayerView on top of the NSView by doing the following:
> 
> >>[view addSubview:playerview];
> 
> >> However, this didn't work and generated lots of debug output to stderr.
> 
> > What, specifically, does "this didn't work" mean?  What debug output was 
> > logged?
> 
> Well, this list has a limit of 25kb per mail, so here is just the first
> 20% of what
> was logged:
> 
> (
> " '|':MyAVPlayerView:0x1004f5b70 )>",
> 
> [:snip:]
> 
> 
> Let me know if you need more :)
> 

It looks like the constraints that AVPlayerView uses to manage its own
internal layout are in conflict with its frame. Did you give the
AVPlayerView a non-zero frame before inserting it as a subview? If
you’re trying to position it using Auto Layout, did you remember to turn
.translatesAutoresizingMaskIntoConstraints off?

--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: Mysterious crash with NSTableView

2016-08-29 Thread Kyle Sluder
> On Aug 29, 2016, at 6:39 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:

> 
>> On 29.08.2016 at 02:10 Kyle Sluder wrote:
>> 
>> Delegates are different because they are often messaged in response to
>> various exogenous events. Some of these events might happen transiently
>> during window teardown, which is usually a time of massive fluctuation
>> in an app’s object graph. This is why -windowDidClose: is a good time to
>> nil out delegate properties that point back and the window controller
>> which ultimately owns the control.
> 
> So does this mean that this is potentially dangerous?
> 
>[NSApp runModalForWindow:win];
>[tableView setDelegate:nil];
>[tableView setDataSource:nil];
>[win release];
> 
> Should I move the "set to nil" calls to -windowDidClose instead?

Since you hold a strong reference to the window until after you clear out the 
delegate/dataSource backpointers, you know that the window cannot be 
reallocated until at least that point (but could be delayed to any arbitrary 
point in the future). So this approach is safe from window teardown causing the 
table view to message a zombie delegate.

--Kyle Sluder

> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.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: Mysterious crash with NSTableView

2016-08-28 Thread Kyle Sluder
On Sat, Aug 27, 2016, at 03:55 PM, Andreas Falkenhahn wrote:
> On 27.08.2016 at 18:10 Alex Zavatone wrote:
> 
> > Buuut, to the mind of the person learning this or trying to fit all
> > the complexity of learning this in their head, it might be wise in
> > the docs to remind the programmer that they need to do this and why
> > with a, "just in case you are assuming that your code is ready to
> > function now, please remember that the objects that end up making a
> > working tableView require that the tableView's  dataSource object
> > and delegate object need to be assigned, generally to the hosting
> > view controller's instance of self. If this causes you to raise an
> > eyebrow in confusion, the reasons why you must do this are xxx and
> > .  Likewise upon deallocation of the tableView (if it gets
> > called), these objects will need to be set to nil after  but
> > before the tableView object is able to dispose of itself."
> 
> Huh? "Remember that you have to set this property to nil before you
> release the object" would already be sufficient...
> 
> By the way, I still don't know whether setting the delegate to nil
> before release is a general rule or does it only apply to NSTableView?
> Should I also set my button delegates to nil before the buttons are
> released?

Buttons don’t have delegates; they have targets.

Generally applications work fine without nilling out the targets of
their controls. This only works because controls almost exclusively
message their targets synchronously on the main in response to user
actions. There’s no opportunity for one of the target’s dependencies to
be deallocated in between the user triggering the target-action message
and the target receiving the action message.

Delegates are different because they are often messaged in response to
various exogenous events. Some of these events might happen transiently
during window teardown, which is usually a time of massive fluctuation
in an app’s object graph. This is why -windowDidClose: is a good time to
nil out delegate properties that point back and the window controller
which ultimately owns the control.

That said, it is totally possible for a control to delay-perform sending
an event, and even if it takes pains to make sure it doesn’t message the
_target_ if it’s been deallocated, one of the target’s _dependencies_
might have been deallocated. These cases are usually found after much
swearing and trial-by-fire. Such is the difference between theory and
practice.

--Kyle Sluder

> 
> -- 
> Best regards,
>  Andreas Falkenhahn   
>  mailto:andr...@falkenhahn.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: Mysterious crash with NSTableView

2016-08-26 Thread Kyle Sluder
On Fri, Aug 26, 2016, at 12:25 PM, Gary L. Wade wrote:
> I'm talking about exchanging release for autorelease on your list
> delegate, which happens after runModal finishes. Since you now do an
> orderOut, your table view should not need its data source/delegate, so it
> should be safe keeping them set and using an autorelease, but clearing
> them is the safest.

Neither autorelease nor release on its own is sufficient here; Andreas
should clear out his delegates. This is true either in ARC or non-ARC,
whether the delegate property is declared `unsafe_unretained` (née
`assign`) or `weak`.

You don’t know when an object will be deallocated. While it would be
unexpected (and arguably an error) for NSTableView to hand off its
delegate to something that will take a long-lived strong +1 reference to
it, it is perfectly legal for the delegate to wind up in the autorelease
pool for an indefinite period of time. Delegates are most likely not
written to handle being called in that limbo state where they’re still
alive and assigned to the delegate property, but the object that created
them has disavowed them by releasing its last strong reference to them.

`weak` prevents retain cycles. It does not ensure program correctness.

> 
> This kind of exercise in understanding the MRC rules is precisely why ARC
> was created. If you need to use MRC, you probably should do what lots of
> others did and draw lots of pictures in timeframes with tally counts on
> objects to understand what happens when. If you go with ARC, this
> clearing should happen for you—I'm pretty sure the data source and
> delegate are weak, but I don't have the headers in front of me right now.

Automatic clearing of zeroing weak references is dependent on the
*implementor* being compiled with ARC. Non-ARC clients will still see
another object’s zeroing weak ref go to nil when the last strong ref to
the referent is released.

Here’s some sample code:

/* WeakRefHolder.h
 * This file is transcluded twice: once with ARC enabled, once with ARC
 disabled.
 */
#import 

@interface WeakRefHolder : NSObject

@property(weak) id weakRef;

@end
/* WeakRefHolder.m
 * clang -c -o WeakRefHolder.o -fobjc-arc WeakRefHolder.m
 */

#if !__has_feature(objc_arc)
#error WeakRefHolder implementation must be compiled with ARC
#endif

#import "WeakRefHolder.h"

@implementation WeakRefHolder
// Automatically synthesize implementation of .weakRef property
@end

/* main.m
 * Compile: clang -o main -framework Foundation -fno-objc-arc main.m
 WeakRefHolder.o
 */

#if __has_feature(objc_arc)
#error Main file should not be compiled with ARC
#endif

#import "WeakRefHolder.h"
#import 

@interface SquealOnDealloc : NSObject
@end

@implementation SquealOnDealloc
- (void)dealloc {
printf("<%p> deallocating!\n", self);
[super dealloc];
}
@end

int main(int argc, char **argv)
{
WeakRefHolder *holder = [[WeakRefHolder alloc] init];
id referent;
@autoreleasepool {
printf(">> Pushing autorelease pool\n");
referent = [[SquealOnDealloc alloc] init];
printf("Assigning <%p> to .weakRef property\n",
referent);
holder.weakRef = [referent autorelease];
printf("<< Popping autorelease pool\n");
}

printf(".weakRef = %p\n", holder.weakRef);
return 0;
}

--Kyle Sluder

> --
> Gary L. Wade (Sent from my iPhone)
> http://www.garywade.com/
> 
> > On Aug 26, 2016, at 9:38 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> > wrote:
> > 
> >> On 26.08.2016 at 17:52 Gary L. Wade wrote:
> >> 
> >> You would not see this if you hid or removed the table view first
> >> since it would not need its data source or delegate then. Try going
> >> with ARC or at least use autorelease on your delegate/data source.
> > 
> > I'm not using autorelease on the delegate/data source on purpose because
> > AFAIU autoreleased objects are (potentially) killed whenever the application
> > is in an event loop and this is the case with runModalForWindow(). AFAIU
> > if I used autorelease on the delegate/data source then both would be
> > killed in the run loop started by runModalForWindow() because both 
> > setDelegate()
> > and setDatasource() don't retain. So using autorelease doesn't make sense
> > to me here. Is this right or did I get anything wrong here?
> > 
> > -- 
> > Best regards,
> > Andreas Falkenhahnmailto:andr...@falkenhahn.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: runModalForWindow() doesn't re-activate former window upon return

2016-08-25 Thread Kyle Sluder


On Thu, Aug 25, 2016, at 01:51 PM, Andreas Falkenhahn wrote:
> On 25.08.2016 at 19:47 Keary Suska wrote:
> 
> >> On Aug 25, 2016, at 9:45 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> >> wrote:
> 
> >> Tested it, the window is clearly main and key, this is the debug output:
> 
> >> CHECK: 0x10040b4d0 0x10040b4d0 0x10040b4d0
> 
> >> i.e. [NSApp mainWindow], [NSApp keyWindow] and my NSWindow pointer are
> >> exactly the same before runModalForWindow() is called.
> 
> > What are they *after* the modal loop has ended?
> 
> They are both set to a window pointer that doesn't belong to my
> application.

-mainWindow and -keyWindow don’t return pointers to windows outside of
your application. (How could they? Other applications have their own
address spaces.) They either return pointers to windows in your app
(which might be windows owned by the framework), or they return nil.

--Kyle Sluder

> I've logged both pointers directly after runModalForWindow() returns.
> 
> > What happens if you add -orderOut: to the button action method?
> 
> Ok, this solves the problem. But still, shouldn't this be handled
> automatically
> by runModalForWindow()? Why does it activate a window that doesn't belong
> to
> my application when it returns? That doesn't look reasonable to me at
> all...
> 
> -- 
> Best regards,
>  Andreas Falkenhahn   
>  mailto:andr...@falkenhahn.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: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Kyle Sluder


On Fri, Aug 19, 2016, at 06:08 PM, Charles Srstka wrote:
> > On Aug 19, 2016, at 3:46 PM, Quincey Morris 
> > <quinceymor...@rivergatesoftware.com> wrote:
> > 
> > On Aug 19, 2016, at 10:53 , Charles Srstka <cocoa...@charlessoft.com 
> > <mailto:cocoa...@charlessoft.com>> wrote:
> >> 
> >> [NSArray array] is a synonym for [[[NSArray alloc] init] autorelease].
> > 
> > (along with other similar comments in other responses)
> > 
> > To be pedantic, it’s *implemented* as [[[NSArray alloc] init] autorelease], 
> > but the lack of an API contract to that effect means that “synonym” isn’t 
> > quite accurate.
> > 
> > My point is that Apple might revisit the implementation of NSArray at any 
> > time (in these Swiftian days, stranger things have happened), and choose to 
> > write it with full ARC compatibility, which means there might not be any 
> > autorelease when invoked from ARC client code, since ARC can optimize the 
> > code when it handles both ends of the invocation.
> 
> Swift typically just calls the initializer if it’s there, so the
> convenience initializers like +[NSArray array] are really only relevant
> to Objective-C code. For that reason, I doubt they’d change unless Apple
> did something crazy like rewrite the entire frameworks in Swift, in which
> case they’d probably go away.

There is an official reimplementation of Foundation/CoreFoundation in
Swift. The implementation of NSObject lacks a `static func new`:
<https://github.com/apple/swift-corelibs-foundation/blob/master/Foundation/NSObject.swift>
Likewise, Swift explicitly does not bridge `+new` from ObjC, so this is
a moot point in Swift code.

> So for the foreseeable future, the
> difference is that +array returns an autoreleased object, meaning that in
> ARC code, +new is the better choice.

I would not make that assumption. Who says +[NSArray array] constructs
anything at all? Try comparing the return values of two calls to
[NSArray array] sometime. ;-)

I happen think +new is more readable, but it’s really just a matter of
preference.

--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: NSImage drawInRect deadlock

2016-08-09 Thread Kyle Sluder
On Tue, Aug 9, 2016, at 07:38 AM, Andrew Keller wrote:
> Am 08.08.2016 um 8:12 nachm. schrieb Kyle Sluder <k...@ksluder.com>:
> > 
> > On Mon, Aug 8, 2016, at 05:11 PM, Jens Alfke wrote:
> >> 
> >>> On Aug 8, 2016, at 2:54 PM, Aaron Tuller <mandelb...@mac.com> wrote:
> >>> 
> >>> "The following classes and functions are generally not thread-safe. In 
> >>> most cases, you can use these classes from any thread as long as you use 
> >>> them from only one thread at a time."
> >> 
> >> The images are only being used on one thread at a time. The problem seems
> >> to be that the NSImage _cache_ is shared and (apparently) not
> >> thread-safe.
> > 
> > I wouldn’t jump immediately to thread-unsafety. It’s possible that
> > Andrew is simply exhausting the thread pool.
> > 
> > Andrew, are you doing anything to limit the amount of decode operations
> > you’re putting on the global queue?
> 
> Not presently.  Under normal usage, it hovers around 10-40 threads, but
> I’ve seen it as high as 200.  Honestly, I was hoping to limit it to 3 or
> 6 — just experimentally, one thread by itself can saturate roughly 20-30%
> of my i7 processor.  If 3-6 simultaneous operations will saturate the
> whole processor, I don’t see much value in letting it go much higher than
> that.
> 
> What is the preferred way to limit the number of parallel operations in
> the global queue?  I was under the impression from the docs that macOS
> handles the thread pool “automatically”.

Mike Ash did a good job explaining why this isn’t as “automatic” as one
might think:
https://www.mikeash.com/pyblog/friday-qa-2009-09-25-gcd-practicum.html

--Kyle Sluder

> 
> Thanks,
>  - Andrew
> 

___

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: NSImage drawInRect deadlock

2016-08-08 Thread Kyle Sluder
On Mon, Aug 8, 2016, at 05:11 PM, Jens Alfke wrote:
> 
> > On Aug 8, 2016, at 2:54 PM, Aaron Tuller  wrote:
> > 
> > "The following classes and functions are generally not thread-safe. In most 
> > cases, you can use these classes from any thread as long as you use them 
> > from only one thread at a time."
> 
> The images are only being used on one thread at a time. The problem seems
> to be that the NSImage _cache_ is shared and (apparently) not
> thread-safe.

I wouldn’t jump immediately to thread-unsafety. It’s possible that
Andrew is simply exhausting the thread pool.

Andrew, are you doing anything to limit the amount of decode operations
you’re putting on the global queue?

--Kyle

> 
> —Jens

___

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: awakeFromFetch behaviour change in 10.12?

2016-07-25 Thread Kyle Sluder
On Mon, Jul 25, 2016, at 09:14 AM, Sean McBride wrote:
> Hi all,
> 
> I'm observing that in 10.12 my awakeFromFetch methods are being called
> more than in 10.11 and earlier.  Specifically, it's called more than once
> for an object that's already been fetched previously.
> 
> Perhaps I have misunderstood the method's semantics all these years, but
> I expected that awakeFromFetch would only be called once, when an object
> is first awaken from the persistent store.
> 
> Now I'm seeing that if I execute a fetch request where
> returnsObjectsAsFaults=YES awakeFromFetch will be invoked on all the
> resulting objects, even if it'd been invoked before.
> 
> Does that seem correct to you?

This does not sound like expected behavior. Could you please file a bug
report at https://bugreport.apple.com and attach a sample project if at
all possible?

Thanks,
--Kyle Sluder

> 
> Thanks,
> 
> -- 
> 
> Sean McBride, B. Eng s...@rogue-research.com
> Rogue Researchwww.rogue-research.com 
> Mac Software Developer  Montréal, Québec, Canada
> 
> 
> 
> ___
> 
> 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/kyle%40ksluder.com
> 
> This email sent to k...@ksluder.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: Why can't Swift instance methods call class methods without qualification?

2016-06-30 Thread Kyle Sluder
On Thu, Jun 30, 2016, at 07:20 PM, Rick Mann wrote:
> Why can my instance methods not call class methods without the class
> specifier?
> 
> class MyClass
> {
> func
> foo()
> {
> classMethod()
> }
> 
> class
> func
> classMethod()
> {
> }
> }
> 
> Why do I have to call MyClass.classMethod()? Just a choice made by the
> language designers to distinguish the call at the call site? I like C++'s
> way of treating all static methods as directly available to the instance.

The official swift-users list might be a better place to ask this
question:

https://lists.swift.org/mailman/listinfo/swift-users

--Kyle Sluder

> 
> -- 
> 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: NSService (aka. Bonjour) outside local network

2016-06-24 Thread Kyle Sluder
On Fri, Jun 24, 2016, at 02:11 AM, Gerriet M. Denkmann wrote:
> Is it possible to create an NSService (OS X 10.11.45) which is
> discoverable (via NSServiceBrowser) outside of the local WiFi network?

Only if your machine is configured for Wide-area Bonjour. Regular
Bonjour is restricted to the local subnet.

> What should be used for domain in this case?

Whatever WAB domain(s) are configured on the machine.

The macnetworkprog list might be a better resource.

--Kyle Sluder

> If not: what is the use of domain ≠ “local.” , e.g. domain = “” ?
> 
> Also: I noticed that includesPeerToPeer = YES makes the kernel_task,
> which usually takes about 1% of my Cpu, go up to 11%. Back to 1% one
> minute after the app with NSService quits.
> 
> Is this normal and to be expected?
> 
> Gerriet.

___

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: quicklook audio sample rates

2016-06-10 Thread Kyle Sluder
On Thu, Jun 9, 2016, at 08:03 PM, George Toledo wrote:
> I'm having a hard time finding documentation that covers this question...
> 
> Does Quicklook play audio of a previewed file at the sample rate it was
> encoded at, or is it somehow doing a samplerate conversion on the fly?
> 
> Hopefully this isn't considered off topic. Though it doesn't directly
> concern Obj-C/Cocoa code, I was looking for an answer in the Quicklook
> Programming guide, and couldn't find one.

This is a highly specific question and is unlikely to be documented. I’m
curious why you’re interested.

At the end of the day, the audio hardware operates at some particular
bitrate, so unless your source exactly matches the hardware sample rate
there’s likely to be a SRC in the audio pipleline *somewhere*.

--Kyle Sluder

> 
> Thanks,
> George Toledo
> ___
> 
> 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/kyle%40ksluder.com
> 
> This email sent to k...@ksluder.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: Open-file progress dialog with cancel button

2016-06-10 Thread Kyle Sluder
On Fri, Jun 10, 2016, at 11:03 AM, Daryle Walker wrote:
> I don't need this (yet), but it popped up in my head. Usually,
> readFromData: ofType: processes the data in place.  But what if the
> process take a while, or you otherwise want to provide a progress window
> (maybe with a cancel button)? I guess you could handle the parsing in an
> NSOperation, but how do you establish the window and make sure
> readFromData for that instance doesn't deadlock the rest of the program?

Check out +[NSDocument canConcurrentlyReadDocumentsOfType:].

--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: Doc icon shows up in QuickLook but not Finder

2016-06-07 Thread Kyle Sluder
On Tue, Jun 7, 2016, at 04:26 PM, Rick Mann wrote:
> Some have reported this before, but none of the solutions (namely,
> rebuilding the launch services DB) seem to work.
> 
> I have a document package with extension .mpproj. I get a generic
> document icon in the Finder, but if I quicklook the document, it shows
> the right icon.
> 
> Any suggestions? The app icon took immediately. I tried relaunching the
> Finder. I have not tried restarting.

Does your corresponding UTI declaration correctly conform to
`com.apple.package` and NOT to `public.data`?

--Kyle Sluder

> 
> -- 
> 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: NSFileWrapper

2016-06-05 Thread Kyle Sluder
On Sun, Jun 5, 2016, at 01:14 AM, Chris Ridd wrote:
> 
> > On 4 Jun 2016, at 23:02, Daryle Walker <dary...@mac.com> wrote:
> > 
> >> On Jun 4, 2016, at 12:18 PM, Peter Hudson <peter.hud...@me.com> wrote:
> >> 
> >> Hi Mike
> >> 
> >> You're right - I want the behaviour of a package. Do you happen to know 
> >> how I can achieve it?   I had presumed it might be some mix of flag 
> >> setting at system level. If for example i set the extension on an 
> >> NSFileWrapper to   .bundle i get some of what I need - but I cant find out 
> >> how to ‎get an icon of my choosing associated with it.
> > 
> > You’ll have to work at it; it won’t be completely transparent to your users 
> > to experience nor you to program.
> > 
> > The “.bundle” extension is already in use for system plug-ins.  You have to 
> > come up with a new extension.  For instance, if you’re already using “.xyz” 
> > for you single-file format, you could use “.xyz-pkg” for your package 
> > format.
> 
> Are you sure that’s true? Apps like OmniGraffle have a flat file format
> *and* a bundle format, both using the .graffle extension. In OmniGraffle
> Pro's document inspector you can switch between formats.

At one point OmniGraffle dropped the flat file/package inspector
precisely because using the same extension for both confused Launch
Services. But there was so much wrong with OmniGraffle’s UTI
declarations at the time; fixing them might have resolved the issue and
led to the return of the format switch.

If you’re going to try to share the same filename extension for packages
and flat files, it is doubly important that you have *two* UTIs, and
that teach UTI declare conformance to exactly *one or the other* of the
“physical” hierarchies. That means your document package UTI *must not*
conform to your flat-file UTI, because then it would conform to both the
package and flat-file physical hierarchies, and LS will get confused
about which UTI should be used for flat files.

--Kyle Sluder

> 
> If you have the app or a demo you can investigate its Info.plist.
> 
> Chris

___

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: Scrolling table view when the keyboard appears

2016-05-24 Thread Kyle Sluder
On Tue, May 24, 2016, at 05:46 PM, Kyle Sluder wrote:
> On Tue, May 24, 2016, at 05:37 PM, Alex Zavatone wrote:
> > 
> > On May 24, 2016, at 4:02 PM, Kyle Sluder wrote:
> > 
> > > On Tue, May 24, 2016, at 12:33 PM, Doug Hill wrote:
> > >> OK, this might have been more obvious to people, but it finally came to
> > >> me how to handle the keyboard display.
> > >> 
> > >> Instead of changing the view size, I move the center of the view up, then
> > >> apply a content inset to the table to adjust for the part of the table
> > >> offscreen. Animations seem to work much better now.
> > > 
> > > Did you really mean “move the center of the view”? Or did you mean
> > > scrolling the center of the viewport?
> > > 
> > > Either way, contentInset is definitely the way to handle this.
> > 
> > Just checking.  You meant to use contentInset and not contentOffset? 
> 
> Yes, I meant contentInset. contentOffset is just another name for
> self.bounds.origin.

To clarify: you might want to change both the contentInset (to avoid the
keyboard) *and* the contentOffset (to move content that has been
obscured by the keyboard back into the visible part of the scrollview.)

--Kyle Sluder

> 
> --Kyle Sluder
> 
> > 
> > I'm going to need to handle this exact issue soon too.
> > 
> > Thanks, Kyle.
> > 
> > Alex Zavatone
> > 
> > > --Kyle Sluder
> > > 
> > >> 
> > >> Doug Hill
> > >> 
> > >>> On May 20, 2016, at 5:21 PM, Doug Hill <cocoa...@breaqz.com> wrote:
> > >>> 
> > >>> I’m implementing a chat message view with a table view and a text field 
> > >>> underneath it. I want the most recent messages at the bottom, and the 
> > >>> scroll position always to stay at the last row in the table.
> > >>> 
> > >>> There are some tricks to making sure the table scrolls to the bottom 
> > >>> when it’s first drawn and when adding new rows. I seem to be able to 
> > >>> make this work but I’m running into a problem keeping the table 
> > >>> scrolled to the bottom when the keyboard is shown. I listen for the 
> > >>> 'keyboard shown’ notification and adjust the height of my entire view 
> > >>> by the height of keyboard. This works but the scroll position ends up 
> > >>> wrong, as it doesn’t keep the same scroll position at the last row when 
> > >>> the view is moved up. OK, so I set the contentOffset to compensate for 
> > >>> this.
> > >>> 
> > >>> Here is the code I use in the Keyboard Will show notification:
> > >>> 
> > >>> [UIView animateWithDuration:keyboardAnimDuration
> > >>> animations:
> > >>> ^{
> > >>>   self.view.frame = newViewFrame;
> > >>> }
> > >>> completion:^(BOOL finished)
> > >>> {
> > >>>   [self.myTableView setContentOffset:newContentOffset animated:NO];
> > >>> }];
> > >>> 
> > >>> So far, things work pretty well and things end up in the right place 
> > >>> with. However, the animation is weird.
> > >>> 
> > >>> • Even though the view frame is changed inside the animation block, it 
> > >>> moves into place immediately with no animation. No matter what duration 
> > >>> I set it seems to be ignored.
> > >>> • Then the keyboard scrolls into place. Because my view has already 
> > >>> been moved up, you see a blank space where the keyboard moves up and 
> > >>> over. This looks pretty bad.
> > >>> • The table scrolls with an animation even though contentOffset is 
> > >>> changed in the completion block and I set the animated param to NO.
> > >>> • The time for the table scroll to animate is fixed.
> > >>> 
> > >>> Here is an example of this animation:
> > >>> 
> > >>> https://youtu.be/SBSts2UOJXw
> > >>> 
> > >>> (Try on slow speed to see it better)
> > >>> 
> > >>> I know this can be done correctly because I see other iOS chat apps 
> > >>> that make the list view move up with the keyboard in a coordinated, 
> > >>> smooth animation. Any ideas?
> > >>> 
> > >>> Doug

___

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: Scrolling table view when the keyboard appears

2016-05-24 Thread Kyle Sluder
On Tue, May 24, 2016, at 05:37 PM, Alex Zavatone wrote:
> 
> On May 24, 2016, at 4:02 PM, Kyle Sluder wrote:
> 
> > On Tue, May 24, 2016, at 12:33 PM, Doug Hill wrote:
> >> OK, this might have been more obvious to people, but it finally came to
> >> me how to handle the keyboard display.
> >> 
> >> Instead of changing the view size, I move the center of the view up, then
> >> apply a content inset to the table to adjust for the part of the table
> >> offscreen. Animations seem to work much better now.
> > 
> > Did you really mean “move the center of the view”? Or did you mean
> > scrolling the center of the viewport?
> > 
> > Either way, contentInset is definitely the way to handle this.
> 
> Just checking.  You meant to use contentInset and not contentOffset? 

Yes, I meant contentInset. contentOffset is just another name for
self.bounds.origin.

--Kyle Sluder

> 
> I'm going to need to handle this exact issue soon too.
> 
> Thanks, Kyle.
> 
> Alex Zavatone
> 
> > --Kyle Sluder
> > 
> >> 
> >> Doug Hill
> >> 
> >>> On May 20, 2016, at 5:21 PM, Doug Hill <cocoa...@breaqz.com> wrote:
> >>> 
> >>> I’m implementing a chat message view with a table view and a text field 
> >>> underneath it. I want the most recent messages at the bottom, and the 
> >>> scroll position always to stay at the last row in the table.
> >>> 
> >>> There are some tricks to making sure the table scrolls to the bottom when 
> >>> it’s first drawn and when adding new rows. I seem to be able to make this 
> >>> work but I’m running into a problem keeping the table scrolled to the 
> >>> bottom when the keyboard is shown. I listen for the 'keyboard shown’ 
> >>> notification and adjust the height of my entire view by the height of 
> >>> keyboard. This works but the scroll position ends up wrong, as it doesn’t 
> >>> keep the same scroll position at the last row when the view is moved up. 
> >>> OK, so I set the contentOffset to compensate for this.
> >>> 
> >>> Here is the code I use in the Keyboard Will show notification:
> >>> 
> >>> [UIView animateWithDuration:keyboardAnimDuration
> >>> animations:
> >>> ^{
> >>>   self.view.frame = newViewFrame;
> >>> }
> >>> completion:^(BOOL finished)
> >>> {
> >>>   [self.myTableView setContentOffset:newContentOffset animated:NO];
> >>> }];
> >>> 
> >>> So far, things work pretty well and things end up in the right place 
> >>> with. However, the animation is weird.
> >>> 
> >>> • Even though the view frame is changed inside the animation block, it 
> >>> moves into place immediately with no animation. No matter what duration I 
> >>> set it seems to be ignored.
> >>> • Then the keyboard scrolls into place. Because my view has already been 
> >>> moved up, you see a blank space where the keyboard moves up and over. 
> >>> This looks pretty bad.
> >>> • The table scrolls with an animation even though contentOffset is 
> >>> changed in the completion block and I set the animated param to NO.
> >>> • The time for the table scroll to animate is fixed.
> >>> 
> >>> Here is an example of this animation:
> >>> 
> >>> https://youtu.be/SBSts2UOJXw
> >>> 
> >>> (Try on slow speed to see it better)
> >>> 
> >>> I know this can be done correctly because I see other iOS chat apps that 
> >>> make the list view move up with the keyboard in a coordinated, smooth 
> >>> animation. Any ideas?
> >>> 
> >>> Doug

___

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: Scrolling table view when the keyboard appears

2016-05-24 Thread Kyle Sluder
On Tue, May 24, 2016, at 12:33 PM, Doug Hill wrote:
> OK, this might have been more obvious to people, but it finally came to
> me how to handle the keyboard display.
> 
> Instead of changing the view size, I move the center of the view up, then
> apply a content inset to the table to adjust for the part of the table
> offscreen. Animations seem to work much better now.

Did you really mean “move the center of the view”? Or did you mean
scrolling the center of the viewport?

Either way, contentInset is definitely the way to handle this.

--Kyle Sluder

> 
> Doug Hill
> 
> > On May 20, 2016, at 5:21 PM, Doug Hill <cocoa...@breaqz.com> wrote:
> > 
> > I’m implementing a chat message view with a table view and a text field 
> > underneath it. I want the most recent messages at the bottom, and the 
> > scroll position always to stay at the last row in the table.
> > 
> > There are some tricks to making sure the table scrolls to the bottom when 
> > it’s first drawn and when adding new rows. I seem to be able to make this 
> > work but I’m running into a problem keeping the table scrolled to the 
> > bottom when the keyboard is shown. I listen for the 'keyboard shown’ 
> > notification and adjust the height of my entire view by the height of 
> > keyboard. This works but the scroll position ends up wrong, as it doesn’t 
> > keep the same scroll position at the last row when the view is moved up. 
> > OK, so I set the contentOffset to compensate for this.
> > 
> > Here is the code I use in the Keyboard Will show notification:
> > 
> > [UIView animateWithDuration:keyboardAnimDuration
> > animations:
> > ^{
> >self.view.frame = newViewFrame;
> > }
> > completion:^(BOOL finished)
> > {
> >[self.myTableView setContentOffset:newContentOffset animated:NO];
> > }];
> > 
> > So far, things work pretty well and things end up in the right place with. 
> > However, the animation is weird.
> > 
> > • Even though the view frame is changed inside the animation block, it 
> > moves into place immediately with no animation. No matter what duration I 
> > set it seems to be ignored.
> > • Then the keyboard scrolls into place. Because my view has already been 
> > moved up, you see a blank space where the keyboard moves up and over. This 
> > looks pretty bad.
> > • The table scrolls with an animation even though contentOffset is changed 
> > in the completion block and I set the animated param to NO.
> > • The time for the table scroll to animate is fixed.
> > 
> > Here is an example of this animation:
> > 
> > https://youtu.be/SBSts2UOJXw
> > 
> > (Try on slow speed to see it better)
> > 
> > I know this can be done correctly because I see other iOS chat apps that 
> > make the list view move up with the keyboard in a coordinated, smooth 
> > animation. Any ideas?
> > 
> > Doug
> > 
> > ___
> > 
> > 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/cocoadev%40breaqz.com
> > 
> > This email sent to cocoa...@breaqz.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/kyle%40ksluder.com
> 
> This email sent to k...@ksluder.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: Application Activation Problem

2016-05-13 Thread Kyle Sluder
On Fri, May 13, 2016, at 10:21 AM, Dave wrote:
> Hi,
> 
> > You might consider subscribing to
> > NSWorkspaceDidActivateApplicationNotification and cycling to the next
> > app in the list upon receipt, but the best you can do is best-effort.
> > 
> > --Kyle
> > 
> 
> That’s actually what I am doing. I monitor
> NSWorkspaceApplicationWllLaunchNotification,
> NSWorkspaceApplicatioDidLaunchNotification  and
> NSWorkspaceDidActivateApplicationNotification (as well as others). For
> each notification I get I add the BundleID of the App to an Array. Then
> at some later point, I want to cycle through the Activates and re-send
> them in the same order they were activated originally.
> 
> I realise that this is not 100% perfect (because of outside influences,
> (other apps etc)), but I’d like to get it as close as possible as long as
> no other Apps are getting in the way.
> 
> I suppose I could set a flag somewhere and then check it in the Activate
> notification handler.

Yeah, that’s what I’m suggesting. Your Activate handler will basically
operate in two modes: “passive” (where it adds apps to the array) and
“active” (where it dequeues an app from the array and asks NSWorkspace
to activate it).

--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: unwind segue on navigation pop

2016-05-13 Thread Kyle Sluder
On Thu, May 12, 2016, at 09:48 PM, Roland King wrote:
> I’m making more use of unwind segues to try and get to the point I have
> ‘go forward’ and ‘go backward’ code in one place in the same class. So
> during prepareForSegue I set some stuff up, during my unwind segue method
> I tear it down again. Don’t use it for everything, but for some complex
> presentations it’s been quite useful. 
> 
> I’ve just changed a piece of navigation to use a standard nav controller,
> it used to be a modal presentation but a push makes more sense. So now
> there’s no custom dismiss button like there used to be, you go back with
> the normal back button on the nav controller. I can’t find a good way to
> get that back action to trigger my unwind segue. Can’t seem to do it in
> IB, I don’t want a custom back button because you lose the chevron (or
> have to fake it) and all the normal uinav behaviour. 

The Back button is not customizable in this fashion. Please file an
enhancement request at https://bugreport.apple.com.

--Kyle Sluder

> 
> Best I’ve found so far is to give the segue a custom identifier (ie make
> it a viewcontroller segue) and performSegue it from ‘viewWillDisappear’,
> however that has a pretty bad smell about it because that’s not really an
> unwind, it’s already doing the dismissal by then. Feels like something
> which is going to break one day. 
> 
> There’s other ways I can do this obviously - change it to a
> protocol/delegate method called directly from the VC as it goes away, but
> I was trying to stick with unwind segues if possible. 

___

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: objc [66375] class Foo is implemented in both BundleA and BundleB

2016-05-13 Thread Kyle Sluder
On Fri, May 13, 2016, at 03:23 AM, Jeff Szuhay wrote:
> 
> > On May 11, 2016, at 5:11 PM, Jeff Szuhay  wrote:
> >> On May 11, 2016, at 12:08 AM, Jens Alfke  wrote:
> >>> On May 10, 2016, at 11:05 PM, Jeff Szuhay  >>> > wrote:
> >>> 
> >>> Class Foo is a base class. It is subclassed in BundleA,  BundleB, … 
> >>> BundleZ.
> >> 
> >> Where is Foo itself implemented? If there are copies of the Foo class in 
> >> each bundle then yeah, you’ll get that warning.
> >> 
> >>> Is there a better way to do it? I can’t currently how to have a singleton 
> >>> base class
> >>> implementation that is shared among two or more bundles.
> >> 
> >> Put the base class (and any other shared code) in a framework that each of 
> >> your bundles links against.
> >> 
> >> —Jens
> > 
> > Foo is common to all plug-ins of the app but not needed in the app itself 
> > nor by anything else in the system.
> > 
> > That was definitely the “right way:” make a framework of the base classes 
> > and store it in the app bundle.
> > Each plug-in links against the framework.
> > 
> > But, sheesh, that was painful to figure out.
> > 
> > Thanks, Jens.
> 
> 
> What was particularly painful was how to  configure each Xcode
> sub-project to see the framework. I had to 
> fiddle around with this for an inordinate amount of time. I feel the
> framework approach and some basic steps
> should, at the very least, be included in the READ.ME file for Apple’s
> sample BundleLoader project. 
> 
> But, just to be clear, the BundeLoader project is awesome (among many
> others). Thank you, Apple.
> 
> I’m still trying to figure out the difference between private framework
> headers and project framework headers.
> 
> So far, I’ve learned that
> 1) Project headers are only available within the framework and not to any
> other “consumer” of the framework.
> Which is to say, my bundles, which “consume" the framework, cannot
> see project headers.
> 2) Private heads are available to consumers of the framework but only at
> compile/link time. They are not anywhere
> in the app bundle — which is exactly what I want. 
> One downside to this is that if I change a framework header I have to
> rebuild the framework to get the changes
> in the right place for the bundles to see the changes. Minor
> inconvenience.
> 3) Public headers become available for everyone who looks in the app
> bundle. They are moved there for all to see.
> (not what I want).
> 
> Did I learn correctly?

Not quite. Private headers get copied into the Framework bundle, but in
a PrivateHeaders subfolder instead of the regular Headers folder. This
way your clients can use your private API, and then when everything is
built you can go through and strip all PrivateHeaders folders from your
app bundle. This sounds like exactly what you want.

Note: I haven’t actually done this in the face of codesigning. Not sure
if PrivateHeaders is considered part of the framework’s seal.

--Kyle

___

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: Application Activation Problem

2016-05-13 Thread Kyle Sluder
On Fri, May 13, 2016, at 04:46 AM, Dave wrote:
> Hi All,
> 
> I’m using:
> 
> [myRunningApp activateWithOptions:(NSApplicationActivateAllWindows |
> NSApplicationActivateIgnoringOtherApps)];
> 
> To activate an Application. Is there any way to tell when the Application
> is actually active? I have the need to cycle through an Array of App
> Bundle IDs and make each Application Active, one after the other, leaving
> the last one in the list as the Active App.
> 
> If I do this in a tight loop then it seems to just activate the last on
> in the Array without activating the preceding apps. I tried adding a
> delay between each Activation call, and although this sort of works, it
> still out an App once in a while. I was thinking if there was something I
> could monitor to make sure the App has activated and is stable before
> sending the next Activate.
> 
> Any ideas or suggestions greatly appreciated.

Activation is an inherently asynchronous and failable action. After all,
what if two apps send -activateWithOptions: simultaneously?

You might consider subscribing to
NSWorkspaceDidActivateApplicationNotification and cycling to the next
app in the list upon receipt, but the best you can do is best-effort.

--Kyle

> 
> 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

Re: presentationControllerForPresentedViewController(…) is called multiple times

2016-05-11 Thread Kyle Sluder
On Tue, May 10, 2016, at 06:02 PM, Rick Mann wrote:
> Currently, my code instantiates a new UIPresentationController subclass
> each time presentationControllerForPresentedViewController(…) is called.
> Unfortunately, when I present a VC,
> presentationControllerForPresentedViewController(…) is called three
> times! This seems wasteful, at best, and possibly broken, since state is
> not tracked across calls.
> 
> I could try to keep a reference around for it, but then I'm holding on to
> a reference that won't be updated properly the next time.
> presentationControllerForPresentedViewController() passes in a couple of
> parameters required by UIPresentationController's constructor.
> 
> Is this a bug, or is this just how it is?

Regardless of whether this is expected, I agree it’s inefficient. Please
file a bug report at https://bugreport.apple.com.

--Kyle Sluder

> 
> 
> -- 
> 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: Attempting to load the view of a view controller while it is deallocating is not allowed and may result in undefined behavior

2016-05-11 Thread Kyle Sluder
On Thu, Apr 28, 2016, at 05:03 PM, Rick Mann wrote:
> I'm getting the following message in the console:
> 
>   Attempting to load the view of a view controller while it is 
> deallocating is not allowed and may result in undefined behavior 
> ()
> 
> Thing is, I get it when handling a universal link (a link tapped outside
> my app, but which is sent to my app for handling). This message is logged
> before application(_:continueUserActivity:restorationHandler:) gets
> called.
> 
> At the time, I have my app's regular UI showing, and no
> UIAlertViewControllers have been instantiated.
> 
> Any idea why I'm seeing this? Thanks!

Can you set a breakpoint on -[UIViewController loadView] with a
condition of `[(id)$x0 isKindOfClass:[UIAlertController class]]` (on
device) or `[(id)$rdi isKindOfClass:[UIAlertController class]]` (in the
Simulator) while your app is in the background, then reproduce? That’ll
at least tell you what’s triggering the message. If further
investigation indicates that the alert is being created by the
framework, please file a bug report.

--Kyle Sluder

> 
> -- 
> 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: UIImagePickerController in popover broken on iOS 9

2016-05-11 Thread Kyle Sluder
On Wed, May 4, 2016, at 01:34 PM, Matt Reagan wrote:
> Hi all,
> 
> I've encountered a bug when UIImagePickerController is presented in a
> popover on iOS 9, and have been unable to find a workaround / fix.

Please file a bug report at https://bugreport.apple.com.

--Kyle

> 
> It is easily reproducible in a brand new Xcode template (repro steps +
> sample project linked below), but I haven't been able to find much
> information online. I've been able to find partial fixes that depend on
> the orientation + multitasking settings of the app, but when the
> UIImagePickerController is the child of any other view controller
> (UITabBarController etc.) and the device or sim is in Landscape, it
> always breaks. I'm attempting to find a reliable fix or workaround, was
> hoping someone here may have seen this before?
> 
> Bug:
>   * UIImagePickerController presented in a popover of any kind has a 
> broken 'pop' / back navigation animation
>   * Animated gif:   http://i.imgur.com/na2lprb.gif
>   
> Factors:
>   * The bug itself is impacted by several things:
>   - Orientation of the device/sim (only reproducible in Landscape)
>   - Multitasking availability (only Multitasking-capable 
> devices/sims AFAICT)
>   - Multitasking opt-in (whether 'Requires full screen' is 
> checked)
>   - Whether the UIImagePickerController is a child of any other 
> controller
>   * The bug is NOT impacted by the following:
>   - Whether UIPopoverController or presentViewController: + 
> UIModalPresentationPopover style is used
>   
> Repro steps (sample project linked below):
>   - Create a new iOS Xcode project ('Single view application' template)
>   - Add a button and wire it up to an action method in ViewController.m
>   - Add code to present a standard UIImagePickerController in a 
> UITabBarController (ex. snippet below)
>   - Run the app on a 9.3 iPad Air 2 Device (or simulator)
>   - Make sure device/sim is rotated to Landscape
>   - Tap button (see 'Result' below)
>   
> Result:
>   * The popover is presented in the UITabBarController + popover 
> normally, but if the user pushes back within the UIImagePickerController's 
> navigation flow, the animation is broken
>   * Gif: http://i.imgur.com/na2lprb.gif
>   
> Example code:
> 
>   // Bug also reproducible via presentViewController: + 
> UIModalPresentationPopover style
> 
>   - (IBAction)buttonWasTapped:(UIButton *)sender
>   {
>   UIImagePickerController *cameraRollController = 
> [UIImagePickerController new];
> 
>   cameraRollController.sourceType = 
> UIImagePickerControllerSourceTypePhotoLibrary;
>   cameraRollController.allowsEditing = NO;
> 
>   UITabBarController *tabController = [UITabBarController new];
>   tabController.viewControllers = @[cameraRollController];
> 
>   UIPopoverController *popoverController = [[UIPopoverController 
> alloc] initWithContentViewController:tabController];
>   [popoverController presentPopoverFromRect:sender.bounds
>  inView:sender
>
> permittedArrowDirections:UIPopoverArrowDirectionDown
>animated:YES];
>   }
>   
> Example project:
>   * http://sound-of-silence.com/sos/private/ImagePickerBug.zip
>   
> So far I've tried just about everything I can think of to fix the
> problem. As noted above, there are partial "fixes" that work (disabling
> Multitasking, or limiting orientations), but this is true only when the
> UIImagePickerController is presented _directly_ in the popover. When the
> picker is a child of any other view controller (embedded in a tab
> controller, or added as a child of an arbitrary UIViewController) I've
> been unable to find a fix.
> 
> Has anyone seen this before? Any advice/suggestions would be greatly
> appreciated.
> 
> Thank you~
___

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: Very basic need, very difficult to achieve.

2016-05-03 Thread Kyle Sluder
On Tue, May 3, 2016, at 06:28 PM, Graham Cox wrote:
> My main dev machine runs the latest OS - 10.11.4
> 
> I need to install a 10.9 image on a disk partition for development
> testing.
> 
> How?
> 
> Apple’s dev site is getting worse all the time - wasting its time selling
> you something you already have - OS X - but hiding away basic resources,
> like an OS 9 installer that I can download. I’ve just spent 20 minutes
> fruitlessly searching the dev site. It’s utterly baffling, taking you
> round and round in circles.
> 
> How can I do this? Surely it’s actually possible, somehow?
> 
> Note that I do have an old Mavericks Installer, but it refuses to run on
> 10.11, saying that the app is too old ro run on this version of the OS. I
> also have not been able to set the partition I intend to use (that
> contains the installer) as a startup disk. I seem to recall that there
> was a thread about this not long ago, I even seem to remember pitching in
> something, but now I come to need it myself, I can’t get it to work.

Downgrading the OS (even on a second partition) isn’t actually that
simple of a request. If your computer was released after OS X Mavericks,
it definitely cannot support running OS X Mavericks. It’s also possible
that a firmware fix or disk format change may have shipped in a newer
OS, and older OSes are not qualified against that configuration.

Virtualization of recent versions of OS X is permitted on Apple-branded
hardware. That’s probably your best bet.

--Kyle

___

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: Trying to understand a permissions failure when writing to ~/Desktop

2016-01-27 Thread Kyle Sluder
On Wed, Jan 27, 2016, at 09:57 PM, Graham Cox wrote:
> Well, the OS definitely believes the app is sandboxed. The full URL I get
> for ~/Documents/ is in fact ~/Library/Containers//…. blah blah
> 
> I did a clean build and changed the bundle ID as well as discarding the
> container, but no, it just makes a new container with the new bundle ID.
> This is exasperating, I can’t see where it could be getting such a notion
> from.
> 
> Sandboxing is OFF in Xcode’s ‘Capabilities’ section, and AFAICS no
> .entitlements file is added to the build. Th eonly ‘funny’ I have in my
> info.plist is an entry for NSUbiquitousContainers, since I wanted to
> allow access to the user’s iCloud documents. I thought that setting
> allowed this without sandboxing, not that it snuck sandboxing in by the
> back door. I will check and see whether that’s a red herring.

Any app on OS X can open documents from iCloud Drive—the user just has
to navigate to iCloud Drive in Finder.

--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: Problem Archiving/Un-archiving Custom Objects

2016-01-22 Thread Kyle Sluder
On Fri, Jan 22, 2016, at 08:14 AM, Dave wrote:
> 
> > On 21 Jan 2016, at 23:40, Quincey Morris 
> > <quinceymor...@rivergatesoftware.com> wrote:
> > 
> > On Jan 21, 2016, at 15:22 , Dave <d...@looktowindward.com 
> > <mailto:d...@looktowindward.com>> wrote:
> >> 
> >> I’m relying of the copy attribute for the NSString’s, do I need to change 
> >> these to do a [xxx copy] too
> > 
> > If you’re writing the setter yourself, you must do the copy yourself. If 
> > you’re using the synthesized setter, it’s done for you.
> > 
> > In your own code, you may as well be liberal with ‘copy’. It’s basically 
> > free (in run-time cost) in situations where you don’t need it. You don’t 
> > save anything by leaving it out.
> > 
> 
> I’ve always been confused over what *actually* happens when you do
> something like this:
> 
> @property (copy)NSString*   pString;
> 
> 
> self.pString = [anotherString copy];
> 
> Do two new NSString objects get created? (I mean using the synthesized
> setter)

No. -copy is equivalent to -retain for immutable strings, so in the best
case this code causes zero copies (when anotherString is immutable), and
in the worst case it causes one (when anotherString is mutable).

--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: Another CFTypeRef question

2016-01-14 Thread Kyle Sluder
On Thu, Jan 14, 2016, at 08:54 AM, Clark Cox wrote:
> No. It does not change. A CF object has a single address for its
> lifetime.
> 
> > On Jan 14, 2016, at 06:42, Dave <d...@looktowindward.com> wrote:
> > 
> > Hi,
> > 
> > Does the pointer value of a CFTypeRef change during it’s lifetime? Can I 
> > safely uses the string value of the pointer %p as a key to a dictionary?

That said, this is a very strange question. It sounds like you're trying
to implement a hash table by working around the requirement that an
NSDictionary key's must be copiable. Are you sure NSMapTable is not
better for your needs?

--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: NSViewController -identifier unrecognized selecto problem

2015-12-09 Thread Kyle Sluder
On Wed, Dec 9, 2015, at 11:20 AM, Jonathan Mitchell wrote:
> NSViewController conforms to NSUserInterfaceItemIdentification so should
> implement 
> @property (nullable, copy) NSString *identifier;
> 
> I build my app on 10.11 with a deployment target of 10.9
> 
> Om 10.10 and 10.11 no issues.
> On 10.9 I get
> 
> 'NSInvalidArgumentException', reason: '-[TSToolbarGroup identifier]:
> unrecognized selector sent to instance 0x6018ee10’
> TSToolbarGroup is an NSViewController subclass of mine

As per the AppKit release notes, NSViewController only started
conforming to NSUserInterfaceItemIdentification in 10.10. Sadly, the are
no availability macros for conformances.

You might consider filing a bug report about this, but in the meantime
you'll need to stop sending -identifier to your view controllers when
running on 10.9.

--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: How to create an empty stack view in code

2015-12-07 Thread Kyle Sluder
On Sun, Dec 6, 2015, at 10:10 AM, Dave wrote:
> Hi,
> 
> I’m not sure what to use for the Frame though?

It doesn't matter. Auto Layout will change the frame on the first layout
pass anyway.

--Kyle Sluder

> The way this is setup is
> that I have a Stack View an empty Stack View in a NIB, as so:
> 
> @property (nonatomic,strong)IBOutlet NSStackView*  
> pLabelMainRowStackView; //Vertical
> 
> There is a then a Row Array which contains Column Arrays and each item in
> a Column Array is a Dictionary that contains the data for the
> Corresponding View.
> 
> So in code, I create a Column (Horizontal) Stack View, Create a New View
> for the Dictionary Item and add it to the newly created Stack View. When
> all Columns in the Array have been added, add the Column Stack view to
> the pLabelMainRowStackView Stack view.
> 
> All the Best
> Dave
> 
> > On 6 Dec 2015, at 15:48, Jonathan Hull <jh...@gbis.com> wrote:
> > 
> > You can just do [[NSStackView alloc] initwithFrame:]
> > 
> > 
> >> On Dec 6, 2015, at 6:23 AM, Dave <d...@looktowindward.com> wrote:
> >> 
> >> Hi All,
> >> 
> >> How do I create an Empty Stack View in code? The only method I can find 
> >> that that creates a Stack View is stackViewWithViews and you can’t pass 
> >> nil to this. Do I have to pass an empty array or can I just do 
> >> [[NSStackView alloc] init]; ?
> >> 
> >> 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

Re: Best Control for Catching a Mouse Click?

2015-12-07 Thread Kyle Sluder
On Mon, Dec 7, 2015, at 10:32 AM, Dave wrote:
> Hi All,
> 
> I have a view that is made up for a Text View and a Small Icon like so:
> 
> NSView
>   NSImageView
>   NSTextField
> 
> If the User Clicks anywhere inside the base NSView, I’d like a Perform
> Click IBAction to be sent to the connected class (The View Controller in
> this case). In the past, on iOS i’ve done this by using a transparent
> UIButton that has the same Frame Rect as the base NSView.

This probably made your app inaccessible with VoiceOver. Please do not
use invisible controls for this sort of thing.

> When I tried to
> do with the same with an NSButton, I find that I can’t change the height
> in IB? 
> 
> On the Mac what is the best control to use to do this?

Use a different approach that will work on both platforms. Override
-hitTest: in a containing view. This will also work well with
accessibility.

--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: Hide UINavigationBar and keep UIPageController content static

2015-10-27 Thread Kyle Sluder
On Tue, Oct 27, 2015, at 11:49 AM, Stevo Brock wrote:
> Hi David and Kyle,
> 
> Thanks so much for the insight and pointers.
> 
> I was manually calling setNeedsDisplay() when toggling the navigation bar
> hidden, and now I can remove that and just set the contentMode to
> .Redraw.  That’s great.
> 
> And setting the automaticallyAdjustsScrollViewInsets to false helps, and
> I can now go back to drawing the content under the top bars and the
> content stays put while the bar animates up and down.
> 
> Thanks again guys for your expert insight.

You're welcome. You can pay me back by filing a bug about this issue
with an attached sample project. :P

--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: Hide UINavigationBar and keep UIPageController content static

2015-10-24 Thread Kyle Sluder
On Tue, Oct 20, 2015, at 11:21 AM, Stevo Brock wrote:
> The trick is, if in the storyboard, on the UIPageController, I set the
> “Under Top Bars” to yes, my custom view draws full screen.  But when I
> toggle the navigationBarHidden, the custom view and its superview scroll
> up and down the size of the navigation bar.

This sounds like it might be a bug in automatic content inset
adjustment. Please file a Radar with a sample project.

In the meantime, you can try turning off
automaticallyAdjustsScrollViewInsets on your view controller and
managing layout manually (relative to the view controller's
topLayoutGuide) in an override of -viewDidLayoutSubviews.

> 
> 
> Alternatively, if in the storyboard, on the UIPageController, I set the
> “Under Top Bars” to no, my custom view draws in the screen space under
> the navigation bar.  When I toggle the navigationBarHidden, the view
> stretches to fill the full height of the screen, but I never get a redraw
> call, so the drawing is stretched.

This is expected. Views that need to redraw when they change size should
override -setBounds: to call [self setNeedsDisplay].

--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: titleForHeaderInSection wrong section count.

2015-10-19 Thread Kyle Sluder
On Mon, Oct 19, 2015, at 01:26 PM, James Cicenia wrote:
> I have a fetch
> 
> let aFetchedResultsController = NSFetchedResultsController(fetchRequest:
> fetchRequest, managedObjectContext: getManagedObjectContext(),
> sectionNameKeyPath:"product.sectionKey", cacheName:nil)
> 
> In the following function:
>
>  func tableView(tableView: UITableView, titleForHeaderInSection section:
>  Int) -> String? {
>   print(section)
> print (searchFetchedResultsController.sectionIndexTitles)
> 
> I see:
> 
> 30
> ["1", "2", "4", "8", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J",
> "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X",
> "Y", "Z"]
> 
> Yes there are 30 elements but the array is zero based.
> 
> What is happening here?

Can you reproduce this in a sample app and attach it to 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

Re: Implications of disabling ATS?

2015-10-02 Thread Kyle Sluder
On Wed, Sep 30, 2015, at 03:45 PM, Mike Abdullah wrote:
> 
> > On 30 Sep 2015, at 17:17, Jens Alfke <j...@mooseyard.com> wrote:
> > 
> > 
> >> On Sep 30, 2015, at 7:06 AM, Alex Hall <mehg...@icloud.com> wrote:
> >> 
> >> However, before I go doing that, does anyone know of a better way? Are 
> >> there security implications I'm overlooking? I don't know what users will 
> >> do with this web view, and yes, some may log into sites or give other 
> >> sensitive data. The primary use case is to look at articles, videos, etc 
> >> that are tweeted, though, and to do that I can't have ATS blocking 
> >> everything. I'm not sure what the best course is here. Thanks.
> > 
> > You might want to use WKWebView instead, then, if all you need is a basic 
> > display of some Web content. Since it’s actually running in a separate 
> > process, your app won’t be the origin of the insecure HTTP loads, so you 
> > shouldn’t run into any issues with ATS.
> 
> In my testing so far, WKWebView is subject to the same limits still of
> ATS.

But SFSafariViewController is not. And it's more powerful.

--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: Implications of disabling ATS?

2015-10-02 Thread Kyle Sluder
On Oct 2, 2015, at 2:30 PM, Alex Hall <mehg...@icloud.com> wrote:
> 
> 
>> On Oct 2, 2015, at 16:01, Kyle Sluder <k...@ksluder.com> wrote:
>> 
>> On Wed, Sep 30, 2015, at 03:45 PM, Mike Abdullah wrote:
>>> 
>>>> On 30 Sep 2015, at 17:17, Jens Alfke <j...@mooseyard.com> wrote:
>>>> 
>>>> 
>>>>> On Sep 30, 2015, at 7:06 AM, Alex Hall <mehg...@icloud.com> wrote:
>>>>> 
>>>>> However, before I go doing that, does anyone know of a better way? Are 
>>>>> there security implications I'm overlooking? I don't know what users will 
>>>>> do with this web view, and yes, some may log into sites or give other 
>>>>> sensitive data. The primary use case is to look at articles, videos, etc 
>>>>> that are tweeted, though, and to do that I can't have ATS blocking 
>>>>> everything. I'm not sure what the best course is here. Thanks.
>>>> 
>>>> You might want to use WKWebView instead, then, if all you need is a basic 
>>>> display of some Web content. Since it’s actually running in a separate 
>>>> process, your app won’t be the origin of the insecure HTTP loads, so you 
>>>> shouldn’t run into any issues with ATS.
>>> 
>>> In my testing so far, WKWebView is subject to the same limits still of
>>> ATS.
>> 
>> But SFSafariViewController is not. And it's more powerful.
> 
> It looks that way, but I can't find anything about using it on OS X. Is this 
> an iOS-only feature?

Ah, yes it is. My apologies.

--Kyle Sluder

> I've had to temporarily remove Xcode to install an update (64-GB MacBooks are 
> terrible for primary machines), so I can't look at the actual class just now. 
> Everything I'm reading, though, suggests this is exclusive to iOS9 and above.
>> 
>> --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/mehgcap%40icloud.com
>> 
>> This email sent to mehg...@icloud.com
> 
> 
> --
> Have a great day,
> Alex Hall
> mehg...@icloud.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: KVO detection of changes to selection in NSOpenPanel

2015-07-20 Thread Kyle Sluder
On Mon, Jul 20, 2015, at 11:13 AM, Jonathan Taylor wrote:
 This does make me wonder if I should perhaps not be surprised that my use
 of keyPathsAffectingValueForKey is not going well, although nothing in
 that statement seems to specifically preclude what I am doing from
 working on 10.8. Does anyone know if there’s any hope of my KVO approach
 working?

No. If a property is not explicitly documented to be KVO-compliant, you
must assume that it isn't.

The alternative seems to be to implement a delegate method for
 panelSelectionDidChange. Would that be the sensible way to deal with
 this, or is there a third and better way I should be using?

It seems pretty straightforward to just implement the delegate method
regardless of OS version.

--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: AfxIsValidAddress

2015-07-18 Thread Kyle Sluder
On Tue, Jul 14, 2015, at 12:09 PM, Wim Lewis wrote:
 It checks whether a given address range is mapped (or equivalent
 terminology on Windows). Windows has another function that programmers
 like to use, IsBadReadPtr(), that does something similar.

Raymond Chen (compatibility engineer at Microsoft) elaborates a little
more on what something similar actually means:
http://blogs.msdn.com/b/oldnewthing/archive/2006/09/27/773741.aspx

:P

--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: Unable to connect IBOutlet in Swift Xcode 7b2

2015-07-07 Thread Kyle Sluder
On Mon, Jul 6, 2015, at 07:57 PM, Rick Mann wrote:
 
  On Jul 6, 2015, at 17:54 , Charles Srstka cocoa...@charlessoft.com wrote:
  
  I’ve occasionally had issues getting Xcode to connect outlets and actions. 
  My workaround for it is to open the Assistant view, and drag from your view 
  into the source file, and let Xcode create an outlet or action 
  automatically. Then you can delete the one it created and it should work 
  with the one you already had.
 
 This is what Xcode is refusing to do. As if the class definition wasn't
 matching the class I specified in the storyboard (but it does; I copied
 and pasted the name).

Is the Module correct?

--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: How to take an Image Snapshot a Window

2015-06-27 Thread Kyle Sluder
On Sat, Jun 27, 2015, at 01:51 PM, Dave wrote:
 Hi,
 
 Does anyone have any idea how to go about taking an image snapshot of a
 Window that doesn’t belong to my App?
 
 Like the Grab App's functionality Capture Window”.

https://developer.apple.com/library/mac/samplecode/SonOfGrab/Introduction/Intro.html

--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: iOS - Proper way to check UIEvent or UInternalEvent

2015-06-23 Thread Kyle Sluder
 On Jun 23, 2015, at 7:31 PM, Alex Zavatone z...@mac.com wrote:

 
 
 On Jun 23, 2015, at 9:27 PM, Kyle Sluder wrote:
 
 On Jun 23, 2015, at 6:10 PM, Alex Zavatone z...@mac.com wrote:
 
 Actually, the rotate event is the one that is being caught and sent.
 
 If it's a UIEvent and it's listed as a UIInternalEvent, within the 
 debugger, how do I check the type and subtype to see what type of event it 
 is so that I can return immediately if it is the wrong type?
 
 I don’t understand the question. Or rather, I understand the question, but I 
 don’t understand why you are asking it.
 
 Because an exception is thrown in that case and I'd prefer to return before 
 my app quits.

It’s your code that’s throwing the exception, right? Or are you saying that 
UIKit is throwing an exception if you ask for the .type of a UIEvent that it 
hands you, if that object just so happens to be an instance of a private 
subclass?

 
 There are three public types of event: Touches, Motion, and RemoteControl. 
 Are you saying that UIInternalEvents are re-using one of these constants, 
 and therefore you need an alternative way to disambiguate them? That’s 
 definitely a problem and you should file a Radar.
 
 I'm saying I want to see which event it is and return if it is a motion 
 event.

Assuming the exception is being thrown by your code, stop doing that and just 
check the event’s .type. If it isn’t equal to Motion, skip it.

 
 
 If you just want to spelunk around the innards of a private UIEvent 
 subclass, then no. We will not provide you information to do so.
 
 Barring that, just do if (event.type==UIEventTypeMotion) { } else if 
 (event.type==UIEventTypeTouches) { } …
 
 Yeah, I tried that.  The event.type is returning -1 and isn't matching any of 
 the 3 UIEventType enum values.  It's not matching on any of them.

There is no guarantee that the event type will be a member of the public enum. 
Your code needs to be prepared for this case. A future OS might add a new event 
type. You don’t want your existing, shipping apps to blow up when the user 
upgrades their OS.

--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: iOS - Proper way to check UIEvent or UInternalEvent

2015-06-23 Thread Kyle Sluder
On Tue, Jun 23, 2015, at 10:20 PM, Alex Zavatone wrote:
 It's not being thrown by my own code.  It's a rotate event that's being
 sent by the system. 

[snip]

 The event's type doesn't match the enums.  The event's type doesn't match
 any enum that I know of.

Again: your app needs to be OK with this, if for no other reason than
future-proofing.

 
 All I can get is a -1 of type and a 0 of subtype for any event that's
 sent through this event catching class that I had no part in writing.

What happens if you remove this event-catching class? Does UIKit still
throw an exception when you pass along the event? Are you sure that
you're passing the event to an object that is expecting that event?
(That is, you're not trying to pass events that should be going to
UIApplication to some other object, right?)

If so, this a serious issue and you should file a Radar. I cannot
recommend any evasive action for you.

--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: iOS - Proper way to check UIEvent or UInternalEvent

2015-06-23 Thread Kyle Sluder
 On Jun 23, 2015, at 6:10 PM, Alex Zavatone z...@mac.com wrote:
 
 Actually, the rotate event is the one that is being caught and sent.
 
 If it's a UIEvent and it's listed as a UIInternalEvent, within the debugger, 
 how do I check the type and subtype to see what type of event it is so that I 
 can return immediately if it is the wrong type?

I don’t understand the question. Or rather, I understand the question, but I 
don’t understand why you are asking it.

There are three public types of event: Touches, Motion, and RemoteControl. Are 
you saying that UIInternalEvents are re-using one of these constants, and 
therefore you need an alternative way to disambiguate them? That’s definitely a 
problem and you should file a Radar.

If you just want to spelunk around the innards of a private UIEvent subclass, 
then no. We will not provide you information to do so.

Barring that, just do if (event.type==UIEventTypeMotion) { } else if 
(event.type==UIEventTypeTouches) { } …

--Kyle Sluder


 
 On Jun 23, 2015, at 7:35 PM, Kyle Sluder wrote:
 
 On Tue, Jun 23, 2015, at 02:54 PM, Alex Zavatone wrote:
 We don't care about motion events.  We only care about touch events.
 
 I'm trying to check if the event is a of UIEventTypeMotion and simply
 return.
 
 If you only care about touch events, why aren't you comparing against
 UIEventTypeTouches?
 
 --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/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: iOS - Proper way to check UIEvent or UInternalEvent

2015-06-23 Thread Kyle Sluder
On Tue, Jun 23, 2015, at 02:54 PM, Alex Zavatone wrote:
 We don't care about motion events.  We only care about touch events.
 
 I'm trying to check if the event is a of UIEventTypeMotion and simply
 return.

If you only care about touch events, why aren't you comparing against
UIEventTypeTouches?

--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: Getting a server to trust the client. (iOS)

2015-06-22 Thread Kyle Sluder
On Mon, Jun 22, 2015, at 12:32 PM, Alex Zavatone wrote:
 Basically, we're trying to make sure that we limit just what type of
 client can contact our web service and limit it to our iOS and Android
 apps.

Generally speaking, this isn't possible. All of the information
necessary to authenticate the client as genuine needs to be contained
within your application, which makes it possible to extract, inspect,
and mimic.

You might look up the history of AOL trying to kick unauthorized clients
off its AIM network. The continued existence of projects like GAIM and
Trillian provides some commentary on the effectiveness of that approach.

--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: Language options: Objective-C, Swift, C or C++?

2015-06-16 Thread Kyle Sluder
On Tue, Jun 16, 2015, at 02:34 AM, Roland King wrote:
 And now I know what Kyle looks like too! 

You know what I look like with a bad haircut and not a lot of sleep. :P

BTW, the session is more precisely called What's New in Storyboards, in
case anyone is having trouble finding it.

--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: Buy music on iTunes

2015-06-15 Thread Kyle Sluder
On Mon, Jun 15, 2015, at 08:27 AM, Viacheslav Karamov wrote:
 Are you sure?
 I learned that I could achieve it by using SKStoreProductViewController, 
 but I need the way to not use it.

You _must_ use SKStoreProductViewController for purchases. This is how
the system protects against apps that would otherwise silently try to
buy things that the user didn't want.

--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: Forwarding messages to another class

2015-06-06 Thread Kyle Sluder
On Jun 6, 2015, at 2:35 PM, Cosmo minonom...@gmail.com wrote:
 
 I’m trying to send messages from a class to one of its subclasses. I have a 
 method that returns the class I want to forward to. If I use it in the 
 following manner, it works:
 
 + (void)logout
 {
// subclasses handle it
[[self classToUseForBackend] logout];
 }
 
 By setting breakpoints in this method and the subclass I can see that the 
 message goes where i expect.
 
 If I use it in the following manner, the message is not forwarded to the 
 subclass with the identical signature. It ends up being re-sent to the 
 superclass method (i.e. where I’m calling it here) and I get an infinite loop.
 
 + (NSString *)errorMessageForCode:(NSInteger)errorCode
 {
// subclasses handle it
NSString *msg = [[self classToUseForBackend]

Objective-C uses purely dynamic dispatch. `self` always refers to the instance 
the message is being sent to, regardless of what class owns the method 
implementation that happens to be sending the message. So [self 
classToUseForBackend] will *always* invoke the most-specific 
(“most-overridden”) implementation of that method.

--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: Looking at self = [super init].

2015-06-02 Thread Kyle Sluder
On Tue, Jun 2, 2015, at 03:42 PM, Charles Srstka wrote:
  On Jun 2, 2015, at 3:31 PM, Jens Alfke j...@mooseyard.com wrote:
  
  I agree, actually. But in Swift the concept of ivar no longer exists, so I 
  have to rely on color/style to distinguish properties from locals.
 
 My solution with Swift is to consistently use the “self.” prefix when
 referencing properties. If Apple could include an optional compiler
 warning to enforce this like they do with Obj-C auto-synthesis, it’d be
 *great* (hint hint for any Apple engineers that happen to be reading
 this).

If you think this would be a worthwhile change to Swift, 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

Re: How to get bold and plain fonts?

2015-05-30 Thread Kyle Sluder
On Sat, May 30, 2015, at 09:42 PM, Graham Cox wrote:
 I’m using -[NSFontManager availableFontNamesWithTraits:] and I want to
 get the names of all of the fonts that have both a regular (plain) and
 bold option.
 
 I’ve tried various things, but this seems like it should work:
 
   NSArray* fonts = [[NSFontManager sharedFontManager] 
 availableFontNamesWithTraits:NSBoldFontMask | NSUnboldFontMask];

Here, you're asking for all fonts that consider themselves to be both
bold and unbold. This set is going to be empty (unless you have a
particularly broken font installed).

 
 Except it returns no results. According to the docs if I pass 0 for
 traits, it should return all the plain fonts, and it’s equivalent to
 NSUnboldFontMask | NSUnitalicFontMask. That returns no results.
 

This is a known bug.

If you want to query for fonts with certain traits, you're much better
off using NSFontDescriptor.

--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: Anyone else having trouble with the Provisioning Profile?

2015-05-28 Thread Kyle Sluder
On Thu, May 28, 2015, at 02:50 PM, Rick Mann wrote:
 Oooh, good call! I have ghostery. What BS are they doing that ghostery
 blocks, I wonder. 

It might be more fair not to immediately discount the possibility that
third-party software which is designed to interfere with your network
communications might have bugs or unintended consequences.

I'm sure the Dev Programs team would appreciate all the unbiased data
you can gather regarding poor interactions between Ghostery and the Dev
Portal.

--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: Found It - Problem with Outline View and Manual Memory Management

2015-05-28 Thread Kyle Sluder
On Thu, May 28, 2015, at 08:37 AM, Dave wrote:
 Hi,
 
 This is from Apple Sample Code so I thought something as fundamental as
 this would have been dealt with correctly. This is the copy method inside
 the “ImageAndTextCell” class,
 
 -(id) copyWithZone:(NSZone*) zone
 {
 ImageAndTextCell *cell = (BJImageAndTextCell*) [super copyWithZone:zone];
 cell.pTextCellImage = self.pTextCellImage;
 
 return cell;
 }

I'm guessing this is taken from the SourceView sample? That project uses
ARC. If you are using ARC in your own project, sending -copyWithZone: to
super should do the right thing. (Yes, whether super does the right
thing is based on whether _your class_ is compiled using ARC.)

In any event, please consider moving to a view-based table view. Then
you don't need to use a custom cell class at all.

--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: objc_msgSend() selector name: tableView:objectValueForTableColumn:row:

2015-05-27 Thread Kyle Sluder
 On May 27, 2015, at 8:17 AM, Scott Ribe scott_r...@elevated-dev.com wrote:

 
 On May 27, 2015, at 8:20 AM, Kyle Sluder k...@ksluder.com wrote:
 
 The bug is in your code. It has always been a requirement that you nil out 
 any delegate and datasource backpointers before the thing they point to gets 
 deallocated. You just happened to get away with it due to some aspect of 
 older Xcode versions’ codegen.
 
 I’m pretty sure that a window and it’s views should not be trying to redraw 
 after being closed…

Raglan said nothing about the window being closed.

--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: Anyone else having trouble with the Provisioning Profile?

2015-05-27 Thread Kyle Sluder
You’ve all filed Radars about this, yes?

--Kyle Sluder

 On May 26, 2015, at 6:53 PM, Doug Hill cocoa...@breaqz.com wrote:
 
 I’ve noticed very long loading times for the pages in the Certs, IDs  
 Profiles sections, but it eventually loads.
 I just tried it now in Chrome and it took ~5mins of staring at that spinner 
 for the list of Provisioning profiles to load.
 
 Doug Hill
 https://chartcube.com/ https://chartcube.com/
 Pivot Tables on your iPad
 
 
 On May 26, 2015, at 6:39 PM, Roland King r...@rols.org wrote:
 
 Yep. 1 week it's been busted. 
 
 
 On 27 May 2015, at 07:30, Rick Mann rm...@latencyzero.com 
 mailto:rm...@latencyzero.com wrote:
 
 Anyone else having trouble with the (Mac) Provisioning Profile? I just get 
 the spinner in the area where it normally shows content.
 
 -- 
 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/kyle%40ksluder.com
 
 This email sent to k...@ksluder.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: objc_msgSend() selector name: tableView:objectValueForTableColumn:row:

2015-05-27 Thread Kyle Sluder
 On Apr 13, 2015, at 12:11 PM, Raglan T. Tiger r...@crusaderrabbit.net wrote:
 
 Just a quick follow-up and thanks to those that put me on the right path.
 
 I ran the code in GDB on a 10.6.8 machine and set NSZombieEnabled=YES.  This 
 showed me the object that was released that Cocoa was calling 
 tableView:objectValueForTableColumn:row: on after release.  This was only a 
 problem on 10.6.8 machines.
 
 The solution was to set the datasource and delegate to nil on the table 
 before exiting the stack that started the process.
 
 This does seem to be a bug when building with Xcode 6.2 and 10.9 SDK.

The bug is in your code. It has always been a requirement that you nil out any 
delegate and datasource backpointers before the thing they point to gets 
deallocated. You just happened to get away with it due to some aspect of older 
Xcode versions’ codegen.

This was a large motivation behind Zeroing Weak References (aka __weak in ARC).

--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: 10.10 replacement for SMJobCopyDictionary

2015-05-25 Thread Kyle Sluder
On Mon, May 25, 2015, at 06:13 AM, Gerriet M. Denkmann wrote:
 How to translate this into 10.10 without deprecation warnings?
 
 CFDictionaryRef diref = SMJobCopyDictionary( kSMDomainSystemLaunchd,
 “de.mdenkmann.MyTool” );
 if ( diref == nil ) //  MyTool is not running 


The point of launchd is to start jobs on-demand. Why are you trying to
check if your launchd job is already running? What's to say that as soon
as launchd tells you it's running, it doesn't turn around and kill it
because its sudden termination suspension count dropped to 0?

--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: Disabling auto-synthesis of property accessors.

2015-05-21 Thread Kyle Sluder
On Thu, May 21, 2015, at 12:11 PM, Alex Zavatone wrote:
 Jens mentioned that it was possible to turn off the auto-synthesis of
 properties in the build options of the target.
 
 This would be quite useful to help me iron out items that need to be
 refactored in my current project.
 
 My google skills are weak.  I can't find out how to do this.  Anyone care
 to clue me in?  All the responses I see state that it's not possible.

Project editor  Build Settings  Search for synth

--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: NSFontPanel swamping the responder chain (and crashing)

2015-05-20 Thread Kyle Sluder
On Tue, May 19, 2015, at 09:26 PM, Graham Cox wrote:

 Crashed Thread:0  Dispatch queue: com.apple.main-thread
 
 Exception Type:EXC_BREAKPOINT (SIGTRAP)
 Exception Codes:   0x0002, 0x
 
 Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
 0   com.apple.CoreFoundation0x7fff91e9fd20
 ___forwarding___ + 768
 1   com.apple.CoreFoundation0x7fff91e9f998
 _CF_forwarding_prep_0 + 120
 2   com.apple.AppKit0x7fff8cdf23c7 -[NSWindow
 supplementalTargetForAction:sender:] + 240
 3   com.apple.AppKit0x7fff8cdf1f74
 _objectFromResponderChainWhichRespondsToAction + 227

 At line 2, it’s clearly trying to access a NSWindow zombie.

No, the zombie is something that the window messages when trying to
figure out what to return from  -supplementalTargetForAction:.

Depending on the message being dispatched and who responds to that
action, this method might return the window's delegate, its window
controller, or its document. So I'd start by making sure none of those
objects have been zombied.

--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: NSNotificationQueue Question

2015-05-20 Thread Kyle Sluder
On Wed, May 20, 2015, at 12:59 PM, Jens Alfke wrote:
 
  On May 20, 2015, at 10:18 AM, Richard Charles rcharles...@gmail.com wrote:
  
  This works but the problem is that there are undesirable side effects to 
  running the runloop once when this call is made.
 
 Yup. Manually spinning the runloop in any non-custom mode is generally a
 bad idea.

I would revise this a bit… spinning the runloop in Default mode is
generally not advisable. Spinning in event tracking mode is far more
common. Spinning in a custom mode is definitely only for those who
really know what they're doing… if you start calling out to other code,
that code might be very confused when its timers don't fire.

--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: Collection Views Breaking

2015-05-20 Thread Kyle Sluder
On Wed, May 20, 2015, at 01:12 PM, Alex Zavatone wrote:
 Whaaa?
 
 The app throws an exception, but setting an exception breakpoint never
 gets triggered?

EXC_BAD_ACCESS is a hardware exception. It has nothing to do with a
software exception (the kind thrown by @throw or +[NSException raise],
and which you can set a breakpoint on).

It's unfortunate that the software industry uses the same term for both.
It also doesn't help that certain other platforms unify the concepts
(essentially trapping on hardware exceptions and re-raising them as
software exceptions).

--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: NSFontPanel swamping the responder chain (and crashing)

2015-05-19 Thread Kyle Sluder
On Tue, May 19, 2015, at 07:22 PM, Graham Cox wrote:
 3   com.apple.AppKit0x7fff8fb2fe3e
 -[NSApplication targetForAction:to:from:] + 329
 4   com.mapdiva.as.artboard 0x000105a3103a 0x1059ba000 +
 487482
 5   com.apple.AppKit0x7fff8fdba102 -[NSFontPanel
 _canShowEffects] + 44

I'd start by looking at frame #4.

--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: Generate a _CFURLAliasData entry for Finder toolbar

2015-05-15 Thread Kyle Sluder
On Fri, May 15, 2015, at 02:37 PM, Gary Ash wrote:
 I’m trying to programmatically add a link to an app to Finder’s toolbar.

Programmatic customization of the Finder toolbar is not supported.

If you are not in the MAS, you can use LSSharedFileList and
Authorization Services APIs to place items in the Favorites list.

 I’ve found that dragging  an app onto the toolbar works like a charm and
 adds a dictionary entry to NSToolbar Configuration Browser-TB Item
 Plists in the format:

Reaching into another app's Preferences usually doesn't work (unless the
other app is expecting it), and is a sandbox violation.

--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: Optionals? A better option!

2015-05-15 Thread Kyle Sluder
On Fri, May 15, 2015, at 11:31 AM, Jens Alfke wrote:
 Yes, but when you evaluate (cdr nil) doesn’t the interpreter trigger an
 exception? (Sorry, it’s been decades since I used LISP.) Similarly, in
 Smalltalk-80 ‘null’ is a real object, a singleton of class
 UndefinedObject, but trying to message it is going to raise a
 message-not-handled exception. The difference from a nil pointer is
 mostly that you get a language-level rather than an OS-level exception.

Just as a point of esoterica, nothing about the C spec requires the null
pointer to map to a hardware-level trap. The only requirement is that
there exist a value called the null pointer in every pointer type, that
all null pointers compare equal to each other, and that they do not
compare equal to any non-null pointers.

It's not valid to dereference a null pointer, but what happens when you
do is undefined.

The assumption that dereferencing a null pointer would always lead to a
hardware fault led to a pretty serious vulnerability in the Linux
kernel: http://lwn.net/Articles/342330/

Here's some more elaboration:
https://software.intel.com/en-us/blogs/2015/04/20/null-pointer-dereferencing-causes-undefined-behavior

And all of this is why Swift and every other modern programming
languages goes the route of Optionals.

--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: Optionals? A better option!

2015-05-14 Thread Kyle Sluder
On Thu, May 14, 2015, at 12:34 PM, Quincey Morris wrote:
 — It’s used in both signed and unsigned contexts, so it really has 2
 values

FWIW, NSNotFound is defined as NSIntegerMax, so it has the same value in
both signed and unsigned contexts.

--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: Core Data sync between iOS and Mac apps

2015-05-12 Thread Kyle Sluder
On Tue, May 12, 2015, at 10:35 AM, Jens Alfke wrote:
 You can still handle conflicts using Dropbox, it’s just trickier. You’ll
 need to detect the renamed version of the file that Dropbox creates —
 something like “MyAppData (Jens Alfke's conflicted copy 2015-05-09).db” —
 then open both files and reconcile any changes, then save back to the
 original file and delete the conflicted copy. And somehow keep both
 devices from doing this at the same time, or you’re back at square one.

There was a hilarious* bug in an early version of OmniPresence where
clients a) eagerly resolved conflicts and b) did not back off if their
attempt to resolve the conflict created another conflict.

The result was that if you had two Macs running OmniPresence, and you
managed to create a conflict, occasionally both machines would just
start generating infinite duplicates of the conflicted document.

--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: IB_DESIGNABLE - anyone got it to work?

2015-05-12 Thread Kyle Sluder
 On May 12, 2015, at 5:49 PM, Graham Cox graham@bigpond.com wrote:
 
 
 On 13 May 2015, at 10:06 am, Kyle Sluder k...@ksluder.com wrote:
 
 On Tue, May 12, 2015, at 06:38 PM, Graham Cox wrote:
 
 So it looks as if a property that is IBInspectable may be getting
 incorrectly set to 0 by IB AFTER -initWithFrame: is called, maybe because
 the user interacts with the inspectable properties but doesn’t set a
 value - rather than leaving it alone it forces it to 0. That’s definitely
 a bug. It could also be caused by the stale values I mentioned before,
 where removing IBInspectable attribute from a property doesn’t remove the
 property setting in the nib.
 
 IBInspectable properties are just a convenience for setting User-Defined
 Runtime Attributes on the Identity inspector. Since the original purpose
 of User-Defined Runtime Attributes is to set values that IB doesn't know
 about, IB can't forget settings for which the IBInspectable property has
 been removed.
 
 Likewise, there is no such thing as a valueless User-Defined Runtime
 Attribute. Conceptually, we could add one, since UDRAs are just a way to
 say call -setValue:forKey: after decoding, and nil values are
 acceptable here (as opposed to, say, dictionaries).
 
 
 When you say ‘we’, does that mean this is something you are working on?

I don’t work on Interface Builder.

 
 If there’s no such thing as a ‘valueless’ inspectable property, why does the 
 UI seem to indicate that there is - for example a BOOL property has on, off 
 and ‘default’, and a numeric property shows ‘- -‘ instead of its initial 
 value? This is confusing because it appears to imply that if you don’t enter 
 a value, the property will not be touched and whatever the code initialises 
 it to will be used. Instead, what actually happens is that it’s set to 0, NO, 
 nil, etc depending on type.

I was speaking from the perspective of UDRAs: you can't set a nil Number or 
String, for example.

If you have default properties, those definitely should not be touched, and 
you should file a bug.

 
 Because IB is always invoking -initWithCoder: even though I was expecting 
 -initWithFrame: (I’ve fixed that by calling some common initialisation), it 
 means that the coder method has to be liberally sprinkled with if([coder 
 containsValueForKey:…]) tests so that properties don’t get wiped out by 0, 
 NO, nil when they’re not present. 

Ah, I see what you mean now.

I actually think that whether IB calls -initWithCoder: or -initWithFrame: is 
technically undocumented. You should file a bug about that, too.

 Obviously, after this, properties that are UDRAs are set anyway. The problem 
 is that if a property was IBInspectable for a while, and then not made 
 IBInspectable, a stale value of 0 for that property remains in the nib, even 
 though there’s no interface to it at all - neither a UDRA or IBInspectable.

OK, that surprises me. If you peek at the XIB contents, do you see the dummy 
values for the IBInspectable properties there?

--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: IB_DESIGNABLE - anyone got it to work?

2015-05-12 Thread Kyle Sluder
On Tue, May 12, 2015, at 06:38 PM, Graham Cox wrote:
 
 So it looks as if a property that is IBInspectable may be getting
 incorrectly set to 0 by IB AFTER -initWithFrame: is called, maybe because
 the user interacts with the inspectable properties but doesn’t set a
 value - rather than leaving it alone it forces it to 0. That’s definitely
 a bug. It could also be caused by the stale values I mentioned before,
 where removing IBInspectable attribute from a property doesn’t remove the
 property setting in the nib.

IBInspectable properties are just a convenience for setting User-Defined
Runtime Attributes on the Identity inspector. Since the original purpose
of User-Defined Runtime Attributes is to set values that IB doesn't know
about, IB can't forget settings for which the IBInspectable property has
been removed.

Likewise, there is no such thing as a valueless User-Defined Runtime
Attribute. Conceptually, we could add one, since UDRAs are just a way to
say call -setValue:forKey: after decoding, and nil values are
acceptable here (as opposed to, say, dictionaries).

If you're an old-school Mac developer, one of the tricks to getting
along with IBInspectable is forgetting everything you've ever known
about IB Plugins. :P

 Overall, looks promising but right now too buggy to rely on. :(

Radars are always welcome. :)

--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: Outlets are nil after awakeFromNib call

2015-05-10 Thread Kyle Sluder
On Sun, May 10, 2015, at 11:58 AM, Sasikumar JP wrote:
 Hi,
 
I am observing outlets are nil after the awakeFromNib call in my
 viewcontroller which is created from the storyboard.
 
 As per the apple documentation, awakeFromNib will be called after
 initialising all the objects  and outlets for a view controller from nib.
 
   i hope awakeFromNib is valid for storyboard too.

You almost certainly want to override -viewDidLoad rather than implement
-awakeFromNib on your view controller. (This is true regardless of
whether you're using storyboards.) When your storyboard is compiled,
your view controller is archived separately from its view. Therefore,
when your view controller gets -awakeFromNib as part of being
unarchived, none of its outlets can possibly be set up, because the view
is in a different archive whose loading has not been triggered yet.

On OS X, your view controller might get -awakeFromNib _a second time_
when its view is unarchived during -loadView, at which point its outlets
will be hooked up. That depends on whether or not OS X storyboards use
the new prefer coder unarchiving behavior, which is an implementation
detail. On iOS, you won't get a second -awakeFromNib, since UINib has
never sent -awakeFromNib to File's Owner.

--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: orderFront: 10.10 vs 10.9

2015-05-08 Thread Kyle Sluder
On Fri, May 8, 2015, at 09:40 AM, sqwarqDev wrote:
 Can't help with the why, but try putting
 
 [button lockFocus];
 
 in that method. Even when there isn't an explicit unlockFocus call, I've
 had this error message a couple of times and adding an explicit lockFocus
 cured it.


Please don't blindly lock and unlock focus on views. You will have much
better results if you actually sit down and figure out where 
the bug is in your code.

--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: Subclassing NSPopUpButton

2015-05-08 Thread Kyle Sluder
On Fri, May 8, 2015, at 11:42 AM, Raglan T. Tiger wrote:
 I have subclassed NSPopUpButton.  In the subclass  drawRect:dirtyRect is
 called ... I did this just to check that the subclass is properly
 implemented.
 
 In the subclass keyDown:theEvent is not being called.  How does one
 override this method for an NSPopUPButton subclass?
 
 The purpose for overriding keyDown:theEvent is to create my own search
 string to find items in the menu.

This sounds like a feature that exists in Xcode, which implies you're
trying to do this while the menu is visible. In that case, the menu is
running the runloop in event-tracking mode and pulling events for its
own purpose. The window containing the popup button is (conceptually, if
not in actuality) no longer key.

I believe someone has implemented a workalike to the Xcode
functionality.

--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: Subclassing NSPopUpButton

2015-05-08 Thread Kyle Sluder
On Fri, May 8, 2015, at 12:41 PM, Raglan T. Tiger wrote:
  On May 8, 2015, at 10:55 AM, Kyle Sluder k...@ksluder.com wrote:
  
   In that case, the menu is running the runloop in event-tracking mode and 
  pulling events for its own purpose.
 
 
 I create an NSMenu and populate it with NSMenuItem s and then set this
 menu to the NSPopUpButton.
 
 Would it make sense to use a subclass of NSMenu for this menu ... i.e.
 would I get keyDown events in this subclass?

No, because NSMenu doesn't work like a normal window/view.

I'd suggest looking around for that Xcode-alike implementation I
mentioned. Maybe someone else on the list recalls what I'm talking
about. It might involve overriding -sendEvent: in an NSApplication
subclass.

--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: Help: NSScrollView is resizing its documentView down to (0, 0)

2015-05-07 Thread Kyle Sluder
On Thu, May 7, 2015, at 10:52 AM, Jens Alfke wrote:
 
  On May 6, 2015, at 9:10 PM, Luther Baker lutherba...@gmail.com wrote:
  
  I'm probably missing something ... but fundamentally, the whole point of 
  constraints between the scrollview and its children is so that the 
  scrollview knows how big to make its contentSize. It sounds like you've got 
  this flipped ... the scrollview is not trying to constrain the size of the 
  document at all - when using autolayout, the scrollview is dynamically 
  trying to determine it's *own* contentSize.
 
 But would it use constraints for that?'

Yes, NSScrollView has supported using constraints between the document
view and the clip view to specify the contentSize since 10.8.
https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKitOlderNotes/
(section Auto Layout NSSplitView Improvements)

--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: Spinning the busy indicator

2015-05-01 Thread Kyle Sluder
On Fri, May 1, 2015, at 01:41 AM, Graham Cox wrote:
 
  On 1 May 2015, at 3:53 pm, Graham Cox graham@bigpond.com wrote:
  
  It looks as if to be sure I’m going to have to drop down a level and create 
  my own NSOperations.
 
 Well that’s an interesting result - creating my own NSOperation with a
 QoS of NSOperationQualityOfServiceBackground and adding it to my queue
 produces a perfectly smooth and non-blocking app. If I use
 -addOperationWithBlock: things are screwed up.

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

Re: UIAlertView won't set password field as first responder

2015-04-22 Thread Kyle Sluder
On Wed, Apr 22, 2015, at 01:53 PM, Rick Mann wrote:
 In my UIAlertView -didPresentAlertView: delegate call, I'm trying to
 change focus to the password field with
 
 UITextField* tf = [inView textFieldAtIndex: 1];
 [tf becomeFirstResponder];
 
 But it's being ignored.

How many times do we need to say it?

Stop. Touching. The. Alert. View. Hierarchy.

In fact, did you see Jamie's advice to use UIAlertController instead?

--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

  1   2   3   4   5   6   7   8   9   10   >