Re: Creating a software video device in modern APIs

2020-03-17 Thread Rick Mann via Cocoa-dev
I should be a little more clear. I want to take my generated video and output 
it in such a way that any other app, that can take video (and audio) input from 
a camera, can take it from my app instead. So, some kind of software video & 
audio device.

> On Mar 17, 2020, at 22:25 , Rick Mann via Cocoa-dev 
>  wrote:
> 
> I want to make something like a live video mixing/compositing app for macOS. 
> Does anyone know what I should be looking at in the wide array of video APIs 
> to do this?
> 
> Thanks.
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


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


Creating a software video device in modern APIs

2020-03-17 Thread Rick Mann via Cocoa-dev
I want to make something like a live video mixing/compositing app for macOS. 
Does anyone know what I should be looking at in the wide array of video APIs to 
do this?

Thanks.

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thoughts on Cocoa

2019-10-02 Thread Rick Mann via Cocoa-dev
You guys have had *YEARS* to get your code bases updated to more modern APIs 
and architectures. All this whining is bullshit. You've deferred and delayed 
those updates and despite constant warnings that 32-bit was being deprecated, 
you haven't updated.

As a user of some apps, I'm pissed. As a developer, I know it was on me to keep 
up.

This wasn't a surprise.

-- 
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: Why is / a metachar in regular expressions ?

2019-09-18 Thread Rick Mann via Cocoa-dev
Ah! So it is. Definitely not an error in the docs, assuming NSRegularExpression 
supports flags.

> On Sep 18, 2019, at 14:54 , Steve Mills via Cocoa-dev 
>  wrote:
> 
> On Sep 18, 2019, at 16:50:39, Rick Mann via Cocoa-dev 
>  wrote:
>> 
>> Yeah, I'm inclined to think it's an error in the docs.
> 
> If you look at the input expression in this great site, you'll see 2 /'s as 
> part of it. They mark the beginning and the end (before flags).
> 
> https://regexr.com
> 
> --
> Steve Mills
> Drummer, Mac geek
> 
> ___
> 
> 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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
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: Why is / a metachar in regular expressions ?

2019-09-18 Thread Rick Mann via Cocoa-dev
Yeah, I'm inclined to think it's an error in the docs.

> On Sep 18, 2019, at 14:43 , Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
>>> I don't see why / is a meta character.
>>> It does not appear anywhere else in the documentation as metacharacter.
>> 
>> In some languages "/" is used as the delimiter to begin/end a regular 
>> expression, for example in sed where the substitution command is 
>> "s/old/new/".
> 
> Right, good point - same in vi and vim (the editor).
> 
>> 
>> So perhaps the underlying regex parser ignores "/" characters at the 
>> start/end of the regex unless they're quoted?
> 
> Maybe, but I couldn't find any hint in the docs.
> 
> 
>> Is it used to refer to groups in text replacement? Sometimes that's a dollar 
>> sign, sometimes a slash, but I thought it was a backslash
> 
> Good point , but 
> -  IIRC, vim, at least, uses backslash for that, e.g., \1 ,\2, etc.;
> -  furthermore, NSRegularExpression does not do any text replacement by 
> itself, as far as I can see?
> 
> 
> Oh well, right now , I just don't escape any / , and it seems to work just 
> fine.
> 
> 
> Best regards, Gabriel
> 
> ___
> 
> 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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
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: Why is / a metachar in regular expressions ?

2019-09-18 Thread Rick Mann via Cocoa-dev
Is it used to refer to groups in text replacement? Sometimes that's a dollar 
sign, sometimes a slash, but I thought it was a backslash.

> On Sep 18, 2019, at 13:51 , Jens Alfke via Cocoa-dev 
>  wrote:
> 
> 
> 
>> On Sep 18, 2019, at 1:45 PM, Gabriel Zachmann via Cocoa-dev 
>>  wrote:
>> 
>> I don't see why / is a meta character.
>> It does not appear anywhere else in the documentation as metacharacter.
> 
> In some languages "/" is used as the delimiter to begin/end a regular 
> expression, for example in sed where the substitution command is "s/old/new/".
> 
> So perhaps the underlying regex parser ignores "/" characters at the 
> start/end of the regex unless they're quoted?
> 
> —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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
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: NSManagedObject.managedObjectContext is nil???

2019-03-28 Thread Rick Mann
No, it wasn't deleted. It might've been refresh to re-fault everything.

> On Mar 28, 2019, at 10:13 , Steve Christensen  wrote:
> 
> Is it possible that the entity is retained but has been deleted from the MOC? 
> I vaguely recall seeing this myself at one point in the dim past.
> 
>> On Mar 27, 2019, at 1:18 PM, Rick Mann  wrote:
>> 
>> I can't tell. I don't believe I have any unreferenced MOCs.
>> 
>>> On Mar 27, 2019, at 13:08 , Dave Fernandes  
>>> wrote:
>>> 
>>> Just to clarify, the moc exists, but the reference to it is nil? Or has the 
>>> moc, itself, been deallocated?
>>> 
>>>> On Mar 27, 2019, at 3:40 PM, Rick Mann  wrote:
>>>> 
>>>> This is proving very hard to diagnose, as it doesn't always happen. I 
>>>> tried observing -managedObjectContext, but it never gets called with a nil 
>>>> value. Moreover, my entity's -dealloc method is sometimes called even 
>>>> though none of the -awake methods gets called. This is a complex app with 
>>>> a lot of async operation, so this entity gets created and destroyed often, 
>>>> making it that much harder to figure out exactly what's going on.
>>>> 
>>>> I can bulletproof the place where the crash occurs when the moc is nil, 
>>>> but I'd really like to track down the underlying problem.
>>>> 
>>>>> On Mar 27, 2019, at 12:17 , Mike Abdullah  wrote:
>>>>> 
>>>>> Given the number of objects Core Data is designed to juggle, managing 
>>>>> that number of weak references might well affect performance. Besides, 
>>>>> wouldn’t you still the same result, that your object has a nil reference 
>>>>> to the context because the context has been deallocated?
>>>>> 
>>>>> Furthermore, I think you can also observe this affect on deleted objects 
>>>>> once the context has been saved, if you’re still holding a reference to 
>>>>> any such objects.
>>>>> 
>>>>> Mike.
>>>>> 
>>>>> Sent from my iPhone
>>>>> 
>>>>>> On 26 Mar 2019, at 21:57, Rick Mann  wrote:
>>>>>> 
>>>>>> The implication there is that an object has a weak reference to the MOC? 
>>>>>> Ah, in the header I see it's `assign`. I wonder why they do that and not 
>>>>>> `weak`.
>>>>>> 
>>>>>> Thanks, I'll look into it.
>>>>>> 
>>>>>>> On Mar 26, 2019, at 14:50 , Richard Charles  
>>>>>>> wrote:
>>>>>>> 
>>>>>>> You have retained the managed object outside the managed object context.
>>>>>>> 
>>>>>>> --Richard Charles
>>>>>>> 
>>>>>>> 
>>>>>>>> On Mar 26, 2019, at 1:04 PM, Rick Mann  wrote:
>>>>>>>> 
>>>>>>>> I'm seeing a situation where my NSManagedObject's managedObjectContext 
>>>>>>>> is nil. It doesn't happen all the time though. Any idea why? Thanks!
> 


-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSManagedObject.managedObjectContext is nil???

2019-03-27 Thread Rick Mann
I can't tell. I don't believe I have any unreferenced MOCs.

> On Mar 27, 2019, at 13:08 , Dave Fernandes  wrote:
> 
> Just to clarify, the moc exists, but the reference to it is nil? Or has the 
> moc, itself, been deallocated?
> 
>> On Mar 27, 2019, at 3:40 PM, Rick Mann  wrote:
>> 
>> This is proving very hard to diagnose, as it doesn't always happen. I tried 
>> observing -managedObjectContext, but it never gets called with a nil value. 
>> Moreover, my entity's -dealloc method is sometimes called even though none 
>> of the -awake methods gets called. This is a complex app with a lot of async 
>> operation, so this entity gets created and destroyed often, making it that 
>> much harder to figure out exactly what's going on.
>> 
>> I can bulletproof the place where the crash occurs when the moc is nil, but 
>> I'd really like to track down the underlying problem.
>> 
>>> On Mar 27, 2019, at 12:17 , Mike Abdullah  wrote:
>>> 
>>> Given the number of objects Core Data is designed to juggle, managing that 
>>> number of weak references might well affect performance. Besides, wouldn’t 
>>> you still the same result, that your object has a nil reference to the 
>>> context because the context has been deallocated?
>>> 
>>> Furthermore, I think you can also observe this affect on deleted objects 
>>> once the context has been saved, if you’re still holding a reference to any 
>>> such objects.
>>> 
>>> Mike.
>>> 
>>> Sent from my iPhone
>>> 
>>>> On 26 Mar 2019, at 21:57, Rick Mann  wrote:
>>>> 
>>>> The implication there is that an object has a weak reference to the MOC? 
>>>> Ah, in the header I see it's `assign`. I wonder why they do that and not 
>>>> `weak`.
>>>> 
>>>> Thanks, I'll look into it.
>>>> 
>>>>> On Mar 26, 2019, at 14:50 , Richard Charles  wrote:
>>>>> 
>>>>> You have retained the managed object outside the managed object context.
>>>>> 
>>>>> --Richard Charles
>>>>> 
>>>>> 
>>>>>> On Mar 26, 2019, at 1:04 PM, Rick Mann  wrote:
>>>>>> 
>>>>>> I'm seeing a situation where my NSManagedObject's managedObjectContext 
>>>>>> is nil. It doesn't happen all the time though. Any idea why? Thanks!
>>>>>> 
>>>>>> -- 
>>>>>> Rick Mann
>>>>>> rm...@latencyzero.com
>>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Rick Mann
>>>> rm...@latencyzero.com
>>>> 
>> 
>> 
>> -- 
>> Rick Mann
>> rm...@latencyzero.com
> 


-- 
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: NSManagedObject.managedObjectContext is nil???

2019-03-27 Thread Rick Mann
This is proving very hard to diagnose, as it doesn't always happen. I tried 
observing -managedObjectContext, but it never gets called with a nil value. 
Moreover, my entity's -dealloc method is sometimes called even though none of 
the -awake methods gets called. This is a complex app with a lot of async 
operation, so this entity gets created and destroyed often, making it that much 
harder to figure out exactly what's going on.

I can bulletproof the place where the crash occurs when the moc is nil, but I'd 
really like to track down the underlying problem.

> On Mar 27, 2019, at 12:17 , Mike Abdullah  wrote:
> 
> Given the number of objects Core Data is designed to juggle, managing that 
> number of weak references might well affect performance. Besides, wouldn’t 
> you still the same result, that your object has a nil reference to the 
> context because the context has been deallocated?
> 
> Furthermore, I think you can also observe this affect on deleted objects once 
> the context has been saved, if you’re still holding a reference to any such 
> objects.
> 
> Mike.
> 
> Sent from my iPhone
> 
>> On 26 Mar 2019, at 21:57, Rick Mann  wrote:
>> 
>> The implication there is that an object has a weak reference to the MOC? Ah, 
>> in the header I see it's `assign`. I wonder why they do that and not `weak`.
>> 
>> Thanks, I'll look into it.
>> 
>>> On Mar 26, 2019, at 14:50 , Richard Charles  wrote:
>>> 
>>> You have retained the managed object outside the managed object context.
>>> 
>>> --Richard Charles
>>> 
>>> 
>>>> On Mar 26, 2019, at 1:04 PM, Rick Mann  wrote:
>>>> 
>>>> I'm seeing a situation where my NSManagedObject's managedObjectContext is 
>>>> nil. It doesn't happen all the time though. Any idea why? Thanks!
>>>> 
>>>> -- 
>>>> Rick Mann
>>>> rm...@latencyzero.com
>>> 
>> 
>> 
>> -- 
>> 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/mabdullah%40karelia.com
>> 
>> This email sent to mabdul...@karelia.com


-- 
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: NSManagedObject.managedObjectContext is nil???

2019-03-26 Thread Rick Mann
The implication there is that an object has a weak reference to the MOC? Ah, in 
the header I see it's `assign`. I wonder why they do that and not `weak`.

Thanks, I'll look into it.

> On Mar 26, 2019, at 14:50 , Richard Charles  wrote:
> 
> You have retained the managed object outside the managed object context.
> 
> --Richard Charles
> 
> 
>> On Mar 26, 2019, at 1:04 PM, Rick Mann  wrote:
>> 
>> I'm seeing a situation where my NSManagedObject's managedObjectContext is 
>> nil. It doesn't happen all the time though. Any idea why? Thanks!
>> 
>> -- 
>> Rick Mann
>> rm...@latencyzero.com
> 


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


NSManagedObject.managedObjectContext is nil???

2019-03-26 Thread Rick Mann
I'm seeing a situation where my NSManagedObject's managedObjectContext is nil. 
It doesn't happen all the time though. Any idea why? Thanks!

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Definitive guide to custom modal presentation?

2018-11-12 Thread Rick Mann
I'm having a really hard time finding a definitive guide to custom modal 
presentations in iOS.

Nothing I've found online over two days of searching seems correct.

I'm using a Storyboard and want to wire a segue from a button to my view 
controller. I want it to slide up partway from an edge of the screen, but stop 
partway across (i.e. not fill the screen). In some orientations/devices, I want 
it to come up from the bottom. In others, I want it to come in from the right. 
When presented from the bottom, it should be draggable to reveal more of the 
drawer (when presented from the right, it's on iPad and always fits), so it 
needs a interruptible animation the user can scrub through.

Apple's own videos show making a UIStoryboardSegue subclass and making that the 
UIViewControllerTransitioningDelegate. It's not strictly necessary to make a 
UIPresentationController subclass, as you can still provide the 
UIViewControllerAnimatedTransitioning implementations when doing this. But I 
can't seem to get iOS to ask my custom segue for a UIPresentationController; 
the method to vend that is never called.

I also can't figure out who's responsible for adding the view to the view 
hierarchy, is it the UIPresentationController subclass or the 
UIViewControllerAnimatedTransitioning implementation? Who should respond to the 
various pan and tap gesture recognizers I'll inevitably need to install?

I appreciate any guidance. Thanks!

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSManagedObjectContext's undoManager is nil on macOS

2018-09-06 Thread Rick Mann
"although remember that both NSError** out parameters and exceptions are 
autoreleased and do not escape block lexical scope happily"

That statement needs to be linked to clarification.

> On Sep 6, 2018, at 12:56 , Jeff Nadeau  wrote:
> 
> This behavior changed in 10.12  for applications linked against that SDK or 
> later. It’s listed in the “Behavioral changes” section of the Core Data 
> release notes for that year: 
> https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html#//apple_ref/doc/uid/TP40017342-CH1-DontLinkElementID_10
>  
> <https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html#//apple_ref/doc/uid/TP40017342-CH1-DontLinkElementID_10>
> 
> There's a documentation bug to correct the information on the 
> NSManagedObjectContext class doc. I’ll give it a little bump.
> 
> Going forward, you can set the undoManager property with your own 
> NSUndoManager after you’ve initialized the context.
> 
> - Jeff
> 
>> On Sep 5, 2018, at 7:33 PM, Dave Fernandes  
>> wrote:
>> 
>> The docs say:
>> "In macOS, a context provides an undo manager by default; on iOS, the undo 
>> manager is nil by default.”
>> 
>> However, I am finding on macOS 10.13.6, the undoManager is always nil when 
>> creating a MOC. Is this new behavior expected for High Sierra, or is it a 
>> bug?
>> ___
>> 
>> 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/jnadeau%40apple.com
>> 
>> This email sent to jnad...@apple.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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
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: Why are the simplest things the hardest?

2018-07-06 Thread Rick Mann


> On Jul 5, 2018, at 01:31 , Allan Odgaard  wrote:
> 
> On 5 Jul 2018, at 6:44, Rick Mann wrote:
> 
>> Annoying I have to have a first responder view just to allow even my 
>> Document to respond to menu commands.
> 
> Quoting the 
> [documentation](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/EventArchitecture/EventArchitecture.html):
> 
> For document-based applications, the default responder chain for the main 
> window consists of the following responders and delegates:
> 
> 1. The main window’s first responder and the successive responder objects up 
> the view hierarchy
> 2. The main window itself
> 3. The window's NSWindowController object (which inherits from NSResponder)
> 4. The main window’s delegate.
> 5. The NSDocument object (if different from the main window’s delegate)
> 6. The application object, NSApp
> 7. The application object's delegate
> 8. The application's document controller (an NSDocumentController object, 
> which does not inherit from NSResponder)
> 
> As you can see, both the window’s delegate, application object’s delegate, 
> and the `NSDocument` instance itself, is part of the responder chain, which 
> is where you would implement your menu item actions.
> 
> Implementing action methods in the view hierarchy should only be used for 
> view-specific actions such as `copy:` and `paste:` (which would depend on the 
> first responder, i.e. ⌘C does different things depending on which view is the 
> first responder, but e.g. ⌘S should always go to the document’s 
> `saveDocument:` action).


If I have view commands (like fixed perspectives in a 3D view) in a menu, I 
should be able to implement those on the view controller, don't you think?

> ___
> 
> 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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
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: Why are the simplest things the hardest?

2018-07-04 Thread Rick Mann
Weird. Examining the firstResponder shows it is, in fact, my SCNView subclass. 
Yet menu actions to the first responder don't propagate up.

> On Jul 4, 2018, at 21:31 , Ken Thomases  wrote:
> 
> On Jul 4, 2018, at 10:45 PM, Rick Mann  wrote:
>> 
>> I've overridden -acceptsFirstResponder to return true on the window 
>> controller and view controllers.
> 
> That doesn't do anything.  -acceptsFirstResponder is a view method and is 
> only called on views, not controllers.
> 
>> I don't have any custom views in the window yet, just an SCNView and a 
>> slider.
> 
> I don't know if SCNView accepts first responder by default.  You may need to 
> use a subclass that overrides -acceptsFirstResponder.
> 
> A slider would only accept first responder if System Preferences > Keyboard > 
> Shortcuts > Full Keyboard Access is set to All Controls.
> 
> 
>> This begins to touch on another issue I'm not satisfied with: if I have 
>> multiple NSViewControllers (say, in a split view), and I want them all to 
>> respond to (different) menu commands, there seems to be no way to do that 
>> directly, by sending command to the first responder, right?
> 
> Correct.  That's not an appropriate case for targeting the action at the 
> first responder.  You would either target the views directly or implement the 
> action methods in a superview or its controller and have that dispatch things 
> from there.  You could implement some general scheme that searches the 
> descendant views for one which responds and send it there.  Or perhaps have 
> the descendant views register their interest in a specific action method with 
> the controller.
> 
> Regards,
> Ken
> 


-- 
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: Why are the simplest things the hardest?

2018-07-04 Thread Rick Mann



> On Jul 4, 2018, at 21:31 , Ken Thomases  wrote:
> 
> On Jul 4, 2018, at 10:45 PM, Rick Mann  wrote:
>> 
>> I've overridden -acceptsFirstResponder to return true on the window 
>> controller and view controllers.
> 
> That doesn't do anything.  -acceptsFirstResponder is a view method and is 
> only called on views, not controllers.
> 
>> I don't have any custom views in the window yet, just an SCNView and a 
>> slider.
> 
> I don't know if SCNView accepts first responder by default.  You may need to 
> use a subclass that overrides -acceptsFirstResponder.

Hmm, I tried this. It doesn't seem to make anything in my responder chain 
respond. I tried calling becomeFirstResponder() on it when the view controller 
loaded. Doesn't seem to have any effect.

Dropping an NSTextView randomly into my window did enable my responder chain.

> 
> A slider would only accept first responder if System Preferences > Keyboard > 
> Shortcuts > Full Keyboard Access is set to All Controls.
> 
> 
>> This begins to touch on another issue I'm not satisfied with: if I have 
>> multiple NSViewControllers (say, in a split view), and I want them all to 
>> respond to (different) menu commands, there seems to be no way to do that 
>> directly, by sending command to the first responder, right?
> 
> Correct.  That's not an appropriate case for targeting the action at the 
> first responder.  You would either target the views directly or implement the 
> action methods in a superview or its controller and have that dispatch things 
> from there.  You could implement some general scheme that searches the 
> descendant views for one which responds and send it there.  Or perhaps have 
> the descendant views register their interest in a specific action method with 
> the controller.
> 
> Regards,
> Ken
> 


-- 
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: Why are the simplest things the hardest?

2018-07-04 Thread Rick Mann



> On Jul 4, 2018, at 21:31 , Ken Thomases  wrote:
> 
> On Jul 4, 2018, at 10:45 PM, Rick Mann  wrote:
>> 
>> I've overridden -acceptsFirstResponder to return true on the window 
>> controller and view controllers.
> 
> That doesn't do anything.  -acceptsFirstResponder is a view method and is 
> only called on views, not controllers.

Well, it's an NSResponder var, so I assumed any of them could become first 
responder. Seems perfectly reasonable to choose the deepest appropriate 
NSResponder, even if it's not a view.

> 
>> I don't have any custom views in the window yet, just an SCNView and a 
>> slider.
> 
> I don't know if SCNView accepts first responder by default.  You may need to 
> use a subclass that overrides -acceptsFirstResponder.
> 
> A slider would only accept first responder if System Preferences > Keyboard > 
> Shortcuts > Full Keyboard Access is set to All Controls.
> 
> 
>> This begins to touch on another issue I'm not satisfied with: if I have 
>> multiple NSViewControllers (say, in a split view), and I want them all to 
>> respond to (different) menu commands, there seems to be no way to do that 
>> directly, by sending command to the first responder, right?
> 
> Correct.  That's not an appropriate case for targeting the action at the 
> first responder.  You would either target the views directly or implement the 
> action methods in a superview or its controller and have that dispatch things 
> from there.  You could implement some general scheme that searches the 
> descendant views for one which responds and send it there.  Or perhaps have 
> the descendant views register their interest in a specific action method with 
> the controller.

Okay, I'll have to do that, thanks.

Annoying I have to have a first responder view just to allow even my Document 
to respond to menu commands.

> 
> Regards,
> Ken
> 

Thanks!

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Why are the simplest things the hardest?

2018-07-04 Thread Rick Mann



> On Jul 4, 2018, at 20:40 , Ken Thomases  wrote:
> 
> On Jul 4, 2018, at 9:08 PM, Rick Mann  wrote:
>> 
>> I'm writing a new macOS app. I started with the document-based app template 
>> (no core data). I have a custom window controller, and a hierarchy of custom 
>> NSViewControllers embedded in a split view controller (I even subclassed the 
>> split view controller).
>> 
>> I have a simple IBAction method that logs a debugging message, and I try to 
>> send that action from a menu item to the first responder. I want to 
>> implement that method in one of my view controllers, but it never seems to 
>> get called. I've tried adding the method to every view controller, the 
>> window controller, and the app delegate, but it never gets called. However, 
>> if I connect the menu item to the app delegate, it gets called.
>> 
>> What am I doing wrong?
> 
> Is one of your views actually the first responder?  Does the window have key 
> or main status?  By default, it wouldn't be able to become key or main if it 
> doesn't have a title bar and isn't resizable.  Is there a view that accepts 
> first responder (has overridden -acceptsFirstResponder to return YES)?  (Of 
> course, certain standard controls like NSTextField accept first responder 
> without you having to subclass them.)

I've overridden -acceptsFirstResponder to return true on the window controller 
and view controllers. I don't have any custom views in the window yet, just an 
SCNView and a slider.

This begins to touch on another issue I'm not satisfied with: if I have 
multiple NSViewControllers (say, in a split view), and I want them all to 
respond to (different) menu commands, there seems to be no way to do that 
directly, by sending command to the first responder, right?

> 
> I assume you're running macOS 10.10 or newer.  If not, you would have to take 
> special steps to include those controllers in the responder.

Yes, 10.13.5

> 
> Regards,
> Ken
> 


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


Why are the simplest things the hardest?

2018-07-04 Thread Rick Mann
I'm writing a new macOS app. I started with the document-based app template (no 
core data). I have a custom window controller, and a hierarchy of custom 
NSViewControllers embedded in a split view controller (I even subclassed the 
split view controller).

I have a simple IBAction method that logs a debugging message, and I try to 
send that action from a menu item to the first responder. I want to implement 
that method in one of my view controllers, but it never seems to get called. 
I've tried adding the method to every view controller, the window controller, 
and the app delegate, but it never gets called. However, if I connect the menu 
item to the app delegate, it gets called.

What am I doing wrong?

Thanks.

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


How to make my NSViewControllers participate in responder chain?

2018-06-30 Thread Rick Mann
I have a complex view hierarchy with a lot of controllers. I'd like to provide 
menu commands that the various controllers can respond to, but I have a couple 
of problems:

1) I can't seem to get any of my view controllers (even the window's root view 
controller) to participate, even if I override acceptsFirstResponder to return 
true.
2) What happens when I have sibling view controllers (e.g. in a split view 
controller)? I'd like all of them to participate, if they can.

I can, of course, push all that stuff up to the root view controller, but that 
makes me do things like subclass NSSplitViewController.

The whole thing seems cumbersome, at best. What am I missing?

Thanks,

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Scrolling differences when using Trackpad or Mouse-Wheel

2018-06-23 Thread Rick Mann



> On Jun 23, 2018, at 08:55 , Richard Charles  wrote:
> 
> 
>> On Jun 19, 2018, at 3:56 AM, Michael Starke 
>>  wrote:
>> 
>> I'm currently trying to find the bottleneck in my app MacPass that's causing 
>> the scrolling in the main table to be sluggish.
>> 
>> Before diving deeply into Instruments to find the culprit I realized that 
>> scrolling with the trackpad is butter-smooth but scrolling using the mouse 
>> wheel is rather slow. When I start to scroll down, there's a slight delay 
>> but then the scrolling works smooth. This is not the case when scrolling up 
>> or when scrolling using the trackpad.
> 
> 
> I downloaded MacPass 0.7.3 and created a new document with 200 entries in 
> what I believe to be the MPTableView. I tried scrolling with a Logitech M510 
> mouse wheel using the standard apple driver (no custom driver installed). I 
> also tried scrolling with track pad on a MacBook Air.
> 
> Normally a mouse wheel with detents will have acceleration when scrolling but 
> no momentum. Normally trackpad will have momentum when scrolling. This 
> behavior can be seen when scrolling in TextEdit, Contacts, and Mail.
> 
> When scrolling in MacPass with a mouse wheel the initial delay I believe is 
> due to acceleration which appears to be normal. However when mouse wheel 
> movement has stopped scrolling still persists for a short period of time 
> almost appearing to be momentum. This is not normal. A mouse wheel has no 
> momentum if it has detents. So this is a puzzle.

Unrelated, but I felt compelled to rant: I hate websites that try to implement 
their own momentum scrolling. With the Apple Mighty Mouse (still the best mouse 
they made, despite its flaws), those websites continue to scroll a bit after 
I've stopped moving the ball (which should stop the scroll dead in its tracks). 
This is not a mouse or driver problem, it's a misinterpretation of low-level 
events by badly-designed Javascript.


-- 
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: Implementing an import command in NSDocument-based app

2018-05-16 Thread Rick Mann
Thank you, that's all good advice.


> On May 16, 2018, at 00:26 , Rick Mann <rm...@latencyzero.com> wrote:
> 
> I'm working on a little NSDocument-based app. The documents are packages (a 
> directory containing multiple files). One of the operations is to import a 
> music file into the document, which should copy the music file into the 
> package, and set it as the track for the document.
> 
> Undoing this operation is somewhat complex (where do I store the previous 
> track if any?). So for now, I want to ignore undo.
> 
> But I'm not sure how to copy the track file into the package. For example, 
> what if it's an untitled document, and therefore has no package on disk? The 
> action should result in a dirty document that isn't committed to disk until 
> the next save (be it automatic or manual).
> 
> Can this even be done without undo?
> 
> Along those lines, how do I mark a document as dirty after some change, 
> without making the change undoable?
> 
> Thanks,
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


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


Implementing an import command in NSDocument-based app

2018-05-16 Thread Rick Mann
I'm working on a little NSDocument-based app. The documents are packages (a 
directory containing multiple files). One of the operations is to import a 
music file into the document, which should copy the music file into the 
package, and set it as the track for the document.

Undoing this operation is somewhat complex (where do I store the previous track 
if any?). So for now, I want to ignore undo.

But I'm not sure how to copy the track file into the package. For example, what 
if it's an untitled document, and therefore has no package on disk? The action 
should result in a dirty document that isn't committed to disk until the next 
save (be it automatic or manual).

Can this even be done without undo?

Along those lines, how do I mark a document as dirty after some change, without 
making the change undoable?

Thanks,

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


IKScannerDeviceView not working

2017-12-21 Thread Rick Mann
Does anyone have IKScannerDeviceView working? It "works," in that I can set up 
the view, press the scan button, and get a scan to occur, but after that, I 
can't get a result sent to my delegate. It doesn't call back any error delegate 
method, but it does report some errors in the log, and when it calls 
scannerDeviceView(_ scannerDeviceView: IKScannerDeviceView!, didScanTo url: 
URL!, fileData data: Data!, error: Error!), it provides a nil url, and an empty 
data.

There's a dearth of examples online, so any help would be appreciated.

Thanks!

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Loading very large image files (>10GB)

2017-12-05 Thread Rick Mann
Thanks. I was wondering if a technique like that would work (to read the image 
in horizontal bands to create a lower-res version). I guess so.

> On Dec 5, 2017, at 12:28 , Jean-Daniel <mail...@xenonium.com> wrote:
> 
> UIImage is optimized to read pixel from disk at draw time and can be used to 
> downsample a large image progressively ( 
> https://developer.apple.com/library/content/samplecode/LargeImageDownsizing/Introduction/Intro.html
>  )
> 
> I guess NSImage can do something similar. If not, this can probably be done 
> using CGImageSource API.
> 
>> Le 4 déc. 2017 à 03:06, Rick Mann <rm...@latencyzero.com> a écrit :
>> 
>> Is there support in NSImage[View]/Core Image for loading and displaying very 
>> large images (TIFF files larger than 10 GB)? I'm having trouble googling for 
>> an answer.
>> 
>> -- 
>> 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/mailing%40xenonium.com
>> 
>> This email sent to mail...@xenonium.com
> 


-- 
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: NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann


> On Dec 4, 2017, at 16:14 , Greg Parker <gpar...@apple.com> wrote:
> 
> 
>> On Dec 4, 2017, at 3:22 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Ugh...been doing too much Swift (j/k). The right answer to this question is:
>> 
>> @(kSomeCStringConstant)
>> 
>> This works whether it's a #define or a static const char* const.
> 
> The downsides are:
> 1. If the library requires that you use the actual address stored in string 
> variable kSomeCStringConstant then it may fail because 
> @(kSomeCStringConstant) may create a second object at a different address.
> 2. The compiler is not currently smart enough to optimize 
> @(kSomeCStringConstant) into a constant string object, so it may allocate a 
> new autoreleased string object every time it runs that line.

Yeah, I figured as much. In this case, that's okay. I was just trying to 
declutter the call site. Thanks!

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann
Ugh...been doing too much Swift (j/k). The right answer to this question is:

@(kSomeCStringConstant)

This works whether it's a #define or a static const char* const.


> On Dec 4, 2017, at 15:00 , Greg Parker <gpar...@apple.com> wrote:
> 
> 
>> On Dec 4, 2017, at 2:56 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>>> On Dec 4, 2017, at 14:55 , Greg Parker <gpar...@apple.com> wrote:
>>> 
>>>> On Dec 4, 2017, at 2:51 PM, Ben Kennedy <b...@zygoat.ca> wrote:
>>>> 
>>>>> On Dec 4, 2017, at 2:47 PM, Rick Mann <rm...@latencyzero.com> wrote:
>>>>> 
>>>>> #define NSSTR(s)  (@ ## s) <-- magic; this 
>>>>> doesn't work
>>>>> #define kSomeCStringConstant  "foo"
>>>>> ...
>>>>> NSSTR(kSomeCStringConstant)
>>>> 
>>>> You're close. The preprocessor is removing the quotation marks, breaking 
>>>> the syntax. You don't need to token paste; simply remove the '##' from the 
>>>> NSSTR() def.
>>>> 
>>>> #define NSSTR(s) (@ s)
>>> 
>>> You can also skip the middleman and use `@kSomeCStringConstant`. After the 
>>> preprocessor runs it will be `@"foo"` which the ObjC compiler is perfectly 
>>> happy with.
>> 
>> Tried that, too. Same error:
>> 
>> MCP.m:262:54: Unexpected '@' in program
> 
> What compiler version are you using? 
> Is this file compiled as Objective-C? 
> Is the #define spelled differently than you wrote? 
> Does anything look wrong with that line in the output of Product > Perform 
> Action > Preprocess ?
> 
> 
> -- 
> Greg Parker gpar...@apple.com Runtime Wrangler
> 
> 


-- 
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: NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann
Ah, nvm, user error. I'm an idiot. It's not a #defined string. It's:

static const char* const kSomeCStringConstant  = "foo";


> On Dec 4, 2017, at 14:56 , Ben Kennedy <b...@zygoat.ca> wrote:
> 
> On Dec 4, 2017, at 2:53 PM, Rick Mann <rm...@latencyzero.com> wrote:
> 
>> I tried that. It doesn't work.
>> 
>> MCP.m:262:54: Unexpected '@' in program
> 
> Weird. I just tried it here, using your exact example, and it worked fine 
> under Xcode 9.2. (I slapped it into my iOS app's 
> application:didFinishLaunchingWithOptions: as a quick and dirty test.)
> 
> #define NSSTR(s)(@ s)
> #define kSomeCStringConstant"foo"
> NSLog(@"foo is %@", NSSTR(kSomeCStringConstant));
> 
> Do you have some unusual circumstances in your build environment?
> 
> b
> 


-- 
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: NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann


> On Dec 4, 2017, at 14:55 , Greg Parker <gpar...@apple.com> wrote:
> 
> 
>> On Dec 4, 2017, at 2:51 PM, Ben Kennedy <b...@zygoat.ca> wrote:
>> 
>>> On Dec 4, 2017, at 2:47 PM, Rick Mann <rm...@latencyzero.com> wrote:
>>> 
>>> #define NSSTR(s)(@ ## s) <-- magic; this 
>>> doesn't work
>>> #define kSomeCStringConstant"foo"
>>> ...
>>> NSSTR(kSomeCStringConstant)
>> 
>> You're close. The preprocessor is removing the quotation marks, breaking the 
>> syntax. You don't need to token paste; simply remove the '##' from the 
>> NSSTR() def.
>> 
>> #define NSSTR(s) (@ s)
> 
> You can also skip the middleman and use `@kSomeCStringConstant`. After the 
> preprocessor runs it will be `@"foo"` which the ObjC compiler is perfectly 
> happy with.

Tried that, too. Same error:

MCP.m:262:54: Unexpected '@' in program

> 
> 
> -- 
> Greg Parker gpar...@apple.com Runtime Wrangler
> 
> 


-- 
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: NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann
I tried that. It doesn't work.

MCP.m:262:54: Unexpected '@' in program

> On Dec 4, 2017, at 14:51 , Ben Kennedy <b...@zygoat.ca> wrote:
> 
>> On Dec 4, 2017, at 2:47 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> #define NSSTR(s) (@ ## s) <-- magic; this 
>> doesn't work
>> #define kSomeCStringConstant "foo"
>> ...
>> NSSTR(kSomeCStringConstant)
> 
> You're close. The preprocessor is removing the quotation marks, breaking the 
> syntax. You don't need to token paste; simply remove the '##' from the 
> NSSTR() def.
> 
> #define NSSTR(s) (@ s)
> 
> -b
> 


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


NSString equivalent of CFSTR macro?

2017-12-04 Thread Rick Mann
I have to use some C header file that #defines some string constants. Is there 
an equivalent to CFSTR() that constructs NSString literals? E.g.,


#define NSSTR(s)(@ ## s) <-- magic; this 
doesn't work
#define kSomeCStringConstant"foo"
...
NSSTR(kSomeCStringConstant)

TIA,

-- 
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: Stopping on a system call and determining open files?

2017-12-04 Thread Rick Mann
It dawned on me that it was probably getting bad data from the network. My 
friend (who works on iTunes servers) fixed it on the server side, and that's 
why the problem went away (although hopefully they update the client code to be 
more robust. I bet if this were written in Swift, this particular error 
wouldn't have happened).


> On Dec 3, 2017, at 19:41 , Richard Charles <rcharles...@gmail.com> wrote:
> 
> 
>> On Dec 3, 2017, at 8:16 PM, Jerome Krinock <je...@ieee.org> wrote:
>> 
>>> On 2017 Dec 1, at 21:54, Rick Mann <rm...@latencyzero.com> wrote:
>>> 
>>> Certificate Key (CK)
>> 
>> The stack trace in your first post indicates that CK is more likely 
>> CommerceKit.  For example:
>> 
>>> On 2017 Dec 1, at 21:15, Rick Mann <rm...@latencyzero.com> wrote:
>>> 
>>> 5   CommerceKit  0x7fff5a62d858 -[CKStoreDAAPLibrary 
>>> _writePersistedStore] + 402
> 
> 
> CommerceKit trying to write out some sort of iTunes Digital Audio Access 
> Protocol (DAAP) file.
> 
> --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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
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: Stopping on a system call and determining open files?

2017-12-03 Thread Rick Mann
Thanks. A buddy of mine who works on iTunes says he found and fixed the 
problem, although it seemed to magically clear up overnight for me, anyway…

> On Dec 3, 2017, at 19:41 , Richard Charles <rcharles...@gmail.com> wrote:
> 
> 
>> On Dec 3, 2017, at 8:16 PM, Jerome Krinock <je...@ieee.org> wrote:
>> 
>>> On 2017 Dec 1, at 21:54, Rick Mann <rm...@latencyzero.com> wrote:
>>> 
>>> Certificate Key (CK)
>> 
>> The stack trace in your first post indicates that CK is more likely 
>> CommerceKit.  For example:
>> 
>>> On 2017 Dec 1, at 21:15, Rick Mann <rm...@latencyzero.com> wrote:
>>> 
>>> 5   CommerceKit  0x7fff5a62d858 -[CKStoreDAAPLibrary 
>>> _writePersistedStore] + 402
> 
> 
> CommerceKit trying to write out some sort of iTunes Digital Audio Access 
> Protocol (DAAP) file.
> 
> --Richard Charles
> 


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


Loading very large image files (>10GB)

2017-12-03 Thread Rick Mann
Is there support in NSImage[View]/Core Image for loading and displaying very 
large images (TIFF files larger than 10 GB)? I'm having trouble googling for an 
answer.

-- 
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: Stopping on a system call and determining open files?

2017-12-01 Thread Rick Mann


> On Dec 1, 2017, at 21:44 , Richard Charles <rcharles...@gmail.com> wrote:
> 
> 
>> On Dec 1, 2017, at 10:15 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Suddenly Spotlight and Safari are crashing all the time on my Mac. Both 
>> crash in the same library method (-[CKStoreDAAPLibrary 
>> _writePersistedStore]) trying to insert nil into some Obj-C collection. That 
>> makes me think there's a file on my drive that's corrupted, and if I can 
>> delete it, I might be able to restore sanity.
> 
> Perhaps this has something to do with an Apple DAAP library associated with 
> iTunes.
> 
> https://en.wikipedia.org/wiki/Digital_Audio_Access_Protocol

Upon further examination, I think you might be right. DAAP in this case is 
referring to audio.

-- 
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: Stopping on a system call and determining open files?

2017-12-01 Thread Rick Mann
It’s possible. I thought it was something security related. Certificate Key 
(CK) and DAAP is a type in the Apple security APIs. 

-- 
Rick Mann
rm...@latencyzero.com

> On Dec 1, 2017, at 21:44, Richard Charles <rcharles...@gmail.com> wrote:
> 
> 
>> On Dec 1, 2017, at 10:15 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Suddenly Spotlight and Safari are crashing all the time on my Mac. Both 
>> crash in the same library method (-[CKStoreDAAPLibrary 
>> _writePersistedStore]) trying to insert nil into some Obj-C collection. That 
>> makes me think there's a file on my drive that's corrupted, and if I can 
>> delete it, I might be able to restore sanity.
> 
> Perhaps this has something to do with an Apple DAAP library associated with 
> iTunes.
> 
> https://en.wikipedia.org/wiki/Digital_Audio_Access_Protocol
> 
> --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


Stopping on a system call and determining open files?

2017-12-01 Thread Rick Mann
Suddenly Spotlight and Safari are crashing all the time on my Mac. Both crash 
in the same library method (-[CKStoreDAAPLibrary _writePersistedStore]) trying 
to insert nil into some Obj-C collection. That makes me think there's a file on 
my drive that's corrupted, and if I can delete it, I might be able to restore 
sanity.

It occurs to me there's probably a way to stop execution on the call of that 
method, and see what files are open by that process (Spotlight or Safari), but 
I'm not very well-versed in using the debugger outside of Xcode and my own 
projects.

Can anyone here suggest a course of action?

FWIW, here's the stack trace that's crashing:

Process:   Spotlight [1338]
Path:  
/System/Library/CoreServices/Spotlight.app/Contents/MacOS/Spotlight
Identifier:com.apple.Spotlight
Version:   1.0 (1191.1)
Build Info:SpotlightUI-11910010~1
Code Type: X86-64 (Native)
Parent Process:??? [1]
Responsible:   Spotlight [1338]
User ID:   501

Date/Time: 2017-12-01 20:57:46.075 -0800
OS Version:Mac OS X 10.13.1 (17B1003)
Report Version:12
Bridge OS Version: 3.0 (14Y661)
Anonymous UUID:1DA543BA-84A4-BF63-1D1F-35503B90A432


Time Awake Since Boot: 6200 seconds

System Integrity Protection: enabled

Crashed Thread:4  Dispatch queue: com.apple.root.default-qos

Exception Type:EXC_CRASH (SIGABRT)
Exception Codes:   0x, 0x
Exception Note:EXC_CORPSE_NOTIFY

Application Specific Information:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: 
attempt to insert nil object from objects[1]'
terminating with uncaught exception of type NSException
abort() called

Application Specific Backtrace 1:
0   CoreFoundation  0x7fff487ef2fb 
__exceptionPreprocess + 171
1   libobjc.A.dylib 0x7fff6f160c76 objc_exception_throw 
+ 48
2   CoreFoundation  0x7fff488307b4 
_CFThrowFormattedException + 202
3   CoreFoundation  0x7fff486f27c2 
-[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 322
4   CoreFoundation  0x7fff486f264b +[NSDictionary 
dictionaryWithObjects:forKeys:count:] + 59
5   CommerceKit 0x7fff5a62d858 -[CKStoreDAAPLibrary 
_writePersistedStore] + 402
6   CommerceKit 0x7fff5a62fc45 -[CKStoreDAAPLibrary 
_updatedItems:deletedItems:withLatestVersion:] + 988
7   CommerceKit 0x7fff5a62f734 
__66-[CKStoreDAAPLibrary 
_pollDAAPServerWithReason:completionHandler:]_block_invoke_3 + 273
8   CommerceKit 0x7fff5a630f47 
__94-[CKStoreDAAPLibrary 
_performDAAPRequestWithAction:body:contentType:reason:completionHandler:]_block_invoke_2
 + 520
9   libdispatch.dylib   0x7fff6fd1d6cd 
_dispatch_call_block_and_release + 12
10  libdispatch.dylib   0x7fff6fd15e88 
_dispatch_client_callout + 8
11  libdispatch.dylib   0x7fff6fd22da5 
_dispatch_queue_override_invoke + 880
12  libdispatch.dylib   0x7fff6fd17a7a 
_dispatch_root_queue_drain + 515
13  libdispatch.dylib   0x7fff6fd17826 
_dispatch_worker_thread3 + 101
14  libsystem_pthread.dylib 0x7fff6ffd91ca _pthread_wqthread + 
1387
15  libsystem_pthread.dylib 0x7fff6ffd8c4d start_wqthread + 13
.
.
.

Thanks!


-- 
Rick Mann
rm...@latencyzero.com





-- 
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: Avoiding color transformations in PNG/UIImage/CGImage ops?

2017-11-17 Thread Rick Mann


> On Nov 17, 2017, at 14:03 , Vince DeMarco <dema...@apple.com> wrote:
> 
> 
> 
>> On Nov 17, 2017, at 1:45 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> 
>> 
>>> On Nov 17, 2017, at 13:36 , Vince DeMarco <dema...@apple.com> wrote:
>>> 
>>> 
>>> 
>>>> On Nov 17, 2017, at 1:28 PM, Rick Mann <rm...@latencyzero.com> wrote:
>>>> 
>>>> Nope, I'm definitely looking at pixel data. But I'll try the generic color 
>>>> space. I don't know how it chooses device color space when it's created 
>>>> absent any particular display-associated context.
>>> 
>>> Don't use the generic color space use sRGB for both. 
>>> 
>>> Like this instead
>>> 
>>>colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);
>> 
>> Thanks. Can you elaborate as to why?
> 
> 
> All of the devices now default to sRGB, the Asset catalogs when presented 
> with an color png file will convert them to sRGB (extended range srgb for 
> Deep color images).
> 
> the jpeg reader in the system (ImageIO) if it finds a image with no color 
> space will assume sRGB.
> 
> Always best to be explicit in what you want.

Thanks!


-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Avoiding color transformations in PNG/UIImage/CGImage ops?

2017-11-17 Thread Rick Mann


> On Nov 17, 2017, at 13:36 , Vince DeMarco <dema...@apple.com> wrote:
> 
> 
> 
>> On Nov 17, 2017, at 1:28 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Nope, I'm definitely looking at pixel data. But I'll try the generic color 
>> space. I don't know how it chooses device color space when it's created 
>> absent any particular display-associated context.
> 
> Don't use the generic color space use sRGB for both. 
> 
> Like this instead
> 
> colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB);

Thanks. Can you elaborate as to why?



-- 
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: Avoiding color transformations in PNG/UIImage/CGImage ops?

2017-11-17 Thread Rick Mann
Nope, I'm definitely looking at pixel data. But I'll try the generic color 
space. I don't know how it chooses device color space when it's created absent 
any particular display-associated context.


> On Nov 17, 2017, at 06:54 , Steve Christensen <puns...@mac.com> wrote:
> 
> It sounds like you're looking at image file data rather than buffers of pixel 
> data. If so then I wouldn't make the assumption that the encoded bytes in two 
> PNG files will be identical for identical images. Depending on how flexible 
> the file format is, then particular parts of the encoded image could be 
> written to different locations in the two files. It seems more reasonable to 
> draw the images to compare into CGBitmapContexts configured identically and 
> them compare the active portions (i.e., width * bytesPerPixel <= bytesPerRow) 
> of the bitmap buffers.
> 
> As for color space to use, Apple recommends "that you use calibrated (or 
> generic) color spaces instead of device color spaces. The colors in device 
> color spaces can vary widely from device to device, whereas calibrated color 
> spaces usually result in a reasonably accurate color." 
> (https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/DrawColor/Tasks/UsingColorSpaces.html)
> 
> Steve
> 
> 
>> On Nov 16, 2017, at 6:31 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> I'm trying to write a unit test for some code I wrote that generates one 
>> image from another. In the main app, the source data comes from Open CV as a 
>> buffer of 3 byte-per-pixel elements. My code generates a CGImage. In the 
>> unit test, I load a saved version of one of those images from a PNG file to 
>> UIImage, get at the buffer, pass it to my code, and then compare the result 
>> to a saved version of that same output.
>> 
>> The saved version is a PNG. I load that, and then get the data buffer using
>> 
>>let fiData = fi.dataProvider?.data as Data?
>> 
>> I do a similar thing with the generated CGImage. Then I compare the two 
>> buffers, byte by byte. They are similar, but contain differences (sometimes 
>> more than I would expect). But if I save both as PNG and look at them in 
>> Preview they look identical.
>> 
>> My guess is something's happening somewhere with color correction. In my 
>> code, I make a CG(bitmap)Context, specifying device RGB color space (should 
>> that be generic?). I don't really know what happens to the PNGs I save and 
>> load.
>> 
>> Is there a way to ensure the bytes in the buffer are compressed and 
>> decompressed exactly as written?
> 


-- 
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: Avoiding color transformations in PNG/UIImage/CGImage ops?

2017-11-16 Thread Rick Mann
Do you literally mean moving the iOS simulator window to a different monitor, 
even though there’s never a display context in any of this code?

-- 
Rick Mann
rm...@latencyzero.com

> On Nov 16, 2017, at 19:55, Alex Zavatone <z...@mac.com> wrote:
> 
> I was basing my assumption on this line of your email:
> 
>>>> In the unit test, I load a saved version of one of those images from a PNG 
>>>> file to UIImage, get at the buffer, pass it to my code, and then compare 
>>>> the result to a saved version of that same output.
> 
> In that, I was assuming that the image from the CGImage that you mention is 
> similar should be the same.  
> 
> My guess here is that the PNG that you saved has a colorspace applied to it.  
> But it seems odd that the bytes are different unless the image is run through 
> a transform with CI.  I wouldn’t expect one either.  
> 
> About 3 years ago when I was looking into similar things, I came across a 
> nice explanation of the CI pipeline, in the Apple Docs that did a good job 
> explaining what happens where and when.  Even in the display of image items 
> that are saved/loaded to/from disk.  
> 
> Everything came down to not accommodating the color profile or something 
> related to that.  
> 
> I even got different results when testing on 2 monitors.  
> 
> An easy way to rule out my hypothesis would be to check the results on two 
> different displays with different color calibration and see if that has some 
> effect or no effect at all.
> 
> 
> A quick walk through the CI pipeline docs will probably trigger something 
> that will answer your question.
> 
> I’ll see it I can find the ones that were useful to me for you.
> 
> 
> 
> 
> 
> 
>> On Nov 16, 2017, at 9:29 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> OpenCV is not relevant in this case, that was just background that I 
>> probably didn't need to include.
>> 
>> I'm generating an image buffer, saving it as PNG through UIImage, then 
>> generating it again, and comparing it to the UIImage bytes I get by opening 
>> the previously-saved image. I'm not specifying anything other than device 
>> RGB color space when I create the CGBitmapContext I use to generate the 
>> image buffer.
>> 
>>> On Nov 16, 2017, at 19:27 , Alex Zavatone <z...@mac.com> wrote:
>>> 
>>> Before looking into OCV, my wild guess is that it may have to do with the 
>>> colorspace of the image.  What are you setting it to? Profile Name: sRGB 
>>> IEC61966-2.1?
>>> 
>>> 
>>>> On Nov 16, 2017, at 8:31 PM, Rick Mann <rm...@latencyzero.com> wrote:
>>>> 
>>>> I'm trying to write a unit test for some code I wrote that generates one 
>>>> image from another. In the main app, the source data comes from Open CV as 
>>>> a buffer of 3 byte-per-pixel elements. My code generates a CGImage. In the 
>>>> unit test, I load a saved version of one of those images from a PNG file 
>>>> to UIImage, get at the buffer, pass it to my code, and then compare the 
>>>> result to a saved version of that same output.
>>>> 
>>>> The saved version is a PNG. I load that, and then get the data buffer using
>>>> 
>>>> let fiData = fi.dataProvider?.data as Data?
>>>> 
>>>> I do a similar thing with the generated CGImage. Then I compare the two 
>>>> buffers, byte by byte. They are similar, but contain differences 
>>>> (sometimes more than I would expect). But if I save both as PNG and look 
>>>> at them in Preview they look identical.
>>>> 
>>>> My guess is something's happening somewhere with color correction. In my 
>>>> code, I make a CG(bitmap)Context, specifying device RGB color space 
>>>> (should that be generic?). I don't really know what happens to the PNGs I 
>>>> save and load.
>>>> 
>>>> Is there a way to ensure the bytes in the buffer are compressed and 
>>>> decompressed exactly as written?
>>>> 
>>>> -- 
>>>> 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/zav%40mac.com
>>>> 
>>>> This email sent to z...@mac.com
>>> 
>> 
>> 
>> -- 
>> 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: Avoiding color transformations in PNG/UIImage/CGImage ops?

2017-11-16 Thread Rick Mann
OpenCV is not relevant in this case, that was just background that I probably 
didn't need to include.

I'm generating an image buffer, saving it as PNG through UIImage, then 
generating it again, and comparing it to the UIImage bytes I get by opening the 
previously-saved image. I'm not specifying anything other than device RGB color 
space when I create the CGBitmapContext I use to generate the image buffer.

> On Nov 16, 2017, at 19:27 , Alex Zavatone <z...@mac.com> wrote:
> 
> Before looking into OCV, my wild guess is that it may have to do with the 
> colorspace of the image.  What are you setting it to? Profile Name: sRGB 
> IEC61966-2.1?
> 
> 
>> On Nov 16, 2017, at 8:31 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> I'm trying to write a unit test for some code I wrote that generates one 
>> image from another. In the main app, the source data comes from Open CV as a 
>> buffer of 3 byte-per-pixel elements. My code generates a CGImage. In the 
>> unit test, I load a saved version of one of those images from a PNG file to 
>> UIImage, get at the buffer, pass it to my code, and then compare the result 
>> to a saved version of that same output.
>> 
>> The saved version is a PNG. I load that, and then get the data buffer using
>> 
>>   let fiData = fi.dataProvider?.data as Data?
>> 
>> I do a similar thing with the generated CGImage. Then I compare the two 
>> buffers, byte by byte. They are similar, but contain differences (sometimes 
>> more than I would expect). But if I save both as PNG and look at them in 
>> Preview they look identical.
>> 
>> My guess is something's happening somewhere with color correction. In my 
>> code, I make a CG(bitmap)Context, specifying device RGB color space (should 
>> that be generic?). I don't really know what happens to the PNGs I save and 
>> load.
>> 
>> Is there a way to ensure the bytes in the buffer are compressed and 
>> decompressed exactly as written?
>> 
>> -- 
>> 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/zav%40mac.com
>> 
>> This email sent to z...@mac.com
> 


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


Avoiding color transformations in PNG/UIImage/CGImage ops?

2017-11-16 Thread Rick Mann
I'm trying to write a unit test for some code I wrote that generates one image 
from another. In the main app, the source data comes from Open CV as a buffer 
of 3 byte-per-pixel elements. My code generates a CGImage. In the unit test, I 
load a saved version of one of those images from a PNG file to UIImage, get at 
the buffer, pass it to my code, and then compare the result to a saved version 
of that same output.

The saved version is a PNG. I load that, and then get the data buffer using

let fiData = fi.dataProvider?.data as Data?

I do a similar thing with the generated CGImage. Then I compare the two 
buffers, byte by byte. They are similar, but contain differences (sometimes 
more than I would expect). But if I save both as PNG and look at them in 
Preview they look identical.

My guess is something's happening somewhere with color correction. In my code, 
I make a CG(bitmap)Context, specifying device RGB color space (should that be 
generic?). I don't really know what happens to the PNGs I save and load.

Is there a way to ensure the bytes in the buffer are compressed and 
decompressed exactly as written?

-- 
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: [swift-users] Making a copy of an UnsafePointer

2017-11-15 Thread Rick Mann
Ah, never mind. I was indexing well past the end of the buffer. D'oh.

> On Nov 15, 2017, at 00:48 , Quinn The Eskimo! via swift-users 
> <swift-us...@swift.org> wrote:
> 
> 
> On 15 Nov 2017, at 04:16, Rick Mann via swift-users <swift-us...@swift.org> 
> wrote:
> 
>> Is UnsafeMutablePointer<> not memory managed?
> 
> It is not.  Specifically, the code you posted creates a copy of the data and 
> then never destroys it.
> 
> If I were in your shoes I’d construct a `Data` value from the unsafe pointer 
> and then pass that around.
> 
> let source = Data(bytes: inSourceBuffer, count: inSourceBufferLength)
> self.queue.async {
>let size = source.count
>source.withUnsafeBytes { (p: UnsafePointer) in
>self.foo(data: p, length: size)
>}
> }
> 
> The main drawback to this is that you have to jump through the hoops to 
> access the data unsafely.  It might be easier to recast your consumer (the 
> `foo(…)` method) in terms of `Data`.  That’s what I generally do when I work 
> with foreign APIs like this, that is, keep the data in ‘Swift space’ and only 
> deal with foreign types at the boundaries.
> 
> Whether that makes sense here really depends on the specifics of your 
> program.  For example, if your program has lots of this boundary code, it 
> might be nicer to just stick with the foreign type.  Or build a specific 
> wrapper that makes it easier to do this conversion.
> 
> Share and Enjoy
> --
> Quinn "The Eskimo!"<http://www.apple.com/developer/>
> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
> 
> 
> ___
> swift-users mailing list
> swift-us...@swift.org
> https://lists.swift.org/mailman/listinfo/swift-users


-- 
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: Getting immutable UIImage data pointer without copy?

2017-11-14 Thread Rick Mann


> On Nov 14, 2017, at 20:18 , Jens Alfke <j...@mooseyard.com> wrote:
> 
> 
> 
>> On Nov 14, 2017, at 8:11 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Maybe, at least for the bonus question. The bigger question is around the 
>> copy.
> 
> Where pixmaps live is a pretty complex issue — ideally they live in the GPU’s 
> address space as textures so they can be blitted efficiently, and that’s 
> often (depending on your hardware) not accessible to the CPU at all. But 
> there’s a lot of logic in CoreGraphics and the underlying graphics engines to 
> shuffle the pixmaps back and forth so software can read and write them.
> 
> Another factor is that the pixmap may be rescaled or translated into 
> different color spaces to optimize rendering it. So there may not exist a 
> default rendering of it at the time you request one, meaning CG will generate 
> a new pixmap for you. (Also, I dunno about UIImage, but NSImage supports 
> image formats like PDF that don’t have a native pixmap representation at all.)
> 
> I’m not super into graphics, but my gut feeling is that, if you care about 
> optimization details like whether pixmaps are being copied, you should really 
> be using a lower-level graphics API than UIImage, which is mostly a 
> cheap-and-cheerful convenience layer for apps that just need to splat a few 
> PNGs into their GUI.

Well, then let me rephrase it as "unnecessary copies." In this case, I 
(currently) need to manipulate the pixels to generate a new image. I will be 
moving this to a Metal 2 filter soon enough, but for pre-iOS 11 users, I'd 
still like to use as little memory as possible (we use a lot of memory in our 
app).


-- 
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: Getting immutable UIImage data pointer without copy?

2017-11-14 Thread Rick Mann


> On Nov 14, 2017, at 20:07 , Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On Nov 14, 2017, at 18:36 , Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Is there a way to get at the underlying raw image data for a given UIImage 
>> (in an immutable buffer) in Swift?
>> 
>> Does this end up making copies? (For bonus points, what's the array magic?)
>> 
>> let img: UIImage = UIImage(named: "MyImage")
>> let data: CFData? = img.CGImage.dataProvider.data
>> let dataArray: [UInt8] = 
> 
> There are some simple answers, but the correct answer is “it depends”. For 
> example, you can do this:
> 
>> var data = Data ([1,2,3,4])
>> print (data [3])
> 
> In other words, seeing a Data instance as an array of bytes is simple. Or, if 
> you want to do something more like the old days in Obj-C, you can do this:
> 
>> data.withUnsafeBytes {
>> (bytes: UnsafePointer) in
>> print (bytes [3])
>> }
> 
> which (in some sense) gives you a raw-ish pointer to the underlying data, 
> inside the closure. (The latter, which a different generic specialization 
> type, is also what you’d use if you wanted to access pairs of bytes as UInt16 
> values, etc.)
> 
> Back to original problem, the following code in a playground works:
> 
>> let img = UIImage(named: "Image”)! // I used a PNG image so the data is 
>> simple
>> let data = img.cgImage!.dataProvider!.data! as Data
>> print (data [0], data [1], data [2], data [3])
> 
> The last part of this is (a) whether you can always get the raw data as 
> bytes, (b) what those bytes represent, and (c) does this kind of approach 
> make a copy? The answer is “I don’t know”, because it’s going to depend on 
> the format of the image and the particular data provider. AFAIK, both the 
> array treatment and the UnsafePointer treatment require a continuous 
> underlying buffer, so if the data provide build the data using multiple 
> partial buffers, I suppose there has to be a copy to meet the API semantics.
> 
> You could also iterate through a Data object using a for loop (and general 
> collection/sequence methods as required). Since that would access only 1 byte 
> at a time, I’d expect there’s no copy involved, but who knows what the 
> performance might be in general.
> 
> Does any of that help?

Maybe, at least for the bonus question. The bigger question is around the copy.


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


Getting immutable UIImage data pointer without copy?

2017-11-14 Thread Rick Mann
Is there a way to get at the underlying raw image data for a given UIImage (in 
an immutable buffer) in Swift?

Does this end up making copies? (For bonus points, what's the array magic?)

let img: UIImage = UIImage(named: "MyImage")
let data: CFData? = img.CGImage.dataProvider.data
let dataArray: [UInt8] = 

Thanks,

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


AVFoundation vs Core Image for QR Codes?

2017-09-19 Thread Rick Mann
I'm trying to read Data Matrix codes (like QR Codes) from static images, but it 
seems Core Image can only read QR Codes. AVFoundation seems to have more 
bar-code reading capabilities, but that seems wholly focused on real-time video 
capture.

I'm astonished that the decoding isn't better decoupled from AVFoundation. Am I 
just missing something?

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


Why are some Core Graphics APIs "hidden" from Swift?

2017-08-30 Thread Rick Mann
I notice the CGPoint version of APIs map to nice Swift method calls:

CGContext.addArc(tangent1End: CGPoint, tangent2End: CGPoint, radius: 
CGFloat)

But the X, Y versions have a double underscore:

CGContext.__addArc(x1: CGFloat, y1: CGFloat, x2: CGFloat, y2: CGFloat, 
radius: CGFloat)

Why is this?





-- 
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: Is cloning the same as copying in APFS?

2017-06-28 Thread Rick Mann
Yeah, our data is immutable, so hard Link’s work fine. 

-- 
Rick Mann
rm...@latencyzero.com

> On Jun 28, 2017, at 02:43, Alastair Houghton <alast...@alastairs-place.net> 
> wrote:
> 
>> On 27 Jun 2017, at 22:45, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Agreed. Thanks for the code, and for showing the other techniques. In my 
>> case, I still have to support HFS+, and I want to do that with hard links. I 
>> wish there was an API to clone-or-hardlink, but I can do that.
> 
> Perhaps worth emphasising here, since you mention hard links, that the 
> difference between hard links and clones is that clones are copy-on-write.  
> i.e. if you hard link a file, and then change the data, *all of the linked 
> copies will change too*.
> 
> I’m sure that’s not an issue in your application, but if someone later 
> happens across this thread and thinks “What a great idea!”, mentioning that 
> the two are only equivalent for the read-only case might avoid some pain.
> 
> Kind regards,
> 
> Alastair.
> 
> --
> http://alastairs-place.net
> 

___

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: Is cloning the same as copying in APFS?

2017-06-27 Thread Rick Mann
Yes, that seems the right way to do it. Thanks!

-- 
Rick Mann
rm...@latencyzero.com

> On Jun 27, 2017, at 16:07, Charles Srstka <cocoa...@charlessoft.com> wrote:
> 
>>> On Jun 27, 2017, at 4:45 PM, Rick Mann <rm...@latencyzero.com> wrote:
>>> 
>>> 
>>>> On Jun 27, 2017, at 14:30 , Charles Srstka <cocoa...@charlessoft.com> 
>>>> wrote:
>>>> 
>>>> On Jun 27, 2017, at 4:17 PM, Rick Mann <rm...@latencyzero.com> wrote:
>>>> 
>>>> Thanks for that, Charles!
>>>> 
>>>> I wasn't sure because of the existence of the clonefile() call in 
>>>> , implying that operation was different from copyfile(), 
>>>> but looking more closely at the sample code, I see that you can call 
>>>> copyfile() with COPYFILE_CLONE, which seems like it will clone if possible 
>>>> and copy if not.
>>>> 
>>>> But there didn't seem to be equivalent calls in NSFileManager, hence my 
>>>> question.
>>> 
>>> Apple clearly wants the clone feature to get used. :-) The ability to do a 
>>> copy the old way is still there if you drop down to C, but since I can’t 
>>> think of too many reasons to want to do that, it makes sense to leave it 
>>> out of the high-level API.
>> 
>> Agreed. Thanks for the code, and for showing the other techniques. In my 
>> case, I still have to support HFS+, and I want to do that with hard links. I 
>> wish there was an API to clone-or-hardlink, but I can do that.
> 
> That should be easy enough to do. One thing I’d recommend would be checking 
> the volumeSupportsFileCloningKey key on URLResourceValues, rather than 
> checking the file system type itself. That way, if APFS gets supplanted by 
> some even better file system in the future, you’ll already support it.
> 
> 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: Is cloning the same as copying in APFS?

2017-06-27 Thread Rick Mann

> On Jun 27, 2017, at 14:30 , Charles Srstka <cocoa...@charlessoft.com> wrote:
> 
>> On Jun 27, 2017, at 4:17 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Thanks for that, Charles!
>> 
>> I wasn't sure because of the existence of the clonefile() call in 
>> , implying that operation was different from copyfile(), 
>> but looking more closely at the sample code, I see that you can call 
>> copyfile() with COPYFILE_CLONE, which seems like it will clone if possible 
>> and copy if not.
>> 
>> But there didn't seem to be equivalent calls in NSFileManager, hence my 
>> question.
> 
> Apple clearly wants the clone feature to get used. :-) The ability to do a 
> copy the old way is still there if you drop down to C, but since I can’t 
> think of too many reasons to want to do that, it makes sense to leave it out 
> of the high-level API.

Agreed. Thanks for the code, and for showing the other techniques. In my case, 
I still have to support HFS+, and I want to do that with hard links. I wish 
there was an API to clone-or-hardlink, but I can do that.

> 
> Charles
> 


-- 
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: Is cloning the same as copying in APFS?

2017-06-27 Thread Rick Mann
Thanks for that, Charles!

I wasn't sure because of the existence of the clonefile() call in 
, implying that operation was different from copyfile(), but 
looking more closely at the sample code, I see that you can call copyfile() 
with COPYFILE_CLONE, which seems like it will clone if possible and copy if not.

But there didn't seem to be equivalent calls in NSFileManager, hence my 
question.

> On Jun 27, 2017, at 13:55 , Charles Srstka <cocoa...@charlessoft.com> wrote:
> 
>> On Jun 27, 2017, at 12:28 AM, Jens Alfke <j...@mooseyard.com> wrote:
>> 
>>> On Jun 26, 2017, at 7:38 PM, Rick Mann <rm...@latencyzero.com> wrote:
>>> 
>>> But there's actually a POSIX "clone" API, and so I wonder if a copy is 
>>> different from a clone.
>> 
>> The low level file copying API that I’m aware of is , which is 
>> Apple specific. It has options for doing copy-on-write.
>> I don’t know if NSFileManager’s copy method clones files. I would assume 
>> that it does, on APFS.
> 
> Well, I mean, you could always *try* it ;-)
> 
> import Foundation
> 
> func unclonedSize(of url: URL) throws -> off_t {
>   var list = attrlist(bitmapcount: UInt16(ATTR_BIT_MAP_COUNT),
>   reserved: 0,
>   commonattr: 0,
>   volattr: 0,
>   dirattr: 0,
>   fileattr: 0,
>   forkattr: attrgroup_t(ATTR_CMNEXT_PRIVATESIZE))
>   
>   let bufsize = 4 + MemoryLayout.size
>   let buf = UnsafeMutablePointer.allocate(capacity: bufsize)
>   defer { buf.deallocate(capacity: bufsize) }
>   
>   let err = url.withUnsafeFileSystemRepresentation { getattrlist($0, 
> , buf, bufsize, UInt32(FSOPT_ATTR_CMN_EXTENDED)) }
>   
>   if err != 0 { throw POSIXError.Code(rawValue: errno).map { 
> POSIXError($0) } ?? CocoaError(.fileReadUnknown) }
>   
>   let attrsize = buf.withMemoryRebound(to: UInt32.self, capacity: 1) { 
> $0.pointee }
>   
>   if attrsize < bufsize { throw CocoaError(.fileReadUnknown) }
>   
>   var unclonedSize: off_t = 0
>   
>   _ = withUnsafeMutableBytes(of: ) { memcpy($0.baseAddress!, 
> buf + 4, MemoryLayout.size) }
>   
>   return unclonedSize
> }
> 
> do {
>   let sourceURL = URL(fileURLWithPath: "/tmp/tempfile1")
>   let destURL = URL(fileURLWithPath: "/tmp/tempfile2")
> 
>   let sortaRandomData = Data(bytes: (0..<100 * 1024).map { 
> UInt8(extendingOrTruncating: $0) })
>   
>   try sortaRandomData.write(to: sourceURL)
>   
>   print("Uncloned size of source file: \(try unclonedSize(of: 
> sourceURL))")
>   
>   try FileManager.default.copyItem(at: sourceURL, to: destURL)
>   
>   print("Uncloned size of dest file: \(try unclonedSize(of: destURL))")
> } catch {
>   print("Error occurred: \(error.localizedDescription)")
> }
> 
> - - - - - - - - -
> 
> outputs:
> 
> Uncloned size of source file: 102400
> Uncloned size of dest file: 0
> 
> So, it seems quite clear that (NS)FileManager does, in fact, clone the files 
> you tell it to copy. :-)
> 
> Charles
> 


-- 
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: Is cloning the same as copying in APFS?

2017-06-26 Thread Rick Mann
I'm not talking about Time Machine. My code allows the user to duplicate data, 
and thus it duplicates the files o the disk. A lot of the files referenced by 
the model are immutable, and so a clone/lazy copy is ideal.

But there's actually a POSIX "clone" API, and so I wonder if a copy is 
different from a clone.

> On Jun 26, 2017, at 19:17 , Sandor Szatmari <admin.szatmari@gmail.com> 
> wrote:
> 
> Are you talking about just a regular old copy or a copy in the sense of a 
> time machine backup?  Are these behaviors different on APFS?
> 
> The ADC video Quincey referred to a couple of weeks ago talked about 
> references to files being created (lazy copies).  Only when the blocks 
> associated with the newest reference are altered would any actual copying of 
> actual data be done.
> 
> Is this the behavior your referring to?
> 
> Sandor
> 
>> On Jun 26, 2017, at 21:34, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> If I use NSFileManager to make a copy on an APFS volume, will it make a 
>> clone underneath?
>> 
>> Is there a Cocoa API for cloning?
>> 
>> 
>> -- 
>> 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/admin.szatmari.net%40gmail.com
>> 
>> This email sent to admin.szatmari@gmail.com


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


Is cloning the same as copying in APFS?

2017-06-26 Thread Rick Mann
If I use NSFileManager to make a copy on an APFS volume, will it make a clone 
underneath?

Is there a Cocoa API for cloning?


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


__nw_connection_get_connected_socket_block_invoke 15 Connection has no connected handler

2017-05-07 Thread Rick Mann
Our app, which does a ton of network calls, gets a lot of console log messages 
like:

__nw_connection_get_connected_socket_block_invoke 15 Connection has no 
connected handler

Anyone know what this is? Google was not very helpful (people complain about 
it, but I couldn't find any real answers).


-- 
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: Does file-mapping a memory allocation work around RAM limits?

2017-05-04 Thread Rick Mann
Thanks for that thorough explanation! We're going to try using mmap(). It will 
be interesting to do this from Swift.


> On May 4, 2017, at 10:04 , David Duncan <david.dun...@apple.com> wrote:
> 
> 
>> On May 3, 2017, at 11:51 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>>> 
>>> On May 3, 2017, at 23:27 , Doug Hill <cocoa...@breaqz.com> wrote:
>>> 
>>> 
>>>> On May 3, 2017, at 6:21 PM, Rick Mann <rm...@latencyzero.com> wrote:
>>>> 
>>>> Our iOS app works with very large data buffers (hundreds of MB). As you 
>>>> can imagine, we run into issues at times.
>>>> 
>>>> I saw some sample code that used this technique, and it got me wondering 
>>>> if this actually works around the 600 MB limitation of some iOS devices 
>>>> (which begs another question: doss the large iPad Pro with 3GB of RAM also 
>>>> limit apps to 600 MB?).
>>>> 
>>>> -- 
>>>> Rick Mann
>>>> rm...@latencyzero.com
>>> 
>>> The limits of mmap should be the limits of the file system. Well, 
>>> technically it’s limited by the size_t parameter which I guess is OS 
>>> specific. But these days it should be what the VFS can handle.
>>> 
>>> I just tried out this code snippet:
>>> 
>>> http://www.linuxquestions.org/questions/programming-9/mmap-tutorial-c-c-511265/
>>>  
>>> <http://www.linuxquestions.org/questions/programming-9/mmap-tutorial-c-c-511265/>
>>> 
>>> and set the size of the mapped file to 32GB Works fine on a Mac with 16GB 
>>> of RAM.
>>> 
>>> It is SLOOWW however. You have to move all that data across a bus 
>>> after all. If you need to load 3GB of data from your file, I recommend 
>>> making it happen on a background thread. And make some lights blink and 
>>> play a happy tune while the user waits.
>>> 
>>> Not sure what the limitation on some iOS devices you’re referring to. Is it 
>>> dependent on the installed RAM? Are there other artificial limits?
>> 
>> Yeah, at least on 1 GB iOS devices, apps are limited to 600 MB (even if 
>> there's more available). I think there are subtleties to that (e.g. maybe 
>> texture memory isn't counted), I'm not sure.
> 
> iOS tracks memory per-process primarily in 3 buckets – Dirty, Resident, and 
> Virtual. The hierarchy is also in that order, all Dirty memory is Resident, 
> and all Resident memory is Virtual. Virtual just means that address space is 
> allocated – there is a hard limit on this that is below the theoretical 
> address space (significantly so in the case of iOS), in the 2-4GB range (may 
> vary by device installed memory, but I don’t recall). Resident memory is 
> memory that has physical RAM allocated to it and so the CPU can manipulate 
> it. This is the 600MB limit that you mentioned (at least on 1GB devices, 
> again I don’t recall if it is different or what it is on larger devices). 
> Dirty memory is memory that has been written to. Because iOS does not have a 
> demand paging memory system, this memory typically has no where to go if you 
> hit the Resident memory limits.
> 
> This is where mmap() comes into play – it allows you to create a Virtual 
> allocation, whose Resident memory is backed by a file, just like in a demand 
> paged system. So you can write to that memory, and if your app uses too much 
> memory, the OS can attempt to recover by writing it to disk on your behalf 
> (turning Resident-Dirty memory into Virtual). Sweet right?
> 
> But remember that hard Virtual limit I mentioned earlier – that means that if 
> you try to mmap() too much you end up running out of Virtual memory, and 
> you’ll likely get abort()’d by some subsystem attempting to allocate memory.
> 
> And so even though iOS is a 64-bit OS, due to other performance 
> considerations, the virtual address space is more akin to a 32-bit OS. This 
> is of course an implementation detail that can be expanded in the future, but 
> something to keep in mind if you plan to use mmap() a lot.
> 
> From the sounds of what our app does, keeping around a single mmap()’s 
> scratch space may be reasonable. You probably still want to keep it at a 
> modest size, but it should help you process those large data buffers without 
> getting your app killed.
> --
> David Duncan
> 


-- 
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: Does file-mapping a memory allocation work around RAM limits?

2017-05-04 Thread Rick Mann

> On May 3, 2017, at 23:27 , Doug Hill <cocoa...@breaqz.com> wrote:
> 
> 
>> On May 3, 2017, at 6:21 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Our iOS app works with very large data buffers (hundreds of MB). As you can 
>> imagine, we run into issues at times.
>> 
>> I saw some sample code that used this technique, and it got me wondering if 
>> this actually works around the 600 MB limitation of some iOS devices (which 
>> begs another question: doss the large iPad Pro with 3GB of RAM also limit 
>> apps to 600 MB?).
>> 
>> -- 
>> Rick Mann
>> rm...@latencyzero.com
> 
> The limits of mmap should be the limits of the file system. Well, technically 
> it’s limited by the size_t parameter which I guess is OS specific. But these 
> days it should be what the VFS can handle.
> 
> I just tried out this code snippet:
> 
> http://www.linuxquestions.org/questions/programming-9/mmap-tutorial-c-c-511265/
>  
> <http://www.linuxquestions.org/questions/programming-9/mmap-tutorial-c-c-511265/>
> 
> and set the size of the mapped file to 32GB Works fine on a Mac with 16GB of 
> RAM.
> 
> It is SLOOWW however. You have to move all that data across a bus 
> after all. If you need to load 3GB of data from your file, I recommend making 
> it happen on a background thread. And make some lights blink and play a happy 
> tune while the user waits.
> 
> Not sure what the limitation on some iOS devices you’re referring to. Is it 
> dependent on the installed RAM? Are there other artificial limits?

Yeah, at least on 1 GB iOS devices, apps are limited to 600 MB (even if there's 
more available). I think there are subtleties to that (e.g. maybe texture 
memory isn't counted), I'm not sure.


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

Does file-mapping a memory allocation work around RAM limits?

2017-05-03 Thread Rick Mann
Our iOS app works with very large data buffers (hundreds of MB). As you can 
imagine, we run into issues at times.

I saw some sample code that used this technique, and it got me wondering if 
this actually works around the 600 MB limitation of some iOS devices (which 
begs another question: doss the large iPad Pro with 3GB of RAM also limit apps 
to 600 MB?).

-- 
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: Mysterious write-only SMB behavior

2017-04-28 Thread Rick Mann
I doubt this is the same issue, but I recently came across a situation where my 
Mac is a client of a samba share from Linux. If I attempt to overwrite a file 
on the samba share, it crashes the app that's looking at the directory, because 
that app can't handle the change in, of all things, the resource fork file that 
also gets written ("._").

It's okay if it's a newly-written file. It's a problem only when replacing a 
file.

> On Apr 28, 2017, at 13:21 , Kirk <kirkkere...@gmail.com> wrote:
> 
> I have Cocoa application that does a specialized task for my employer. It 
> runs on a Mini running Sierra but all file I/O is from/to network SMB volumes 
> shared by Windows Server over the company network.
> 
> The Mini is a full admin domain member, both computer and user. 
> 
> This application has been working fine, until we recently upgraded the server 
> from WS 2008 to 2016 and moved a lot of stuff around. 
> 
> Now, files that my app creates over SMB are invisible to Macs, but visible to 
> Windows clients. And then if that were not odd enough, the files become 
> visible to a Mac if they are found by a Finder file-name search on the SMB 
> volume. Once the search is closed, the files resume being invisible. 
> 
> All of the files are text files, with various non-standard file extensions 
> for housekeeping purposes. 
> 
> FIles that my app merely modifies (renames) and relocates remain visible, and 
> directories that it creates are visible. 
> 
> If this rings a bell with anyone, I would appreciate a clue, which would be 
> one more than I have now. 
> 
> Kirk Kerekes 
> (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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


-- 
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: iOS "library" unit test of iOS code?

2017-04-24 Thread Rick Mann
Also, in this case, it can be a macOS thing; the code should run equally well, 
assuming the dylib I depend on can load (it might've been built against the iOS 
SDK).

> On Apr 24, 2017, at 15:48 , Jens Alfke <j...@mooseyard.com> wrote:
> 
> 
>> On Apr 24, 2017, at 3:38 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> I'm trying to test some code that's entirely stand-alone from my app, and in 
>> fact I'm having trouble testing it within my app because the app does some 
>> things that interfere.
>> 
>> So, I tried creating a new test target and specifying "None" for the Test 
>> Host, then adding the files needed to the new test target.
> 
> You can’t do that in iOS — all tests have to be run within an app.
> If you can’t run them in your regular app, you need to make a new empty app 
> and then test them in that.
> 
> —Jens


-- 
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: iOS "library" unit test of iOS code?

2017-04-24 Thread Rick Mann

> On Apr 24, 2017, at 15:48 , Jens Alfke <j...@mooseyard.com> wrote:
> 
> 
>> On Apr 24, 2017, at 3:38 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> I'm trying to test some code that's entirely stand-alone from my app, and in 
>> fact I'm having trouble testing it within my app because the app does some 
>> things that interfere.
>> 
>> So, I tried creating a new test target and specifying "None" for the Test 
>> Host, then adding the files needed to the new test target.
> 
> You can’t do that in iOS — all tests have to be run within an app.
> If you can’t run them in your regular app, you need to make a new empty app 
> and then test them in that.

Okay, thanks.

Do Apple's docs spell this out anywhere?

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

iOS "library" unit test of iOS code?

2017-04-24 Thread Rick Mann
I'm trying to test some code that's entirely stand-alone from my app, and in 
fact I'm having trouble testing it within my app because the app does some 
things that interfere.

So, I tried creating a new test target and specifying "None" for the Test Host, 
then adding the files needed to the new test target.

One of these files is a .dylib (and associated module map file). I finally got 
everything to link, but at run time it couldn't find the dylib. So I added the 
path to the dylib in the runtime search path, and now it finds it, but the test 
crashes in the dyld loader:

#0  0x00010b500711 in memcmp ()
#1  0x00010b4f5abf in 
ImageLoaderMachO::validateFirstPages(linkedit_data_command const*, int, 
unsigned char const*, unsigned long, long long, ImageLoader::LinkContext 
const&) ()
#2  0x00010b4f88fa in 
ImageLoaderMachOCompressed::instantiateFromFile(char const*, int, unsigned char 
const*, unsigned long, unsigned long long, unsigned long long, stat const&, 
unsigned int, unsigned int, linkedit_data_command const*, 
encryption_info_command const*, ImageLoader::LinkContext const&) ()
#3  0x00010b4f4d01 in ImageLoaderMachO::instantiateFromFile(char 
const*, int, unsigned char const*, unsigned long, unsigned long long, unsigned 
long long, stat const&, ImageLoader::LinkContext const&) ()
#4  0x00010b4e9289 in dyld::loadPhase6(int, stat const&, char const*, 
dyld::LoadContext const&) ()
#5  0x00010b4eccac in dyld::loadPhase5(char const*, char const*, 
dyld::LoadContext const&, unsigned int&, std::__1::vector >*) ()
#6  0x00010b4eca6f in dyld::loadPhase4(char const*, char const*, 
dyld::LoadContext const&, unsigned int&, std::__1::vector >*) ()
#7  0x00010b4ec3de in dyld::loadPhase3(char const*, char const*, 
dyld::LoadContext const&, unsigned int&, std::__1::vector >*) ()
#8  0x00010b4ec05e in dyld::loadPhase1(char const*, char const*, 
dyld::LoadContext const&, unsigned int&, std::__1::vector >*) ()
#9  0x00010b4e8fed in dyld::loadPhase0(char const*, char const*, 
dyld::LoadContext const&, unsigned int&, std::__1::vector >*) ()
#10 0x00010b4e8d28 in dyld::load(char const*, dyld::LoadContext const&, 
unsigned int&) ()
#11 0x00010b4ed097 in dyld::libraryLocator(char const*, bool, char 
const*, ImageLoader::RPathChain const*, unsigned int&) ()
#12 0x00010b4f24f2 in 
ImageLoader::recursiveLoadLibraries(ImageLoader::LinkContext const&, bool, 
ImageLoader::RPathChain const&, char const*) ()
#13 0x00010b4f1913 in ImageLoader::link(ImageLoader::LinkContext 
const&, bool, bool, bool, ImageLoader::RPathChain const&, char const*) ()
#14 0x00010b4ea474 in dyld::link(ImageLoader*, bool, bool, 
ImageLoader::RPathChain const&, unsigned int) ()
#15 0x00010b4eeb7e in dlopen ()
#16 0x00010d73fd25 in dlopen ()
#17 0x00010c11f1c8 in _CFBundleDlfcnLoadBundle ()
#18 0x00010c11f04f in _CFBundleLoadExecutableAndReturnError ()
#19 0x00010b58c235 in -[NSBundle loadAndReturnError:] ()
#20 0x00010baf9816 in _XCTestMain ()
#21 0x00010b4de679 in ___lldb_unnamed_symbol3$$xctest ()
#22 0x00010d74265d in start ()

The dyld itself has this:

$ file iOS/Controller/lib/MyLibrary/MyLibrary.dylib 
iOS/Controller/lib/MyLibrary/MyLibrary.dylib: Mach-O universal binary with 2 
architectures: [x86_64: Mach-O 64-bit dynamically linked shared library x86_64] 
[arm64]
iOS/Controller/lib/MyLibrary/MyLibrary.dylib (for architecture x86_64): Mach-O 
64-bit dynamically linked shared library x86_64
iOS/Controller/lib/MyLibrary/MyLibrary.dylib (for architecture arm64):  Mach-O 
64-bit dynamically linked shared library arm64

I don't have source code for the library.

Perhaps it's trying to link against the iOS SDK? How do I unit test, with 
minimal overhead (i.e. without having to run my entire app) some iOS-linked 
code?

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


Unit testing a series of aync operations?

2017-04-21 Thread Rick Mann
I can use waitForExpectations() to test an asynchronous operation, but a 
real-world test often involves several async ops chained together. I'd like to 
abort the test if some of those operations fail to complete in a certain amount 
of time. Some ops should be quick, while later ops can take longer.

Is there any way to test this? Remember, each operation has to wait for the 
previous one to finish.

Thanks,

-- 
Rick Mann
rm...@latencyzero.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Translating KVO-ed property to Swift

2017-04-17 Thread Rick Mann
Thanks, Charles, that's helpful. In the end I left the class as Obj-C, because 
I still had to derive from it in Obj-C and you annoyingly can't do that.

> On Apr 17, 2017, at 08:06 , Charles Srstka <cocoa...@charlessoft.com> wrote:
> 
>> On Apr 17, 2017, at 3:24 AM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> I have a number of properties in Objective-C written like this, 
>> short-circuiting notifications when the value doesn't change:
>> 
>> -
>> @synthesize version = mVersion
>> 
>> - (void)
>> setVersion: (NSString *) inVersion
>> {
>>if (inVersion == nil && mVersion == nil)
>>{
>>return;
>>}
>>if ([inVersion isEqualToString: mVersion])
>>{
>>return;
>>}
>> 
>>[self willChangeValueForKey: @"version"];
>>mVersion = inVersion;
>>[self didChangeValueForKey: @"version"];
>> }
>> -
>> 
>> Now I want to translate this method into Swift. Thing is, AFAIK you can't 
>> name the ivar created for a property. Is there a way to translate this to 
>> swift?
> 
> I’ve been converting a lot of KVO properties to Swift lately. Here’s how I’d 
> do this:
> 
> // Only needed if the property will be accessed by Objective-C code, since 
> Swift code won’t see the swizzled accessors anyway for a non-dynamic property.
> // @objc annotation is needed on every method we write here, since otherwise 
> it’ll quit working when @objc inference is removed in Swift 4 (SE-0160)
> @objc private static let automaticallyNotifiesObserversOfVersion: Bool = false
> 
> // Our actual version property. If you want, you can create a private 
> property named “mVersion” and it will function like an instance variable.
> // But I’d probably just use willSet and didSet.
> // Note that this doesn’t need to be dynamic, since we are not relying on 
> Cocoa’s built-in automatic swizzling,
> // which is only needed if we are not calling willChangeValue(forKey:) and 
> didChangeValue(forKey:) ourselves.
> @objc var version: String {
> willSet {
> // Send the willChange notification, if the value is different from 
> its old value.
> if newValue != self.version {
> self.willChangeValue(forKey: #keyPath(version))
> }
> }
> didSet {
> // Send the didChange notification, if the value is different from 
> its old value.
> if oldValue != self.version {
> self.didChangeValue(forKey: #keyPath(version))
> }
> }
> }
> 
> Charles
> 


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

Translating KVO-ed property to Swift

2017-04-17 Thread Rick Mann
I have a number of properties in Objective-C written like this, 
short-circuiting notifications when the value doesn't change:

-
@synthesize version = mVersion

- (void)
setVersion: (NSString *) inVersion
{
if (inVersion == nil && mVersion == nil)
{
return;
}
if ([inVersion isEqualToString: mVersion])
{
return;
}

[self willChangeValueForKey: @"version"];
mVersion = inVersion;
[self didChangeValueForKey: @"version"];
}
-

Now I want to translate this method into Swift. Thing is, AFAIK you can't name 
the ivar created for a property. Is there a way to translate this to swift?

TIA,

-- 
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: Argh never-ending troubles with bindings

2017-02-08 Thread Rick Mann

> On Feb 8, 2017, at 18:26 , Ken Thomases <k...@codeweavers.com> wrote:
> 
> On Feb 8, 2017, at 5:44 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> 2017-02-08 15:39:41.178728 PromotionalChargeManager[51621:17330300] 
>> [General] Cannot perform operation without a managed object context
>> 2017-02-08 15:39:41.181165 PromotionalChargeManager[51621:17330300] 
>> [General] (
>>  0   CoreFoundation  0x7fffc9edd0db 
>> __exceptionPreprocess + 171
>>  1   libobjc.A.dylib 0x7fffdeb6ea2a 
>> objc_exception_throw + 48
>>  2   CoreFoundation  0x7fffc9f5a9c5 
>> +[NSException raise:format:] + 197
>>  3   AppKit  0x7fffc80281bc 
>> -[_NSManagedProxy _managedObjectContext] + 66
>>  4   AppKit  0x7fffc80281dc 
>> -[_NSManagedProxy _persistentStoreCoordinator] + 22
>>  5   AppKit  0x7fffc802824f 
>> -[_NSManagedProxy _entity] + 46
>> ...
> 
> Why not show the rest of the stack trace?

Trying to be concise. Here you go:

ViewController.swift:25Set represented object to: 
Optional()
2017-02-08 18:34:30.957825 PromotionalChargeManager[3440:83555] [General] 
Cannot perform operation without a managed object context
2017-02-08 18:34:30.964380 PromotionalChargeManager[3440:83555] [General] (
0   CoreFoundation  0x7fff8531a0db 
__exceptionPreprocess + 171
1   libobjc.A.dylib 0x7fff99faba2a 
objc_exception_throw + 48
2   CoreFoundation  0x7fff853979c5 
+[NSException raise:format:] + 197
3   AppKit  0x7fff834651bc 
-[_NSManagedProxy _managedObjectContext] + 66
4   AppKit  0x7fff834651dc 
-[_NSManagedProxy _persistentStoreCoordinator] + 22
5   AppKit  0x7fff8346524f 
-[_NSManagedProxy _entity] + 46
6   AppKit  0x7fff83465508 
-[_NSManagedProxy fetchRequestWithSortDescriptors:limit:] + 89
7   AppKit  0x7fff83464d09 
-[NSObjectController(NSManagedController) 
_executeFetch:didCommitSuccessfully:actionSender:] + 75
8   AppKit  0x7fff8317b6a9 
-[NSController _controllerEditor:didCommit:contextInfo:] + 185
9   CoreFoundation  0x7fff8528e6dc 
__invoking___ + 140
10  CoreFoundation  0x7fff8528e561 
-[NSInvocation invoke] + 289
11  CoreFoundation  0x7fff852a7736 
-[NSInvocation invokeWithTarget:] + 54
12  Foundation  0x7fff86d2e628 
__NSFireDelayedPerform + 417
13  CoreFoundation  0x7fff8529a294 
__CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20
14  CoreFoundation  0x7fff85299f23 
__CFRunLoopDoTimer + 1075
15  CoreFoundation  0x7fff85299a7a 
__CFRunLoopDoTimers + 298
16  CoreFoundation  0x7fff852915d1 
__CFRunLoopRun + 2081
17  CoreFoundation  0x7fff85290b54 
CFRunLoopRunSpecific + 420
18  HIToolbox   0x7fff8481ba5c 
RunCurrentEventLoopInMode + 240
19  HIToolbox   0x7fff8481b799 
ReceiveNextEventCommon + 184
20  HIToolbox   0x7fff8481b6c6 
_BlockUntilNextEventMatchingListInModeWithFilter + 71
21  AppKit  0x7fff82dc15b4 
_DPSNextEvent + 1120
22  AppKit  0x7fff8353bd6b 
-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] 
+ 2789
23  AppKit  0x7fff82db5f35 
-[NSApplication run] + 926
24  AppKit  0x7fff82d80850 
NSApplicationMain + 1237
25  PromotionalChargeManager    0x00014e84 main + 84
26  libdyld.dylib   0x7fff9a88d255 start + 1
)



-- 
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: Argh never-ending troubles with bindings

2017-02-08 Thread Rick Mann

> On Feb 8, 2017, at 17:41 , Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On Feb 8, 2017, at 17:17 , Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> it's the Managed Object Context that's bound to 
>> "self.representedObject.managedObjectContext".
> 
> “self.” is unnecessary. AFAIK it’s just voodoo arising from attempts to work 
> around some bug or confusion several years ago.
> 
> The other two keys you have control of. You can override the default property 
> getters to “watch” what happens when the binding is resolved/referenced. My 
> guess is that it’s not a bindings problem, exactly, but something 
> misplaced/misconfigured/overlooked, and you need to look in a different place 
> for what’s going on. But I’m just guessing.

I haven't figured out how to override the getter in Swift without also 
providing backing. There's no willGet{} in Swift.

In my other app, that works, I set the representedObject in a subclass of 
NSWindowController when NSWindowController's document is set. I could try this, 
but I feel like that shouldn't be necessary.




-- 
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: Argh never-ending troubles with bindings

2017-02-08 Thread Rick Mann

> On Feb 8, 2017, at 17:08 , Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On Feb 8, 2017, at 16:58 , Rick Mann <rm...@latencyzero.com> wrote:
>> 
>>> On Feb 8, 2017, at 16:50 , Quincey Morris 
>>> <quinceymor...@rivergatesoftware.com> wrote:
>>> 
>>> On Feb 8, 2017, at 15:44 , Rick Mann <rm...@latencyzero.com> wrote:
>>>> 
>>>> I bind an Array Controller in the View Controller scene to 
>>>> ViewController.self.representedObject.managedObjectContext.
>>> 
>>> Using what binding key?
>> 
>> self.representedObject.managedObjectContext
> 
> I meant, is this the array controller’s “content” binding, or its 
> “managedObjectContext” binding? This is a different thing from the 
> controller/key path that represents the object bound to.

Oh, I'm sorry. In the Array Controller, it's the managedObjectContext binding. 
In the table view, it's the content binding, so I misspoke. I removed all other 
bindings just trying to narrow the problem, so nothing is actually bound to the 
Array Controller.

> You later talked about the content binding, as if you had used that to bind 
> to the MOC. I was trying to verify if you in fact bound the 
> “managedObjectContent” binding to the MOC. 

Yeah, it's the Managed Object Context that's bound to 
"self.representedObject.managedObjectContext".


-- 
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: Argh never-ending troubles with bindings

2017-02-08 Thread Rick Mann

> On Feb 8, 2017, at 16:50 , Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On Feb 8, 2017, at 15:44 , Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> I bind an Array Controller in the View Controller scene to 
>> ViewController.self.representedObject.managedObjectContext.
> 
> Using what binding key?

self.representedObject.managedObjectContext

I wrote it as it was above to indicate that I bound to the View Controller's 
key "self.representedObject.managedObjectContext". I didn't mean to imply I 
wrote "ViewController" in the key path field.

> 
>> Note that I've also tried setting the Array Controller's content binding to 
>> gobbledegook
> 
> Instead of the above binding? That’s not the right key for the MOC.
> 
> However, what makes you think this is a bindings problem? It’s not obvious 
> that there’s anything wrong except that the MOC doesn’t exist [yet].
> 

The MOC does exist. I've verified that it exists at the time my Document's 
init() method is called.

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

Argh never-ending troubles with bindings

2017-02-08 Thread Rick Mann
I have the simplest of Document-based macOS apps created in Xcode 8.2.3. In the 
Document.makeWindowControllers method, I set my ViewController's 
representedObject to the document.

override func makeWindowControllers() {
let storyboard = NSStoryboard(name: "Main", bundle: nil)
let windowController = storyboard.instantiateController(withIdentifier: 
"Document Window Controller") as! NSWindowController

let vc = windowController.contentViewController as! ViewController
vc.representedObject = self

self.addWindowController(windowController)
}


In the Storyboard, I bind an Array Controller in the View Controller scene to 
ViewController.self.representedObject.managedObjectContext.

I don't have anything bound to the Array Controller (yet). But after launching 
and displaying the window, I get this (note the first message is me making sure 
my representedObject is getting set):

ViewController.swift:25Set represented object to: 
Optional()
2017-02-08 15:39:41.178728 PromotionalChargeManager[51621:17330300] [General] 
Cannot perform operation without a managed object context
2017-02-08 15:39:41.181165 PromotionalChargeManager[51621:17330300] [General] (
0   CoreFoundation  0x7fffc9edd0db 
__exceptionPreprocess + 171
1   libobjc.A.dylib 0x7fffdeb6ea2a 
objc_exception_throw + 48
2   CoreFoundation  0x7fffc9f5a9c5 
+[NSException raise:format:] + 197
3   AppKit  0x7fffc80281bc 
-[_NSManagedProxy _managedObjectContext] + 66
4   AppKit  0x7fffc80281dc 
-[_NSManagedProxy _persistentStoreCoordinator] + 22
5   AppKit  0x7fffc802824f 
-[_NSManagedProxy _entity] + 46
...

Now, as far as I can tell, I'm doing EXACTLY what Apple says I should do in

https://developer.apple.com/library/content/qa/qa1871/_index.html

Note that I've also tried setting the Array Controller's content binding to 
gobbledegook, hoping for a complaint about something not being KVO-compliant 
for that nonexistent property. No such luck.

What am I doing wrong?

Thanks!

-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Enabling UISearchBar cancel button?

2017-01-12 Thread Rick Mann
I need my search bar to appear under the nav bar. We also have an extra view 
outside and above the collection view. On top of that, I don't create a new 
view for the results, but rather use the existing view. Once the user selects 
an item that causes a push, and then goes back, everything is wonky. This is in 
part due to a modal presentation of the search controller. I tried to change 
that, but I could not get the UISearchBar to present the way I wanted to 
(inserting it into the view hierarchy and adding constraints just didn't seem 
to work right)

Now that I control the UISearchBar, it's always there, and all I do is adjust 
the top constraint constant. The only problem is that the cancel button behaves 
differently.

I'm going to try to explicitly set focus in the search field.

> On Jan 12, 2017, at 08:52 , Gary L. Wade <garyw...@desisoftsystems.com> wrote:
> 
> In what way is its controller getting in the way? Those do a lot together. If 
> used with a collection view, you might find my solution helps:
> 
> https://whatweretheythinkingblog.wordpress.com/2016/11/19/effectively-using-uisearchcontroller-with-uicollectionview/
> --
> Gary L. Wade (Sent from my iPad)
> http://www.garywade.com/
> 
> On Jan 11, 2017, at 8:17 PM, Rick Mann <rm...@latencyzero.com> 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!
>> 
>> -- 
>> Rick Mann
>> rm...@latencyzero.com
>> 


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


Enabling UISearchBar cancel button?

2017-01-11 Thread Rick Mann
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!

-- 
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: Uploading binary troubles?

2016-12-10 Thread Rick Mann
Oh, I guess the magic is to first complain to the list, then try again. It 
finally worked.

It's really flaky, though.

> On Dec 10, 2016, at 02:06 , Rick Mann <rm...@latencyzero.com> wrote:
> 
> I've been having no end of problems trying to upload a new binary to Apple 
> today. Has anyone else? Either I get complaints about my binary, which I 
> addressed, or I get "This action could not be completed. Try again. 
> (-22421)." I've gotten the try-again error six times today, in the afternoon, 
> and now (about 2 am PST).
> 
> Has anyone successfully uploaded a binary in the last 24 hours?
> 
> -- 
> 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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


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


Uploading binary troubles?

2016-12-10 Thread Rick Mann
I've been having no end of problems trying to upload a new binary to Apple 
today. Has anyone else? Either I get complaints about my binary, which I 
addressed, or I get "This action could not be completed. Try again. (-22421)." 
I've gotten the try-again error six times today, in the afternoon, and now 
(about 2 am PST).

Has anyone successfully uploaded a binary in the last 24 hours?

-- 
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: Vertically Centered Colon

2016-11-29 Thread Rick Mann

> On Nov 29, 2016, at 09:38 , Doug Hill <cocoa...@breaqz.com> wrote:
> 
> Wow, it's awesome that this works! And now that I know how to set these 
> attributes for a UILabel, I might try using some other features of SF font, 
> such as contextual fractional forms for any fraction.

Oh, wow, contextual fractional forms! This is *perfect* for the app I'm working 
on currently.

I'm late to this thread. Does this stuff only work for attributed strings? Do I 
apply the alternate form attribute to the string "99/100" in order to get the 
fractional form?

Thanks!


-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Preserving knowledge of renamed/moved directory?

2016-11-28 Thread Rick Mann

> On Nov 28, 2016, at 18:14 , Sean McBride <s...@rogue-research.com> wrote:
> 
> On Mon, 28 Nov 2016 17:06:41 -0800, Rick Mann said:
> 
>> Back in the days before URLs, I could have an FSRef to a directory, and
>> no matter where I moved that directory what I named it, the FSRef was
>> still valid, and I could still read/write to it.
>> 
>> Now that everything is URL based, if a thread changes the name of a
>> directory, or moves it, another thread's URL pointing to that directory
>> (or inside it) becomes invalid, right?
>> 
>> Is there any way for this to not be the case? That is, for a URL to a
>> directory or subdirectory or item within to stay valid even if the path
>> to it changes?
> 
> Stay valid for how long?  If you need to persistent them, use them across 
> reboots, etc. see 
> bookmarkDataWithOptions:includingResourceValuesForKeys:relativeToURL:error.

Just that launch.


-- 
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: Preserving knowledge of renamed/moved directory?

2016-11-28 Thread Rick Mann

> On Nov 28, 2016, at 17:30 , Charles Srstka <cocoa...@charlessoft.com> wrote:
> 
>> On Nov 28, 2016, at 7:06 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Back in the days before URLs, I could have an FSRef to a directory, and no 
>> matter where I moved that directory what I named it, the FSRef was still 
>> valid, and I could still read/write to it.
>> 
>> Now that everything is URL based, if a thread changes the name of a 
>> directory, or moves it, another thread's URL pointing to that directory (or 
>> inside it) becomes invalid, right?
>> 
>> Is there any way for this to not be the case? That is, for a URL to a 
>> directory or subdirectory or item within to stay valid even if the path to 
>> it changes?
> 
> I’ve got good news and bad news.
> 
> The good news: Yes, there is a way. Just call .fileReferenceURL on an NSURL 
> in Objective-C, and you’ll get something that works just like an FSRef.
> 
> The bad news: This is currently broken in Swift, as of Swift 3, where all 
> file reference URLs will get silently and unceremoniously converted back to 
> path-based ones at the bridge. This can be worked around via an Objective-C 
> wrapper, though.

LOL, naturally. Thanks!

-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Preserving knowledge of renamed/moved directory?

2016-11-28 Thread Rick Mann
Back in the days before URLs, I could have an FSRef to a directory, and no 
matter where I moved that directory what I named it, the FSRef was still valid, 
and I could still read/write to it.

Now that everything is URL based, if a thread changes the name of a directory, 
or moves it, another thread's URL pointing to that directory (or inside it) 
becomes invalid, right?

Is there any way for this to not be the case? That is, for a URL to a directory 
or subdirectory or item within to stay valid even if the path to it changes?

-- 
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: Swift DispatchQueue docs?

2016-11-21 Thread Rick Mann
Hmm. If you scroll down in the generated Swift interface file, you get a bunch 
of block comments from the C version. Sigh.

> On Nov 21, 2016, at 13:48 , Rick Mann <rm...@latencyzero.com> wrote:
> 
> They seem pretty terrible. No explanation of any of the things.
> 
> The GCD guide from Apple is very old, with out-of-date info, and lacking info 
> on the newer things (AFAICT).
> 
> Is there a way to look at the C header files for GCD? I tried opening 
> Dispatch.h, and Xcode is stuck "Generating Interface…", presumably a Swift 
> interface I don't want to see.
> 
> -- 
> 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/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


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

Swift DispatchQueue docs?

2016-11-21 Thread Rick Mann
They seem pretty terrible. No explanation of any of the things.

The GCD guide from Apple is very old, with out-of-date info, and lacking info 
on the newer things (AFAICT).

Is there a way to look at the C header files for GCD? I tried opening 
Dispatch.h, and Xcode is stuck "Generating Interface…", presumably a Swift 
interface I don't want to see.

-- 
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: Creating an NSWindow with utility style in Xcode storyboard?

2016-11-07 Thread Rick Mann

> On Nov 7, 2016, at 19:51 , Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On Nov 7, 2016, at 19:44 , Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> I can drag out an NSWindow, and I can even change its class to NSPanel, but 
>> I can't set the style.
> 
> You mean you dragged out a window controller, right?

Correct.

> When I do this, I can change the window’s class to NSPanel, and then the 
> attributes inspector gets a “Panel” section at the top where I can choose the 
> style. Are you seeing something different?

Ah! I just failed to look there after setting it to NSPanel. In my experience, 
Xcode never gives you controls for setting a class name, only for dragging out 
the right thing to begin with.

Thanks!

-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Xcode inspector-like tabs?

2016-11-07 Thread Rick Mann
Hmm, maybe. I missed that. When I select it, I get nothing at all, not sure how 
to specify the images for my tabs. But I'll look into it. Thanks!

> On Nov 7, 2016, at 19:49 , Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On Nov 7, 2016, at 19:45 , Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> I just wanted it to do all the heavy lifting there, like a tab controller.
> 
> Now that I think about it, doesn’t the “toolbar” style of NSTabViewController 
> do what you want?
> 


-- 
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: Xcode inspector-like tabs?

2016-11-07 Thread Rick Mann

> On Nov 7, 2016, at 19:43 , Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On Nov 7, 2016, at 18:01 , Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Is there a standard control to implement the Xcode inspector tabs across the 
>> top?
> 
> My guess is that it’s just a custom view with a series of buttons, with the 
> button status driven by the selected tab of the tabless tab view. Is there 
> some other functionality that goes beyond simple button behavior?

Not to my knowledge; I just wanted it to do all the heavy lifting there, like a 
tab controller. Seems reasonable enough.


-- 
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: Creating an NSWindow with utility style in Xcode storyboard?

2016-11-07 Thread Rick Mann

> On Nov 7, 2016, at 19:40 , Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On Nov 7, 2016, at 18:28 , Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Is there no way to make a floating inspector window in a Storyboard in Xcode 
>> 8?
> 
> What’s preventing you from dragging out a window controller onto the 
> storyboard? 
> 
> However, I would be inclined to put it in its own storyboard, since there’s 
> not much benefit to cluttering up your main (or whatever) storyboard with 
> what is essentially an unconnected piece of UI. In addition, we recently had 
> a long thread about NSPanel-style windows in storyboards, and there’s some 
> oddity is using a segue to *show* a singleton panel**. It may actually be 
> easier to use a XIB for an inspector panel.
> 
> 
> ** I don’t remember the details, but I think it might have been that you 
> should not *close* a singleton panel, because you’ll get a new panel the next 
> time it’s shown via a “show” segue. Instead, you have to short-circuit the 
> regular close mechanism and do a simple orderOut instead. Something like that.

So, I guess it's technically an NSPanel I want in my storyboard. And yeah, I 
already made it a separate storyboard, not the main one. But there's no NSPanel 
object in the catalog, only NSWindow, and there's no UI for adjusting the title 
bar appearance (that I can see).

I can drag out an NSWindow, and I can even change its class to NSPanel, but I 
can't set the style.


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

Creating an NSWindow with utility style in Xcode storyboard?

2016-11-07 Thread Rick Mann
Is there no way to make a floating inspector window in a Storyboard in Xcode 8?

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

Xcode inspector-like tabs?

2016-11-07 Thread Rick Mann
Is there a standard control to implement the Xcode inspector tabs across the 
top? The segmented control doesn't seem to have a controllable height. Tab 
controller doesn't seem to have a mode that looks like that. I figure the rest 
is built with a (tabless) tab controller and stack view.



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

'method' is partial: introduced in macOS 10.8

2016-11-01 Thread Rick Mann
I'm trying to build some I wrote last year (actually this is code in a library 
I used last year), and under Xcode 8 I'm getting warnings like these:

'objectForKeyedSubscript:' is partial: introduced in macOS 10.8
'objectForKeyedSubscript:' has been explicitly marked partial here
Explicitly redeclare 'objectForKeyedSubscript:' to silence this warning

The error occurs with the subscript on names[] below:

   NSMutableDictionary *names = self.categoryNames;
   NSMutableOrderedSet *categories = names[cacheKey];

I'm building on 10.12 and targeting 10.11. I don't see how to explicitly 
redeclare it, since it's on NSMutableDictionary. Do I have to do so in an 
extension? I don't understand. Why is this even a warning?



-- 
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: WKWebView and tooltips

2016-10-20 Thread Rick Mann
This seems to be new behavior in iOS 10. The exact same code on iOS 9 does not 
exhibit this behavior.

Mobile Safari does not exhibit this behavior in either iOS.

In all cases, clicking turns the control blue (our hover state), although in 
iOS 9 when the action completes, the control turns back to white.

> On Oct 20, 2016, at 17:52 , Rick Mann <rm...@latencyzero.com> wrote:
> 
> We have a complex WebGL app that has some controls defined via HTML elements. 
> We use this code both on the web, and in an iOS app inside a WKWebView. We 
> recently added tooltips (as a title attribute on an  element), and now the 
> first tap brings up the tooltip. Subsequent taps actuate the control. Tapping 
> the tooltip hides it.
> 
> But this only happens in my WKWebView version of the app. Loading the same 
> app via Safari on iOS doesn't exhibit this behavior.
> 
> I've tried googling for an answer, but so far nothing.
> 
> Any ideas? Thanks.
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


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

WKWebView and tooltips

2016-10-20 Thread Rick Mann
We have a complex WebGL app that has some controls defined via HTML elements. 
We use this code both on the web, and in an iOS app inside a WKWebView. We 
recently added tooltips (as a title attribute on an  element), and now the 
first tap brings up the tooltip. Subsequent taps actuate the control. Tapping 
the tooltip hides it.

But this only happens in my WKWebView version of the app. Loading the same app 
via Safari on iOS doesn't exhibit this behavior.

I've tried googling for an answer, but so far nothing.

Any ideas? Thanks.

-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Xcode 8 causes scroll issue when displaying keyboard

2016-10-11 Thread Rick Mann
Yeah, thanks to Graham for suggesting using viewDidLoad(). That fixed it. 
What's annoying and disturbing is this: It worked before the storyboard was 
touched by Xcode 8. No changes, just whatever IB does when you open a file in 
it.

Same behavior on 8.4, 9.3, and 10.0.

> On Oct 11, 2016, at 20:37 , Carl Hoefs <newsli...@autonomy.caltech.edu> wrote:
> 
> Rick,
> 
> I think I may have encountered similar issues. -viewWillAppear: occurs very 
> early in the view instantiation process, too early for certain things to 
> execute successfully, and so it's likely that becomeFirstResponder() may not 
> work properly or reliably from -viewWillAppear:. I solved my issues by using 
> -viewDidAppear: or -viewDidLoad, both of which also execute on the main 
> thread, but later in the view instantiation process.
> 
> -Carl
> 
>> On Oct 11, 2016, at 6:29 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> Ah, it happens because we call becomeFirstResponder() on the first text 
>> field while in viewWillAppear(). Dispatching that on the main queue 
>> asynchronously fixes the problem, but ugh it's so hacky.
> 


-- 
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: Xcode 8 causes scroll issue when displaying keyboard

2016-10-11 Thread Rick Mann
Ah, it happens because we call becomeFirstResponder() on the first text field 
while in viewWillAppear(). Dispatching that on the main queue asynchronously 
fixes the problem, but ugh it's so hacky.

> On Oct 11, 2016, at 17:58 , Rick Mann <rm...@latencyzero.com> wrote:
> 
> We have a complex storyboard-based iPad app, but this problem only reared its 
> head when we upgraded to Xcode 8.
> 
> In our app, we display a modal form sheet that consists of a 
> UINavigationController with a UITableViewController (over a 
> UICollectionViewController) that contains a bunch of fields for the user to 
> fill out. The first field is automatically focused, and that causes the 
> keyboard to slide up.
> 
> This in turn causes the form sheet to slide up a bit. So far, no problem. But 
> if the storyboard has ever been opened in Xcode 8, even if no explicit 
> changes are made, then the contents of this form sheet are scrolled up so far 
> that they're completely off the top of the sheet (and thus, invisible to the 
> user).
> 
> Any touch in the form sheet causes the contents to snap back into position. 
> The table needs to be scollable because it's too large to fit on screen with 
> the keyboard.
> 
> This is clearly a bug, but I'm looking for a workaround.
> 
> Any ideas? Thanks!
> 
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
> 
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/rmann%40latencyzero.com
> 
> This email sent to rm...@latencyzero.com


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

Xcode 8 causes scroll issue when displaying keyboard

2016-10-11 Thread Rick Mann
We have a complex storyboard-based iPad app, but this problem only reared its 
head when we upgraded to Xcode 8.

In our app, we display a modal form sheet that consists of a 
UINavigationController with a UITableViewController (over a 
UICollectionViewController) that contains a bunch of fields for the user to 
fill out. The first field is automatically focused, and that causes the 
keyboard to slide up.

This in turn causes the form sheet to slide up a bit. So far, no problem. But 
if the storyboard has ever been opened in Xcode 8, even if no explicit changes 
are made, then the contents of this form sheet are scrolled up so far that 
they're completely off the top of the sheet (and thus, invisible to the user).

Any touch in the form sheet causes the contents to snap back into position. The 
table needs to be scollable because it's too large to fit on screen with the 
keyboard.

This is clearly a bug, but I'm looking for a workaround.

Any ideas? Thanks!


-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Playground gets permission error

2016-09-30 Thread Rick Mann
I'm testing some code I wrote to set the isExcludedFromBackup flag on a URL. I 
tried putting the code into a playground to test various uses of it. But when 
it goes to set the flag, it gets an error:

Error setting isExcludedFromBackup: Error Domain=NSCocoaErrorDomain Code=513 
"You don’t have permission to save the file “test” in the folder “rmann”." 
UserInfo={NSURLUnsetValueKeysKey=(
NSURLIsExcludedFromBackupKey
), NSURL=file:///Users/rmann/test/, NSFilePath=/Users/rmann/test, 
NSUnderlyingError=0x6005f7d0 {Error Domain=NSPOSIXErrorDomain Code=1 
"Operation not permitted"}}

The code is basically:

var vals = URLResourceValues()
vals.isExcludedFromBackup = true
try url.setResourceValues(vals)

The folder I'm setting it on is in my home directory.

It's an iOS playground.

Any ideas? Thanks.

-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: URL.setResourceValues() in Swift 3

2016-09-29 Thread Rick Mann

> On Sep 29, 2016, at 10:54 , Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> On Sep 29, 2016, at 04:18 , Rick Mann <rm...@latencyzero.com> wrote:
>> 
>> var vals = URLResourceValues()
>> vals.isExcludedFromBackup = true
>> try destURL.setResourceValues(vals)
>> 
>> But I get "Cannot convert value of type 'URLResourceValues' to expected 
>> argument type '[URLResourceKey : AnyObject]'" on the "vals" argument. The 
>> problem is that the docs say it's supposed to take [URLResourceKey : Any].
>> 
>> The Swift interface file generated by Xcode looks like this:
>> 
>>public mutating func setResourceValues(_ values: URLResourceValues) throws
>> 
>> But that's clearly not what the compiler sees.
> 
> What is the type of ‘destURL’? URL or NSURL? It sounds like it’s NSURL.

Nope, it's URL.

> The function signature in class NSURL is:
> 
>>  func setResourceValues([URLResourceKey : Any])
> 
> whereas the function signature in class URL is:
> 
>>  func setResourceValues(_ values: URLResourceValues)
> 
> So, you either need to change destURL to be a URL, or use the NSURL API that 
> takes a dictionary. Note that URL is not just a cosmetic renaming of NSURL in 
> Swift 3, but a whole new type that wraps a NSURL object. Both types are 
> accessible, though you’re going to have the best Swift 3 experience if you 
> switch to URL — and its altered API and semantics.
> 
> Regarding Any vs. AnyObject as the dictionary value, the error message I get 
> (in Xcode 8.1 beta, with the above code) is:
> 
>>  Cannot convert value of type 'URLResourceValues' to expected argument 
>> type '[URLResourceKey : Any]’
> 
> So, you’re either not compiling against the 10.12 SDK (which I think should 
> be impossible), or you’re compiling as Swift 2.3, or Xcode at least thinks 
> you are.

So, it turns out, destURL was a let, not a var. That made the difference. Sure 
seems like a bad diagnostic.

However, there's also a problem in that the documentation in Xcode 8 is:

func setResourceValues(_ keyedValues: [URLResourceKey : Any]) throws

But the Xcode generated interface shows it as:

public mutating func setResourceValues(_ values: URLResourceValues) 
throws

And incidentally, it seems Xcode's code completion still isn't reliable, in 
that I can command-click on URL, but not on setResourceValues (I just get a ? 
appearing).

I'll write a bug.

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

URL.setResourceValues() in Swift 3

2016-09-29 Thread Rick Mann
I don't know if Xcode 8 just has more bugs showing headers, or what. But I'm 
trying to make this call, as documented in the docs:


let _ = fm.createIntermediateDirectories(destURL)
try destURL.setResourceValues([. isExcludedFromBackup : true])

But I get "Value of type 'Bool' does not conform to expected dictionary value 
type 'AnyObject'" on the true. So I tried:

var vals = URLResourceValues()
vals.isExcludedFromBackup = true
try destURL.setResourceValues(vals)

But I get "Cannot convert value of type 'URLResourceValues' to expected 
argument type '[URLResourceKey : AnyObject]'" on the "vals" argument. The 
problem is that the docs say it's supposed to take [URLResourceKey : Any].

The Swift interface file generated by Xcode looks like this:

public mutating func setResourceValues(_ values: URLResourceValues) throws

But that's clearly not what the compiler sees.

Damn these bugs really suck.

Anyone know how to make this call work?

Thanks.


-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Can't convert to swift 3 and support

2016-09-09 Thread Rick Mann
It sure seems like converting to Swift 3 and iOS 10 forces you to abandon 
previous OS releases. For example, I have this code:

var val: AnyObject?
try getResourceValue(, forKey: URLResourceKey.isDirectoryKey)

I get this error:

'getResourceValue(_:forKey:)' is unavailable: Use
struct URLResourceValues and URL.setResourceValues(_:)
instead

Problem is, that only exists on iOS 10.

Am I screwed?

-- 
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: More Provisioning woes

2016-09-08 Thread Rick Mann
It's possible someone deleted it a while back, but all the Profiles stayed 
valid because they copied the info, until it expired. We did do a big purge a 
while back, but I'm pretty sure we've added devices since then, which would've 
require re-creating the Profiles.

In any case, I wish there was more explicit information in Portal (and Xcode). 
E.g.: timestamps for creation as well as expiry, including time to seconds (not 
just date); list all Certs/Profiles, marked as revoked or deleted, with some 
easy filtering; show Profile IDs (that short hex string that sometimes 
appears); show App ID, etc.

> On Sep 8, 2016, at 16:20 , Alex Zavatone <z...@mac.com> wrote:
> 
> Yeah, I'm concerned that "things", resources we need in our dev accounts 
> magically disappeared.
> 
> I just care that a person who is not me also saw stuff go missing in their 
> dev account.
> 
> And you're the first data point that I've seen.
> 
> 
> 
> 
> On Sep 8, 2016, at 6:09 PM, Rick Mann wrote:
> 
>> Not my Profiles. My distribution Certificate.
>> 
>>> On Sep 8, 2016, at 16:05 , Alex Zavatone <z...@mac.com> wrote:
>>> 
>>> Yeah, that is what happened to our provisioning profiles.  Just gone.
>>> 
>>> 
>>> On Sep 8, 2016, at 6:04 PM, Rick Mann wrote:
>>> 
>>>> In my case, it turns out all the expired profiles are also Distribution, 
>>>> not Development, Profiles. For some reason, our Distribution Certificate 
>>>> is completely gone (rather than being there but expired).
>>>> 
>>>> So, it took me a while to figure out what was going on. Be nice if the 
>>>> error would say, "No DISTRIBUTION certificates found."
>>>> 
>>>> Why the Dist cert is missing, I don't know.
>>>> 
>>>>> On Sep 8, 2016, at 16:02 , Alex Zavatone <z...@mac.com> wrote:
>>>>> 
>>>>> OKOKOKOKOK
>>>>> 
>>>>> Did this happen to ANYONE ELSE?
>>>>> 
>>>>> Today, I discovered that bunch of our iOS provisioning profiles are just 
>>>>> missing.  Myself and my boss are the only two with the permission to nuke 
>>>>> these and we both don't want to make our lives any more hellish.
>>>>> 
>>>>> Development provisioning profiles for apps that were created this year 
>>>>> and other apps that we have in the iOS App Store just are gone.
>>>>> 
>>>>> Did this happening to anyone else?
>>>>> 
>>>>> 
>>>>> 
>>>>> On Sep 8, 2016, at 5:33 PM, Rick Mann wrote:
>>>>> 
>>>>>> Today a bunch of our Profiles expired. Normally I just re-generate them, 
>>>>>> but now I can't. The Portal says they all lack Certificates. Thing is, 
>>>>>> we still have two Certificates (one for each developer), that have NOT 
>>>>>> expired, in the Portal.
>>>>>> 
>>>>>> To confuse matters further, the one Profile that has not yet expired 
>>>>>> contains those two developer Certificates and seems fine with them.
>>>>>> 
>>>>>> I was able to make a new Development Certificate for myself, but now I 
>>>>>> have two in the Portal. That new one is acceptable to the Portal for the 
>>>>>> Profiles.
>>>>>> 
>>>>>> Has something changed? What's happening here? Googling only turned up 
>>>>>> very old similar questions.
>>>>>> 
>>>>>> Thanks,
>>>>>> 
>>>>>> 
>>>>>> -- 
>>>>>> Rick Mann
>>>>>> rm...@latencyzero.com
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> ___
>>>>>> 
>>>>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>>>>> 
>>>>>> Please do not post admin requests or moderator comments to the list.
>>>>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>>>> 
>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
>>>>>> 
>>>>>> This email sent to z...@mac.com
>>>>> 
>>>> 
>>>> 
>>>> -- 
>>>> Rick Mann
>>>> rm...@latencyzero.com
>>>> 
>>>> 
>>> 
>> 
>> 
>> -- 
>> Rick Mann
>> rm...@latencyzero.com
>> 
>> 
> 


-- 
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: More Provisioning woes

2016-09-08 Thread Rick Mann
Not my Profiles. My distribution Certificate.

> On Sep 8, 2016, at 16:05 , Alex Zavatone <z...@mac.com> wrote:
> 
> Yeah, that is what happened to our provisioning profiles.  Just gone.
> 
> 
> On Sep 8, 2016, at 6:04 PM, Rick Mann wrote:
> 
>> In my case, it turns out all the expired profiles are also Distribution, not 
>> Development, Profiles. For some reason, our Distribution Certificate is 
>> completely gone (rather than being there but expired).
>> 
>> So, it took me a while to figure out what was going on. Be nice if the error 
>> would say, "No DISTRIBUTION certificates found."
>> 
>> Why the Dist cert is missing, I don't know.
>> 
>>> On Sep 8, 2016, at 16:02 , Alex Zavatone <z...@mac.com> wrote:
>>> 
>>> OKOKOKOKOK
>>> 
>>> Did this happen to ANYONE ELSE?
>>> 
>>> Today, I discovered that bunch of our iOS provisioning profiles are just 
>>> missing.  Myself and my boss are the only two with the permission to nuke 
>>> these and we both don't want to make our lives any more hellish.
>>> 
>>> Development provisioning profiles for apps that were created this year and 
>>> other apps that we have in the iOS App Store just are gone.
>>> 
>>> Did this happening to anyone else?
>>> 
>>> 
>>> 
>>> On Sep 8, 2016, at 5:33 PM, Rick Mann wrote:
>>> 
>>>> Today a bunch of our Profiles expired. Normally I just re-generate them, 
>>>> but now I can't. The Portal says they all lack Certificates. Thing is, we 
>>>> still have two Certificates (one for each developer), that have NOT 
>>>> expired, in the Portal.
>>>> 
>>>> To confuse matters further, the one Profile that has not yet expired 
>>>> contains those two developer Certificates and seems fine with them.
>>>> 
>>>> I was able to make a new Development Certificate for myself, but now I 
>>>> have two in the Portal. That new one is acceptable to the Portal for the 
>>>> Profiles.
>>>> 
>>>> Has something changed? What's happening here? Googling only turned up very 
>>>> old similar questions.
>>>> 
>>>> Thanks,
>>>> 
>>>> 
>>>> -- 
>>>> Rick Mann
>>>> rm...@latencyzero.com
>>>> 
>>>> 
>>>> 
>>>> ___
>>>> 
>>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>>> 
>>>> Please do not post admin requests or moderator comments to the list.
>>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>>> 
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
>>>> 
>>>> This email sent to z...@mac.com
>>> 
>> 
>> 
>> -- 
>> Rick Mann
>> rm...@latencyzero.com
>> 
>> 
> 


-- 
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: More Provisioning woes

2016-09-08 Thread Rick Mann
In my case, it turns out all the expired profiles are also Distribution, not 
Development, Profiles. For some reason, our Distribution Certificate is 
completely gone (rather than being there but expired).

So, it took me a while to figure out what was going on. Be nice if the error 
would say, "No DISTRIBUTION certificates found."

Why the Dist cert is missing, I don't know.

> On Sep 8, 2016, at 16:02 , Alex Zavatone <z...@mac.com> wrote:
> 
> OKOKOKOKOK
> 
> Did this happen to ANYONE ELSE?
> 
> Today, I discovered that bunch of our iOS provisioning profiles are just 
> missing.  Myself and my boss are the only two with the permission to nuke 
> these and we both don't want to make our lives any more hellish.
> 
> Development provisioning profiles for apps that were created this year and 
> other apps that we have in the iOS App Store just are gone.
> 
> Did this happening to anyone else?
> 
> 
> 
> On Sep 8, 2016, at 5:33 PM, Rick Mann wrote:
> 
>> Today a bunch of our Profiles expired. Normally I just re-generate them, but 
>> now I can't. The Portal says they all lack Certificates. Thing is, we still 
>> have two Certificates (one for each developer), that have NOT expired, in 
>> the Portal.
>> 
>> To confuse matters further, the one Profile that has not yet expired 
>> contains those two developer Certificates and seems fine with them.
>> 
>> I was able to make a new Development Certificate for myself, but now I have 
>> two in the Portal. That new one is acceptable to the Portal for the Profiles.
>> 
>> Has something changed? What's happening here? Googling only turned up very 
>> old similar questions.
>> 
>> Thanks,
>> 
>> 
>> -- 
>> Rick Mann
>> rm...@latencyzero.com
>> 
>> 
>> 
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>> 
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/zav%40mac.com
>> 
>> This email sent to z...@mac.com
> 


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

  1   2   3   4   5   6   7   8   9   10   >