Re: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Gary L. Wade
In a Terminal window, start off with this command:

find /Applications/Xcode.app/Contents/Developer/Platforms -type f -print0 | 
xargs -0 grep FOUNDATION_EXPORT

Then go to opensource.apple.com and look around.

Note those are zeros, not capital O's if you type the command out vs copy/paste.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Apr 19, 2016, at 11:11 AM, Alex Zavatone <z...@mac.com> wrote:
> 
> 
>> On Apr 19, 2016, at 1:38 PM, Gary L. Wade wrote:
>> 
>> Another thing I do is add FOUNDATION_EXPORT before my constants in headers, 
>> which will give you the right stuff whether C or C++; C++ name mangling is a 
>> common reason for odd link errors if you include a header in a 
>> C++/Objective-C++ source file.
>> 
>> I'm sure you can find examples of this in open source, and Apple's own open 
>> source has these, too. If something isn't working, you're better off showing 
>> concrete examples from here on out.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
> 
> I've looked all around for this, have been pulled of on to other projects and 
> am back trying to get this to work.  I can't find this explained anywhere.
> 
>>> On Apr 19, 2016, at 10:20 AM, Alex Zavatone <z...@mac.com> wrote:
>>> 
>>> 
>>>> On Apr 16, 2016, at 7:19 AM, Uli Kusterer wrote:
>>>> 
>>>> A precompiled prefix header is a compile-time construct that only applies 
>>>> to the interior of your framework. You can't really tell people linking to 
>>>> your framework to add a certain prefix header. So you can use a pch for 
>>>> actually writing the framework implementation,
>>> 
>>> That is all I am trying to accomplish.
>>> 
>>> So, since we have to create a constants file in a framework with .h and .m 
>>> files, I've never seen a .m compliment to a .pch.  I have no idea how this 
>>> would work at all or how I would be able to set this up.
>>> 
>>> What I am trying to achieve is simply declare constants for all my classes 
>>> within a framework (and only for the framework) and do it in one spot.  
>>> 
>>> It is my understanding that in a framework we need .h and .m files to 
>>> declare the constants and I have set these up.
>>> 
>>> Now, I am trying to get this constants.m imported in one area that will 
>>> allow every class within my framework to have access to them.
>>> 
>>> Thanks, Uli.
> 


___

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: Proper way to set up constants when building an iOS framework

2016-04-19 Thread Gary L. Wade
Another thing I do is add FOUNDATION_EXPORT before my constants in headers, 
which will give you the right stuff whether C or C++; C++ name mangling is a 
common reason for odd link errors if you include a header in a 
C++/Objective-C++ source file.

I'm sure you can find examples of this in open source, and Apple's own open 
source has these, too. If something isn't working, you're better off showing 
concrete examples from here on out.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Apr 19, 2016, at 10:20 AM, Alex Zavatone <z...@mac.com> wrote:
> 
> 
>> On Apr 16, 2016, at 7:19 AM, Uli Kusterer wrote:
>> 
>> A precompiled prefix header is a compile-time construct that only applies to 
>> the interior of your framework. You can't really tell people linking to your 
>> framework to add a certain prefix header. So you can use a pch for actually 
>> writing the framework implementation,
> 
> That is all I am trying to accomplish.
> 
> So, since we have to create a constants file in a framework with .h and .m 
> files, I've never seen a .m compliment to a .pch.  I have no idea how this 
> would work at all or how I would be able to set this up.
> 
> What I am trying to achieve is simply declare constants for all my classes 
> within a framework (and only for the framework) and do it in one spot.  
> 
> It is my understanding that in a framework we need .h and .m files to declare 
> the constants and I have set these up.
> 
> Now, I am trying to get this constants.m imported in one area that will allow 
> every class within my framework to have access to them.
> 
> Thanks, Uli.


___

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 the first of March a Tuesday

2016-03-25 Thread Gary L. Wade
The documentation needs to be more descriptive. The word "wrap" in the name of 
the option should fill in the missing reason. Feel free to file a radar.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Mar 25, 2016, at 9:09 AM, Gerriet M. Denkmann <gerr...@mdenkmann.de> wrote:
> 
> 
>>> On 25 Mar 2016, at 23:01, Clark Cox <clarkc...@gmail.com> wrote:
>>> 
>>> 
>>> On Mar 25, 2016, at 08:43, Gerriet M. Denkmann <gerr...@mdenkmann.de> wrote:
>>> 
>>> In my calendar 2016/3/1 is a Friday, but:
>> 
>> 
>> Something's wrong with your calendar then :). March 1, 2016 *is* a Tuesday:
> 
> Yes, sorry for the noise.
> I was adding 7 days to today and got 1. of March but expected 1. of April. 
> (see my post about adding days).
> 
> Turns out that NSCalendarWrapComponents = “Specifies that the operation 
> should use arithmetic for calendar addition.” is the wrong choice.
> Without using “arithmetic" (instead using divination ?) I get the expected 
> result.
> 
> Kind regards
> 
> Gerriet.
> 
>> 
>> % cal
>> March 2016
>> Su Mo Tu We Th Fr Sa
>>   1  2  3  4  5
>> 6  7  8  9 10 11 12
>> 13 14 15 16 17 18 19
>> 20 21 22 23 24 25 26
>> 27 28 29 30 31
>> 
>> 
>>> 
>>> - (NSString *)timerStringFor: (NSDate *)date
>>> {
>>>NSDateFormatter *dateFormatter = [ [ NSDateFormatter alloc ] init];
>>>dateFormatter.dateFormat = @"EEE dd MMM  HH:mm:ss ZZZ";
>>>NSString *un = [ dateFormatter stringFromDate: date ];
>>>NSLog(@"%s %@",__FUNCTION__, un);//Tue 01 Mar 2016 01:00:00 +0700
>>>return un;
>>> }
>>> 
>>> prints “Tue 01 Mar 2016 01:00:00 +0700”
>>> 
>>> What am I doing wrong?
>>> 
>>> Gerriet.
>>> 
>>> Mac OS X 10.10.5
>>> 


___

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: Storyboard weakness

2016-03-09 Thread Gary L. Wade
Write a bug like I did saying how difficult it is using Interface Builder to 
construct the UI you desire. Give as concrete an example as you can, and if 
you've seen an Apple app do similar, mention it. If you've seen a third party 
app do it, mention it, too. Sometimes you'll get some free tech support from 
your radar (I did for one tricky auto layout issue), sometimes you'll get 
ignored. You get nothing if you report nothing.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Mar 9, 2016, at 5:23 PM, Rick Mann <rm...@latencyzero.com> wrote:
> 
> I might be able to require iOS 9. But of course that doesn't really address 
> the overarching issue that prevents any non-trivial use of these tools and 
> APIs.

___

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: Storyboard weakness

2016-03-09 Thread Gary L. Wade
If you can require iOS 9, pinning appears to be supported. If earlier, you 
might be able to do what you want by overriding a layout class. I haven't tried 
it myself, though. I know your pain with respect to a UITabBarController, 
though, but that was easy to re-enclose in another view, although I had to do 
it in code.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Mar 9, 2016, at 5:06 PM, Rick Mann <rm...@latencyzero.com> wrote:
> 
> Supplementary views scroll with the content. I want non-scrolling views.

___

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: Storyboard weakness

2016-03-09 Thread Gary L. Wade
I'm not sure exactly about your layout, but maybe what you want are 
supplementary views?
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Mar 9, 2016, at 3:04 PM, Rick Mann <rm...@latencyzero.com> wrote:
> 
> There's a severe weakness in Storyboards for which I'm hoping a better 
> solution exists.
> 
> When you create a scene for say, a UICollectionView, the Storyboard makes it 
> very easy, but it also imposes a severe limitation. In my case, my 
> UICollectionViewController subclass lives inside a UINavigationController. It 
> manages the controls in the toolbar and the title, as well as the content.
> 
> But inevitably I want to add additional views beneath the UINavigationBar 
> that are NOT CONTAINED within the UICollectionView (in this case, a 
> UISegmentedControl for sorting the contents). The only way I see how to do 
> this with Storyboards is to create two view controllers, one that embeds the 
> UICollectionViewController subclass. But now its impossible to wire up 
> UINavigationBar items to it. I've been forced to split up view control across 
> two view controllers that really should be one.
> 
> This is solved by having the UICollectionView controller subclass have its 
> view property point to a generic containing view, and its collectionView 
> property point to the collectionView subview. But it's not really designed to 
> work this way, and Storyboards definitely doesn't support this.
> 
> The Apple-provided way imposes a HUGE burden.
> 
> Is there any happy middle ground?
> 
> I've written this bug before, but Apple doesn't care.
> 
> -- 
> 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: Apple Bug no response

2016-03-09 Thread Gary L. Wade
My oldest open bug will be 10 years old by WWDC 2016.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Mar 9, 2016, at 12:50 PM, Eric E Dolecki <edole...@gmail.com> wrote:
> 
> I have bugs that have celebrated their fifth birthdays. Fire and forget. 
> 
> Sent from my iP6+
> 
>> On Mar 9, 2016, at 3:44 PM, Hunter Hillegas <li...@lastonepicked.com> wrote:
>> 
>> You must be new here. ;-)
>> 
>> You might get an automated email when a future build is available asking you 
>> to re-test. You may get a note that your bug is a duplicate. You may never 
>> get a response at all.
>> 
>> I have many open bugs from years back which usually either means the issue 
>> is still out there or it was fixed but the screeners didn’t wire up the bug 
>> in a way that they know my issue was resolved.
>> 
>> Apple has said (Craig F. on The Talk Show recently) that this is a place 
>> they know they have room to improve.
>> 
>>> On Mar 9, 2016, at 12:32 PM, Trygve Inda <cocoa...@xericdesign.com> wrote:
>>> 
>>> I have an open bug report
>>> 
>>> How long should I expect to wait for a response?
>> 

___

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: Starting out with storyboards (on Mac)

2016-03-05 Thread Gary L. Wade
> On Mar 2, 2016, at 11:20 AM, Bill Cheeseman <wjcheese...@gmail.com> wrote:
> 
> Broadening my horizons is *always* one of my purposes.

Sounds like your book will be getting a sequel by the end of it? Swift Cocoa 
Recipes for Apple Platforms?
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.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: Customizing a UISwitch?

2016-03-04 Thread Gary L. Wade
That and the text are the backing objects used to present the various states. 
Nice to do non-state stuff to them but don't do state stuff to them.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Mar 4, 2016, at 4:01 PM, Carl Hoefs <newsli...@autonomy.caltech.edu> wrote:
> 
> Bingo! -setImage:forState: UIControlStateNormal works perfectly. Not sure 
> what setImage: is doing.
> Thx Gary & Eric!
> -Carl
> 
> 
>> On Mar 4, 2016, at 4:55 PM, Gary L. Wade <garyw...@desisoftsystems.com> 
>> wrote:
>> 
>> Look instead at the set…:forState: methods.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
>> 
>>> On Mar 4, 2016, at 3:40 PM, Carl Hoefs <newsli...@autonomy.caltech.edu> 
>>> wrote:
>>> 
>>> I replaced the UISwitch with a UIButton. But when I set the button's new 
>>> image in the event method (myButton.imageView.image = ...), still nothing 
>>> happens (the button's image doesn't redraw). What do I have to do to cause 
>>> this to happen?
>>> -Carl
>>> 
>>>> On Mar 4, 2016, at 2:00 PM, Gary L. Wade <garyw...@desisoftsystems.com> 
>>>> wrote:
>>>> 
>>>> Maybe the docs should say iOS 7 and later since that's what it means. You 
>>>> can't do this in 7, 8, 9, or X/10/whatever iOS is coming this fall. It 
>>>> shouldn't be hard to roll your own UIControl subclass or work with the 
>>>> current classes.
>>>> --
>>>> Gary L. Wade (Sent from my iPhone)
>>>> http://www.garywade.com/
>>>> 
>>>>> On Mar 4, 2016, at 11:10 AM, Carl Hoefs <newsli...@autonomy.caltech.edu> 
>>>>> wrote:
>>>>> 
>>>>> iOS 9.2
>>>>> 
>>>>> The 2016 Apple documentation shows UISwitch -onImage and -offImage 
>>>>> properties. They're not noted as deprecated, except for iOS 7, yet they 
>>>>> don't seem to do anything on iOS9. Xcode shows these properties to be 
>>>>> settable. I have set them both, in Xcode and in my app code, but they 
>>>>> seem to have no effect on the storyboard or when running the app.
>>>>> 
>>>>> What's the trick in customizing a UISwitch with different images? If this 
>>>>> functionality is busted, is there another way to achieve it? I don't see 
>>>>> an on/off style button in the palette.
>>>>> -Carl
> 

___

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: Customizing a UISwitch?

2016-03-04 Thread Gary L. Wade
Look instead at the set…:forState: methods.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Mar 4, 2016, at 3:40 PM, Carl Hoefs <newsli...@autonomy.caltech.edu> wrote:
> 
> I replaced the UISwitch with a UIButton. But when I set the button's new 
> image in the event method (myButton.imageView.image = ...), still nothing 
> happens (the button's image doesn't redraw). What do I have to do to cause 
> this to happen?
> -Carl
> 
>> On Mar 4, 2016, at 2:00 PM, Gary L. Wade <garyw...@desisoftsystems.com> 
>> wrote:
>> 
>> Maybe the docs should say iOS 7 and later since that's what it means. You 
>> can't do this in 7, 8, 9, or X/10/whatever iOS is coming this fall. It 
>> shouldn't be hard to roll your own UIControl subclass or work with the 
>> current classes.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
>> 
>>> On Mar 4, 2016, at 11:10 AM, Carl Hoefs <newsli...@autonomy.caltech.edu> 
>>> wrote:
>>> 
>>> iOS 9.2
>>> 
>>> The 2016 Apple documentation shows UISwitch -onImage and -offImage 
>>> properties. They're not noted as deprecated, except for iOS 7, yet they 
>>> don't seem to do anything on iOS9. Xcode shows these properties to be 
>>> settable. I have set them both, in Xcode and in my app code, but they seem 
>>> to have no effect on the storyboard or when running the app.
>>> 
>>> What's the trick in customizing a UISwitch with different images? If this 
>>> functionality is busted, is there another way to achieve it? I don't see an 
>>> on/off style button in the palette.
>>> -Carl
> 

___

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: Customizing a UISwitch?

2016-03-04 Thread Gary L. Wade
Maybe the docs should say iOS 7 and later since that's what it means. You can't 
do this in 7, 8, 9, or X/10/whatever iOS is coming this fall. It shouldn't be 
hard to roll your own UIControl subclass or work with the current classes.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Mar 4, 2016, at 11:10 AM, Carl Hoefs <newsli...@autonomy.caltech.edu> 
> wrote:
> 
> iOS 9.2
> 
> The 2016 Apple documentation shows UISwitch -onImage and -offImage 
> properties. They're not noted as deprecated, except for iOS 7, yet they don't 
> seem to do anything on iOS9. Xcode shows these properties to be settable. I 
> have set them both, in Xcode and in my app code, but they seem to have no 
> effect on the storyboard or when running the app.
> 
> What's the trick in customizing a UISwitch with different images? If this 
> functionality is busted, is there another way to achieve it? I don't see an 
> on/off style button in the palette.
> -Carl
> 

___

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

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

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

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

Re: How to write an RSS client for iOS

2016-02-13 Thread Gary L. Wade
For dates, you can try using NSDataDetector, but I’ve found recently that it 
doesn’t work well if you only have a date or a time, only if you have both; it 
adds a placeholder value in those cases and doesn’t report that you only have 
one or the other.  In the case for RSS feeds, though, you shouldn’t have that 
issue unless you’re using it on content, but keep that in mind.

And, if anyone else finds the same need from NSDataDetector as me, please join 
me in writing a bug requesting this to be fixed in the next OSes and documented 
how we can make some use of NSDataDetector in the current and prior versions (I 
have personally figured this out already, but it’s fragile and not the best or 
supported practice).  Note that my bug has already been duplicated, probably 
from my initial tech support incident, and this helps get it prioritized higher.
—
Gary

> On Feb 13, 2016, at 10:44 AM, Jens Alfke  wrote:
> 
> There are other “fun” details, like parsing dates — the different specs call 
> for different date formats, and many feeds just ignore those and emit some 
> other date format, which makes parsing them really difficult. Our code ended 
> up with a list of about 20(!) date-format strings and tried them one after 
> the other.

___

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

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

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

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

Re: How to write an RSS client for iOS

2016-02-13 Thread Gary L. Wade
Cool.  Hopefully it’ll be in the next release, so keep adding bug reports.  I 
didn’t want to write another regular expression to do something the class 
already does and get it wrong; if I do that, I might as well not even use 
NSDataDetector.  In case you’re curious, Xcode, while debugging some runtime 
environments, will give you the info that’s really useful for such result 
objects.
—
Gary

> On Feb 13, 2016, at 1:18 PM, Alex Kac <a...@fanaticsoftware.com> wrote:
> 
> We had the same issue and what we do is we look at the data detector match 
> string, determine if its date or time only using several techniques including 
> a regex…and go from there. Its not perfect, but it works relatively well.
> 
> We do have a radar on the need to know if it found a date or date/time. 
> Ideally I’d like to get NSDateComponents back from the data detector so we 
> know what was found.
> 
>> On Feb 13, 2016, at 1:16 PM, Gary L. Wade <garyw...@desisoftsystems.com> 
>> wrote:
>> 
>> For dates, you can try using NSDataDetector, but I’ve found recently that it 
>> doesn’t work well if you only have a date or a time, only if you have both; 
>> it adds a placeholder value in those cases and doesn’t report that you only 
>> have one or the other.  In the case for RSS feeds, though, you shouldn’t 
>> have that issue unless you’re using it on content, but keep that in mind.
>> 
>> And, if anyone else finds the same need from NSDataDetector as me, please 
>> join me in writing a bug requesting this to be fixed in the next OSes and 
>> documented how we can make some use of NSDataDetector in the current and 
>> prior versions (I have personally figured this out already, but it’s fragile 
>> and not the best or supported practice). Note that my bug has already been 
>> duplicated, probably from my initial tech support incident, and this helps 
>> get it prioritized higher.
>> —
> 
> 
> Alex Kac - El capitán
> 


___

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: PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-10 Thread Gary L. Wade
I just checked to see what happens when visiting your web site at 
https://xenonium.com and found on the current latest release of iOS and OS X 
under Safari I get a "Cannot Verify Server Identity" alert, so maybe you set it 
up wrong, support for that authority is forthcoming, or you get what you pay 
for. Some users will say, "Whoa!" and run away fast.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Feb 10, 2016, at 2:58 PM, Jean-Daniel Dupas <mail...@xenonium.com> wrote:
> 
> 
>>> Le 10 févr. 2016 à 05:48, Trygve Inda <cocoa...@xericdesign.com> a écrit :
>>> 
>>> If your hosting provider still charges an arm and a leg for SSL, switch.
>> 
>> I need SSL for multiple subdomains. My host (Pair Networks) charges $449/yr
>> for such a certificate. That seems really expensive. What are others paying
>> for this? I have been very happy with Pair as we run a complex server setup
>> with multiple cron jobs, custom C programs etc.
> 
> I pay 0$ and can have as many domains as I want on my certificactes. I’m 
> using let'sencrypt  for all my servers. It requires some setup but it’s free 
> and works very well.
> 
> https://letsencrypt.org <https://letsencrypt.org/>
> 
>> I also see no way to add an SSL certificate to a CNAME'd site at Amazon S3:
>> 
>> download.xericdesign.com CNAME
>> s3.amazonaws.com/download.xericdesign.com/
>> 
>> Trygve
>> 

___

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: PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-10 Thread Gary L. Wade
You've made my point. None of my friends would even bother with looking at the 
certificate for his site (assuming that's his site from his email address) and 
move on. At worst, they'd call me and I'd say don't go there since I don't want 
them to screenshot that and text it to me to figure it out.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Feb 10, 2016, at 4:50 PM, Ben Kennedy <b...@zygoat.ca> wrote:
> 
> If you actually took a look at the details, you'd see that the cert is for 
> "ssl13.ovh.net" rather than "xenonium.com".  If you visit 
> https://ssl13.ovh.net in Safari you will see no such problem.
> 
> Jean-Daniel did not expressly state that he's trying to serve anything at 
> https://xenonium.com.
> 
> -b
> 
>> On 10 Feb 2016, at 4:35 pm, Gary L. Wade <garyw...@desisoftsystems.com> 
>> wrote:
>> 
>> I just checked to see what happens when visiting your web site at 
>> https://xenonium.com and found on the current latest release of iOS and OS X 
>> under Safari I get a "Cannot Verify Server Identity" alert, so maybe you set 
>> it up wrong, support for that authority is forthcoming, or you get what you 
>> pay for. Some users will say, "Whoa!" and run away fast.
> 

___

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: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Gary L. Wade
You're not alone. I see this every so often and just make do with the console 
view to see what I need (po is your friend). If you have more than one project 
open, you might try closing those before restarting Xcode. Another flake that 
Xcode has is putting the wrong project's source file in the Debug tab, a 
problem exacerbated by some of the projects I open from others who never 
bothered to change the names of their source files from template names; the 
worst offender is ViewController.m.

The only way to fix this is to file a bug against Xcode in 
http://bugreport.apple.com/ and wait for it to be marked as a duplicate and 
hope it gets fixed by Xcode 8.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Feb 4, 2016, at 6:59 AM, Dave <d...@looktowindward.com> wrote:
> 
> XCode 7.2 (7C68).
> Mac OS X (not iOS).
> 
> Hi,
> 
> I sent the following message to the XCode List, but now I’m wondering if 
> there is a bug in my code that is causing this weird behaviour? What could 
> cause then Debugger to think that a regular object is an Array/Dictionary? 
> 
> The object in question is subclass from a custom base class. Apart from 
> being, NSCopying and NSCoding complaint there isn’t really anything strange 
> about it.
> 
> I’m trying to debug an App. I have a regular object that contains NSString's, 
> NSArray’s and NSDictionary’s. I have a method that does an alloc/init to get 
> a new one, but after the init call, the debugger shows the Object as 
> LTWNodeInfo @“0 objects”  as if its an array and if I try to inspect it, it 
> won’t show be any of the properties. If I print it to the log is says its the 
> right class.
> 
> What could someone tell me why this is happening and how to fix it?
> 
> I’m trying to get something finished for tomorrow and I can’t debug my code. 
> I’ve tried Cleaning the Build Folder, Cleaning the Project, Restarting XCode, 
> 
> Thanks in advance
> Dave
> 

___

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

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

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

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

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Gary L. Wade
Writing your own description or debugDescription method is a great way to view 
a large custom object, since you can format it the way you like. For an 
example, check out Apple's tech note about debugging magic (both OS X and iOS 
versions of it) and look at theirs for a view hierarchy description method.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Feb 4, 2016, at 9:05 AM, Dave <d...@looktowindward.com> wrote:
> 
> Hi Again,
> 
> I’m trying to debug a network of interwoven objects. To do all that with “po” 
> will take at least 10 times longer.
> 
> The only other way I can think to fix it, it to write a method on the Custom 
> Object subclass that Logs the Properties. Doing it that would would probably 
> take 3 or 4 times as long or I could write a self-test method which I suppose 
> would work with the logging method(s).
> 
> I’ve tracked it down a bit more and it seems to happen with Custom Objects 
> that have been unarchived. The Object that is unarchived is LTWNetwork, this 
> contains an array property, the array contains instances of my custom 
> subclass, its at this point that the debugger refuses to show them as custom 
> objects and show @“0 objects”, immediately after the unarchive operation.
> 
> Is there something I need to do after unarchiving that resolves the new 
> object as the correct class?
> 
> All the Best
> Dave
> 

___

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

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

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

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

Re: Weird Problem, is this an XCode Bug?

2016-02-04 Thread Gary L. Wade
The command po is for objects and p is for intrinsics; just add a typedef on 
those. If what you mean by properties are actually instance variables, use the 
-> operator on the object.

po [anObject aPropertyThatIsAnObject]
p (BOOL )[anObject aBoolMethod]
p anObject->aBooliVar

Unless you've modified your Xcode application or its constituent tools, you're 
not to blame for this. File the duplicate bug, and work around it like everyone 
else. There are some issues with Xcode worth tracking down; this isn't one of 
those.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Feb 4, 2016, at 8:12 AM, Dave <d...@looktowindward.com> wrote:
> 
> Jeez, really? I need a broken debugger like a hole in the dead at the moment. 
> Any idea what causes it and how to get rid of it? Using “po” won’t help as 
> it’s a custom object, I need to look at the properties. Any ideas how I can 
> do this?
> 
> I was wondering if it could be caused by a bug in my code that causes the 
> debugger to go AWOL or something?
> 
> All the Best
> Dave
> 
>> On 4 Feb 2016, at 15:56, Gary L. Wade <garyw...@desisoftsystems.com> wrote:
>> 
>> You're not alone. I see this every so often and just make do with the 
>> console view to see what I need (po is your friend). If you have more than 
>> one project open, you might try closing those before restarting Xcode. 
>> Another flake that Xcode has is putting the wrong project's source file in 
>> the Debug tab, a problem exacerbated by some of the projects I open from 
>> others who never bothered to change the names of their source files from 
>> template names; the worst offender is ViewController.m.
>> 
>> The only way to fix this is to file a bug against Xcode in 
>> http://bugreport.apple.com/ and wait for it to be marked as a duplicate and 
>> hope it gets fixed by Xcode 8.
>> --
>> Gary L. Wade (Sent from my iPad)
>> http://www.garywade.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/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.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: Removing Observers eats up memory

2016-01-25 Thread Gary L. Wade
You should look more at your design. Having that many objects being unobserved 
and reobserved (your word although in the context of new objects) reminds me of 
what I've called a genocidal refresh, an antipattern that can be fixed by only 
refreshing (or in your case observing) the things actually changed; in your 
case that may be only the items in the array that were added or removed.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Jan 25, 2016, at 1:10 AM, Markus Spoettl <ms_li...@shiftoption.com> wrote:
> 
> Hi,
> 
>  I have a view controller with a table view that is bound to an array 
> containing around 1000-1 model objects. The same view controller 
> registers itself as observer of all the objects' properties. These objects 
> are actually proxies for other model objects and are created by my view 
> controller (there is no outside reference to these objects).
> 
> When the array changes, I remove all observers from these objects before 
> re-observing the new objects.
> 
> Sometimes (on El Capitan) this removing of observers causes my app to freeze 
> and eat memory at an alarming rate. Sometimes this spirals completely out of 
> control until all memory is exhausted, sometimes it stops after a few 
> gigabytes of mystery allocations and my app continues.
> 
> The bug doesn't surface all the time, only 30-50% of all tries.
> 
> I have tried to wrap the observer removing code within an @autorelease {} 
> block, which helps a little. The problem is now harder to recreate, but it is 
> still there.
> 
> This is on El Capitan using Xcode 6.4 built against the 10.10 SDK.
> 
> Has anyone any idea how the removing of observers can cause this kind of 
> death spiral?
> 
> Regards
> Markus
> -- 
> __
> Markus Spoettl
> ___

___

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

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

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

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

Re: drawRect: wrong scale in a programmatically created window

2016-01-15 Thread Gary L. Wade
> On Jan 15, 2016, at 10:15 AM, Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> …number of pixels you get back will vary according to which Mac you run this 
> on.

…or on which screen you're using. You can see the point/pixel disparity more 
easily by adding a non-Retina monitor to a Retina Mac and moving your windows 
between the two. By the way, even Apple developers have problems with this; try 
scaling the iPhone Simulator window on such a setup and moving it between the 
screens.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.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: Panes vs. Separate Windows

2016-01-11 Thread Gary L. Wade
I've seen an advantage to having "attached palettes" like Xcode's Utilities 
pane. When set up like this, I can see unique attributes per window and compare 
two separate documents. When there's only one shared all over the place, it 
might be harder at times to get context at a glance. An example I've 
encountered recently that may be just an Xcode bug/oddity is the color palette 
used in choosing "Other" colors, in that it can become a bit disconnected if 
you deselect a color object. In my opinion, the color palette is a great 
candidate for use in a popover.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Jan 11, 2016, at 11:54 AM, Rick Mann <rm...@latencyzero.com> wrote:
> 
> I'm pleased to see so many in favor of multiple windows. It seems the 
> arguments in favor of a single monolithic window hinge smaller screens.

___

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

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

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

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

Re: Using CFHash to tell if a CFTypeRef has changed?

2016-01-11 Thread Gary L. Wade
It depends on what the actual object is. CFTypeRef is the (void*) or (id) 
equivalent for CoreFoundation types, so if you know what it is, check its 
documentation for notifications or KVO options. If it's an immutable object 
(like a CFStringRef,NSString), the object's data will never change.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Jan 11, 2016, at 10:18 AM, Dave <d...@looktowindward.com> wrote:
> 
> Any one have any other techniques for telling if a CFTypeRef has changed?

___

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: CGContextClipToRects: invalid context 0x0.

2015-12-21 Thread Gary L. Wade
I really don't see why you need to debug Apple's frameworks. When you break in 
the debugger or get a crash report symbolicated, there are enough symbols in 
there to see where you are—if you are in a call sequence inside Apple's 
frameworks. If you're not seeing them, then you're not there.

The time I saw your real issue was when I was trying to unravel some legacy 
code that was forcing changes to the view hierarchy when in a drawRect: which 
is really, really bad, and it was mixing up auto layout and manual layout—a 
field editor and simulated combo box were involved.

Look at your code for things like that and forget about your perceived issue 
with the frameworks.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Dec 15, 2015, at 3:12 PM, Richard Charles <rcharles...@gmail.com> wrote:
> 
> CGContextClipToRects

___

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

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

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

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

Re: Best Control for a Matrix these days?

2015-12-03 Thread Gary L. Wade
NSCollectionView
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Dec 3, 2015, at 5:00 AM, Dave <d...@looktowindward.com> wrote:
> 
> Hi,
> 
> This is a Mac question, not iOS. 
> 
> Which Class is the latest best practise for displaying a matrix in a View.
> 
> The matrix can be maximum 3 rows x 4 columns and each item contains a small 
> Icon type image and a Text String. 
> 
> I get an array of arrays and two parameters that tell me how many rows and 
> columns to populate:
> 
> numColumns = 3;
> numRows = 2;
> 
> Would be:
> 
> columnArray [0] = rowArray[0] - Payload Object
> columnArray [0] = rowArray[1] - Payload Object
> 
> columnArray [1] = rowArray[0] - Payload Object
> columnArray [1] = rowArray[1] - Payload Object
> 
> columnArray [2] = rowArray[0] - Payload Object
> columnArray [2] = rowArray[1] - Payload Object
> 
> 
> Thanks a lot
> All the Best
> Dave
> 

___

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

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

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

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

Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-12-01 Thread Gary L. Wade
I'm glad I could help. I know these things because I've worked on some backup 
and sync solutions for some rather well-known companies targeting fairly recent 
versions of OS X, so performance, correct solutions, and minimal impact to the 
user are very important to me.

Some aliases in that list don't really matter in the scheme of modern OS X, but 
depending on your needs, it might be important to go through as many as you can.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Dec 1, 2015, at 3:33 PM, Leonardo <mac.iphone@gmail.com> wrote:
> 
> That works perfectly. You are extremely precise. Thank you.
> I have successfully checked it with aliases with type 'alis' (file), 'fdrp' 
> (folder) and 'fapa' (filePackage application).
> I guess I’d have to check the whole list here below, but sincerely I don’t 
> even know how to create e.g. a kContainerTrashAliasType nor a 
> kContainerHardDiskAliasType... Do they all still exists? I will try to run 
> some check anyway.
> 
> 
> enum {
>   kContainerFolderAliasType = 'fdrp',
>   kContainerTrashAliasType = 'trsh',
>   kContainerHardDiskAliasType = 'hdsk',
>   kContainerFloppyAliasType = 'flpy',
>   kContainerServerAliasType = 'srvr',
>   kApplicationAliasType = 'adrp',
>   kContainerAliasType = 'drop',
>   kDesktopPrinterAliasType = 'dtpa',
>   kContainerCDROMAliasType = 'cddr',
>   kApplicationCPAliasType = 'acdp',
>   kApplicationDAAliasType = 'addp',
>   kPackageAliasType = 'fpka',
>   kAppPackageAliasType = 'fapa'
> };
> 
> 
> enum {
>   kSystemFolderAliasType = 'fasy',
>   kAppleMenuFolderAliasType = 'faam',
>   kStartupFolderAliasType = 'fast',
>   kPrintMonitorDocsFolderAliasType = 'fapn',
>   kPreferencesFolderAliasType = 'fapf',
>   kControlPanelFolderAliasType = 'fact',
>   kExtensionFolderAliasType = 'faex'
> };
> 
> 
> enum {
>   kExportedFolderAliasType = 'faet',
>   kDropFolderAliasType = 'fadr',
>   kSharedFolderAliasType = 'fash',
>   kMountedFolderAliasType = 'famn'
> };
> 
>  
> Regards
> -- Leonardo
> 
> 
> 
> Da: "Gary L. Wade" <garyw...@desisoftsystems.com>
> Data: Tue, 1 Dec 2015 08:37:37 -0800
> A: Leonardo <mac.iphone@gmail.com>
> Cc: <cocoa-dev@lists.apple.com>
> Oggetto: Re: FSIsAliasFile deprecated - typeOfFile is slow
> 
> When looking at bytes and doing things like this, I prefer using uint8_t 
> rather than char or unsigned char since it's more representative (this is 
> basic signed/unsigned arithmetic); besides, you don't want to do an 
> equal-check but a bit-check since it's a flags field. Technically both 
> buffer[8] and buffer[9] would be combined to make a big-endian 16-bit integer 
> (Mac legacy of the 680x0 and PPC architectures before Intel), but since all 
> you need to know is if it's an alias, just do this differently:
> 
>uint8_t *buffer = malloc(bufferSize);
>if(buffer == nil) return NO;
> 
>getxattr(cPath, keyName, buffer, bufferSize, 0, 0);
>BOOL isAlias = (0 != (buffer[8] & 0x80));
> 
> This may be faster if FSIsAliasFile does extra sniffing in the file for 
> correct content, which may or may not be as important for you, or if it 
> checks more of the xattr for correctness; you need to decide for yourself how 
> far you need to go, but be sure to try this out on all kinds of alias files, 
> especially those for files, folders, servers, and volumes.
> --
> Gary L. Wade (Sent from my iPad)
> http://www.garywade.com/
> 
> On Dec 1, 2015, at 4:06 AM, Leonardo <mac.iphone@gmail.com> wrote:
> 
> > Thank you Gary. Almost got it.
> > Still a small question. The 8th byte of the buffer, in case of alias (file
> > or folder) returns -128 and not 128 as you said. Am I missing something?
> > 
> > - (BOOL)IsAlias
> > {
> > const char*cPath = [[NSFileManager defaultManager]
> > fileSystemRepresentationWithPath:self];
> > if(cPath == 0 || *cPath == _NUL) return NO;
> > 
> > const char  *keyName = "com.apple.FinderInfo";
> > ssize_t bufferSize = getxattr(cPath, keyName, NULL, 0, 0, 0);
> > if(bufferSize < 32) return NO;
> > 
> > char *buffer = malloc(bufferSize);
> > if(buffer == nil) return NO;
> > 
> > getxattr(cPath, keyName, buffer, bufferSize, 0, 0);
> > BOOL isAlias = buffer[8] == -128;
> > 
> > free(buffer);
> > 
> > return isAlias;
> > }
> > 
> > Also, this method returns NO in case of SymLinks, as I expected.
> > And it's even 3 times faster than FSIsAliasFile().
> > That's fine.
> > I just hope that will work for the next 10 OS X releases...
>

Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-12-01 Thread Gary L. Wade
When looking at bytes and doing things like this, I prefer using uint8_t rather 
than char or unsigned char since it's more representative (this is basic 
signed/unsigned arithmetic); besides, you don't want to do an equal-check but a 
bit-check since it's a flags field. Technically both buffer[8] and buffer[9] 
would be combined to make a big-endian 16-bit integer (Mac legacy of the 680x0 
and PPC architectures before Intel), but since all you need to know is if it's 
an alias, just do this differently:

   uint8_t *buffer = malloc(bufferSize);
   if(buffer == nil) return NO;

   getxattr(cPath, keyName, buffer, bufferSize, 0, 0);
   BOOL isAlias = (0 != (buffer[8] & 0x80));

This may be faster if FSIsAliasFile does extra sniffing in the file for correct 
content, which may or may not be as important for you, or if it checks more of 
the xattr for correctness; you need to decide for yourself how far you need to 
go, but be sure to try this out on all kinds of alias files, especially those 
for files, folders, servers, and volumes.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Dec 1, 2015, at 4:06 AM, Leonardo <mac.iphone@gmail.com> wrote:
> 
> Thank you Gary. Almost got it.
> Still a small question. The 8th byte of the buffer, in case of alias (file
> or folder) returns -128 and not 128 as you said. Am I missing something?
> 
> - (BOOL)IsAlias
> {
>const char*cPath = [[NSFileManager defaultManager]
> fileSystemRepresentationWithPath:self];
>if(cPath == 0 || *cPath == _NUL) return NO;
> 
>const char  *keyName = "com.apple.FinderInfo";
>ssize_t bufferSize = getxattr(cPath, keyName, NULL, 0, 0, 0);
>if(bufferSize < 32) return NO;
> 
>char *buffer = malloc(bufferSize);
>if(buffer == nil) return NO;
> 
>getxattr(cPath, keyName, buffer, bufferSize, 0, 0);
>BOOL isAlias = buffer[8] == -128;
> 
>free(buffer);
> 
>return isAlias;
> }
> 
> Also, this method returns NO in case of SymLinks, as I expected.
> And it's even 3 times faster than FSIsAliasFile().
> That's fine.
> I just hope that will work for the next 10 OS X releases...
> 
> Regards
> -- Leonardo
> 
> 
>> Da: "Gary L. Wade" <garyw...@desisoftsystems.com>
>> Data: Fri, 27 Nov 2015 16:48:43 -0800
>> A: Leonardo <mac.iphone@gmail.com>
>> Cc: <cocoa-dev@lists.apple.com>
>> Oggetto: Re: FSIsAliasFile deprecated - typeOfFile is slow
>> 
>> Although I have experience with your performance hit, one solution I would
>> probably try when it becomes important again for me would be to do this:
>> 
>> 1. Using the BSD layer of APIs, see if the file (alias files are regular 
>> files
>> from a statfs call, even folder aliases) has an extended attribute named
>> "com.apple.FinderInfo". If it does not, it is not an alias file.
>> 2. If the extended attribute does exist and is of length 32 bytes (or more
>> although doubtful this would ever change), you might have an alias file. If
>> less, just say no assuming corruption.
>> 3. Get the bytes of the extended attribute and examine the byte at index 8
>> (bytes[8]) to see if its high bit is set (bytes[8] | 0x80). If so, you have 
>> an
>> alias; if not, you don't.
>> 4. Add this logic in an appropriate category method (to keep this Cocoa).
>> 
>> For reference, look up ATTR_CMN_FNDRINFO, xattr, Finder.h. Note this extended
>> attribute has its integers in big-endian format. You might also look at the
>> fileType parameter of the CoreServices FileInfo that maps the first 16 bytes,
>> but that requires more checking.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
>> 
>>> On Nov 27, 2015, at 2:00 PM, Leonardo <mac.iphone@gmail.com> wrote:
>>> 
>>> Hi,
>>> I actually detect whether a file is an alias this way:
>>> I use a NSString category where self is the filePath.
>>> 
>>> - (BOOL)IsAliasOld
>>> {
>>>   FSRefsourceRef;
>>> 
>>>   OSErrerr = [self GetFSRef:];
>>>   if(err) return NO;
>>> 
>>>   BooleanisFSDirectory, aliasFileFlag;
>>> 
>>>   err = FSIsAliasFile(, , );
>>>   if(err) return NO;
>>>   else return aliasFileFlag;
>>> }
>>> 
>>> - (OSErr)GetFSRef:(FSRef*)sourceRef
>>> {
>>>   const char *cSrcPath = [[NSFileManager defaultManager]
>>> fileSystemRepresentationWithPath:self];
>>>   if(cSrcPath == 0 || *cSrcPath == _NUL) return -1;
>>> 
>>>   OSErr err = FSPathMakeRefWithOptions((UInt8*)cSrcPath,
>>>

Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-11-28 Thread Gary L. Wade
Extended attributes aren't going away, and current alias files aren't going 
away; those exist on the latest OS. Try this and getResourceValue: to see if 
there's any significant difference, and if you eventually do need the alias 
data you might also try the bookmark API on the file (check to be sure nil is 
returned for a non-alias), especially when you scale up to a large file set, 
and if my suggested wrapper around the BSD layer is fastest, write a 
http://bugreport.apple.com asking Apple to add it as a blessed API based on 
performance reasons and your need (besides the method result of BOOL, it should 
also return an NSError in case the file doesn't exist). After all, what is 
Cocoa but wrappers around lower levels? Someone eventually "gets their hands 
dirty."

If I need to revisit the app that needs such a solution, I'll also report it, 
and maybe it'll make it into OS X 10.12. Some things do get added this way.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Nov 28, 2015, at 7:59 AM, Leonardo <mac.iphone@gmail.com> wrote:
> 
> Hi Gary,
> Thank you for your low level fine solution. Anyway, I'm afraid that Apple
> changes the alias-rule and this method will not work longer. Do you have a
> solution at a upper level? Or may I be 100% sure that Apple will never
> change this rule? 
> 
> Regards
> -- Leonardo
> 
> 
>> Da: "Gary L. Wade" <garyw...@desisoftsystems.com>
>> Data: Fri, 27 Nov 2015 16:48:43 -0800
>> A: Leonardo <mac.iphone@gmail.com>
>> Cc: <cocoa-dev@lists.apple.com>
>> Oggetto: Re: FSIsAliasFile deprecated - typeOfFile is slow
>> 
>> Although I have experience with your performance hit, one solution I would
>> probably try when it becomes important again for me would be to do this:
>> 
>> 1. Using the BSD layer of APIs, see if the file (alias files are regular 
>> files
>> from a statfs call, even folder aliases) has an extended attribute named
>> "com.apple.FinderInfo". If it does not, it is not an alias file.
>> 2. If the extended attribute does exist and is of length 32 bytes (or more
>> although doubtful this would ever change), you might have an alias file. If
>> less, just say no assuming corruption.
>> 3. Get the bytes of the extended attribute and examine the byte at index 8
>> (bytes[8]) to see if its high bit is set (bytes[8] | 0x80). If so, you have 
>> an
>> alias; if not, you don't.
>> 4. Add this logic in an appropriate category method (to keep this Cocoa).
>> 
>> For reference, look up ATTR_CMN_FNDRINFO, xattr, Finder.h. Note this extended
>> attribute has its integers in big-endian format. You might also look at the
>> fileType parameter of the CoreServices FileInfo that maps the first 16 bytes,
>> but that requires more checking.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
>> 
>>> On Nov 27, 2015, at 2:00 PM, Leonardo <mac.iphone@gmail.com> wrote:
>>> 
>>> Hi,
>>> I actually detect whether a file is an alias this way:
>>> I use a NSString category where self is the filePath.
>>> 
>>> - (BOOL)IsAliasOld
>>> {
>>> FSRefsourceRef;
>>> 
>>> OSErrerr = [self GetFSRef:];
>>> if(err) return NO;
>>> 
>>> BooleanisFSDirectory, aliasFileFlag;
>>> 
>>> err = FSIsAliasFile(, , );
>>> if(err) return NO;
>>> else return aliasFileFlag;
>>> }
>>> 
>>> - (OSErr)GetFSRef:(FSRef*)sourceRef
>>> {
>>> const char *cSrcPath = [[NSFileManager defaultManager]
>>> fileSystemRepresentationWithPath:self];
>>> if(cSrcPath == 0 || *cSrcPath == _NUL) return -1;
>>> 
>>> OSErr err = FSPathMakeRefWithOptions((UInt8*)cSrcPath,
>>> kFSPathMakeRefDoNotFollowLeafSymlink, sourceRef, NULL);
>>> return err;
>>> }
>>> 
>>> 
>>> Since FSIsAliasFile is deprecated (I compile for 10.9) I would now use
>>> 
>>> - (BOOL)IsAliasNew
>>> {
>>> NSString*type = [[NSWorkspace sharedWorkspace] typeOfFile:self
>>> error:nil];
>>> return [type isEqualToString:@"com.apple.alias-file"];
>>> }
>>> 
>>> The problem is that the IsAliasNew method is 3.7 times slower than the
>>> IsAliasOld method. Do you know a way to accomplish that with a faster
>>> method?
> 
> 

___

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: FSIsAliasFile deprecated - typeOfFile is slow

2015-11-28 Thread Gary L. Wade
Hopefully by that time those software developers in Apple who misquote Donald 
Knuth will gain enough experience to realize there are good reasons even small 
APIs should be efficient.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

On Nov 28, 2015, at 10:38 AM, Charles Srstka <cocoa...@charlessoft.com> wrote:

>> On Nov 28, 2015, at 11:26 AM, Gary L. Wade <garyw...@desisoftsystems.com> 
>> wrote:
>> 
>> Extended attributes aren't going away, and current alias files aren't going 
>> away; those exist on the latest OS. Try this and getResourceValue: to see if 
>> there's any significant difference, and if you eventually do need the alias 
>> data you might also try the bookmark API on the file (check to be sure nil 
>> is returned for a non-alias), especially when you scale up to a large file 
>> set, and if my suggested wrapper around the BSD layer is fastest, write a 
>> http://bugreport.apple.com asking Apple to add it as a blessed API based on 
>> performance reasons and your need (besides the method result of BOOL, it 
>> should also return an NSError in case the file doesn't exist). After all, 
>> what is Cocoa but wrappers around lower levels? Someone eventually "gets 
>> their hands dirty."
> 
> While extended attributes aren’t going away, it’s conceivable that the 
> *format* could change. For example, if Apple ever moves off HFS+ to a file 
> system that supports aliases natively, the kludge in the com.apple.FinderInfo 
> xattr would probably not be needed anymore (unless of course they left it 
> there for backward compatibility purposes).
> 
> 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: Bunch of CoreData based NSDocument questions.

2015-11-28 Thread Gary L. Wade
I don't remember the details, but I seem to recall you having to override some 
methods in NSDocument (saving, closing, etc.) and possibly NSApplication 
terminate to get the behavior it sounds like you require. The app I worked on 
wanted to make sure the user had an option to submit an action to an outside 
service even though the data was saved.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Nov 26, 2015, at 10:41 PM, Motti Shneor <su...@bezeqint.net> wrote:
> 
> He hits "Quit" by mistake, and the whole thing pops and disappears. He'll 
> have to open the application and re-do half an hour's work to bring his setup 
> to the previous state. Nothing was yet saved - because most of this work is 
> outside the computer. Only the user can align these two simultaneous flows of 
> action.

___

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: FSIsAliasFile deprecated - typeOfFile is slow

2015-11-27 Thread Gary L. Wade
Although I have experience with your performance hit, one solution I would 
probably try when it becomes important again for me would be to do this:

1. Using the BSD layer of APIs, see if the file (alias files are regular files 
from a statfs call, even folder aliases) has an extended attribute named 
"com.apple.FinderInfo". If it does not, it is not an alias file.
2. If the extended attribute does exist and is of length 32 bytes (or more 
although doubtful this would ever change), you might have an alias file. If 
less, just say no assuming corruption.
3. Get the bytes of the extended attribute and examine the byte at index 8 
(bytes[8]) to see if its high bit is set (bytes[8] | 0x80). If so, you have an 
alias; if not, you don't.
4. Add this logic in an appropriate category method (to keep this Cocoa).

For reference, look up ATTR_CMN_FNDRINFO, xattr, Finder.h. Note this extended 
attribute has its integers in big-endian format. You might also look at the 
fileType parameter of the CoreServices FileInfo that maps the first 16 bytes, 
but that requires more checking.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Nov 27, 2015, at 2:00 PM, Leonardo <mac.iphone@gmail.com> wrote:
> 
> Hi,
> I actually detect whether a file is an alias this way:
> I use a NSString category where self is the filePath.
> 
> - (BOOL)IsAliasOld
> {
>FSRefsourceRef;
> 
>OSErrerr = [self GetFSRef:];
>if(err) return NO;
> 
>BooleanisFSDirectory, aliasFileFlag;
> 
>err = FSIsAliasFile(, , );
>if(err) return NO;
>else return aliasFileFlag;
> }
> 
> - (OSErr)GetFSRef:(FSRef*)sourceRef
> {
>const char *cSrcPath = [[NSFileManager defaultManager]
> fileSystemRepresentationWithPath:self];
>if(cSrcPath == 0 || *cSrcPath == _NUL) return -1;
> 
>OSErr err = FSPathMakeRefWithOptions((UInt8*)cSrcPath,
> kFSPathMakeRefDoNotFollowLeafSymlink, sourceRef, NULL);
>return err;
> }
> 
> 
> Since FSIsAliasFile is deprecated (I compile for 10.9) I would now use
> 
> - (BOOL)IsAliasNew
> {
>NSString*type = [[NSWorkspace sharedWorkspace] typeOfFile:self
> error:nil];
>return [type isEqualToString:@"com.apple.alias-file"];
> }
> 
> The problem is that the IsAliasNew method is 3.7 times slower than the
> IsAliasOld method. Do you know a way to accomplish that with a faster
> method?
> 

___

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: Identify image file count in directory

2015-11-14 Thread Gary L. Wade
I've worked on backup, syncing apps, and other file system related utilities 
for some rather well-known companies, so I've definitely explored the speed 
issues you're seeing. At one time I also had explored and used the CoreOS APIs 
that were shared with the legacy Carbon system (FSIterator, etc.). One app I 
refactored to not use Cocoa for just getting the listing of a large file system 
dropped from three minutes to 20 seconds and significantly reduced the memory 
footprint in the process.

The Cocoa frameworks pretty much call these lower level APIs and encapsulate 
their results in Cocoa objects (i.e., HFS+ is not composed of Cocoa objects), 
which can indeed add up when you're looking at the quantity of files you're 
seeing, and uses a lot more memory than needed for your case, which is just 
counting the files that are images, essentially checking the extensions from a 
known set (getting an extension from an NSString is also more expensive than 
traversing a C array of bytes to find the last period). And when you're going 
across a network boundary, the speed in doing more than needed really adds up.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Nov 14, 2015, at 10:15 AM, Jonathan Taylor <jonathan.tay...@glasgow.ac.uk> 
> wrote:
> 
> Hi Gary,
> 
> Thanks for your reply. Do you know for sure that this should be significantly 
> faster, or were you just guessing? You didn't say which particular API you 
> had in mind, but some reading has led me to the fts APIs. These appear to be 
> about 20% faster than NSFileManager (I specified FTS_NAMEONLY). Better than a 
> kick in the teeth, but still seems to me like it might be possible to do it 
> faster.
> 
> I measured about 2.5 seconds for a directory on a "Mac OS Extended 
> (Journaled)" external USB3 hard disk containing 110,000 files with names 
> around 15 characters long. I don't know much about how filesystems are 
> structured, so this information may not be all in one place, but that should 
> represent less than 1MB/s of data read in order to get a list of all the 
> filenames in the directory.
> 
> Maybe this is as good as it's going to get, but it would be great to know if 
> there is a better way.
> 
> Jonny.
> 
>> On 13 Nov 2015, at 16:54, Gary L. Wade <garyw...@desisoftsystems.com> wrote:
>> 
>> Try going down a level to the BSD layer APIs for directory contents 
>> traversal.
>> --
>> Gary L. Wade (Sent from my iPad)
>> http://www.garywade.com/
>> 
>>> On Nov 13, 2015, at 8:28 AM, Jonathan Taylor 
>>> <jonathan.tay...@glasgow.ac.uk> wrote:
>>> 
>>> Hi all,
>>> 
>>> I want to be able to identify quickly (programatically) how many image 
>>> files reside in a particular directory. At present I call:
>>> [NSFileManager defaultManager] contentsOfDirectoryAtPath:dir error:nil];
>>> and then examine the type suffixes (which in comparison is very quick). 
>>> When looking at a directory over a network or on an external drive, the 
>>> NSFileManager call can take several seconds for a directory containing 18k 
>>> files of which half are images.
>>> 
>>> These sorts of numbers are in fact a common use case for me, and I would 
>>> like to avoid this delay. This is for preview information in an 
>>> NSOpenPanel, so I don't want to make things this unresponsive - but at the 
>>> same time it is very useful to have access to this information for the 
>>> preview.
>>> 
>>> Can anybody advise on a quicker way of achieving what I want to achieve? 
>>> The fact that 'ls' takes almost as long makes me think this is probably a 
>>> fairly insurmountable problem, but at the same time the quantity of 
>>> information transferred (of the order of 200k of data) should not take 2 
>>> seconds to transfer, so in that sense it doesn't seem unreasonable to try 
>>> and see if there is a faster way.
>>> 
>>> I would prefer to get the filenames themselves, but I could settle for just 
>>> a count of the total number of files (of any kind) in the directory *and* 
>>> the ability to get the paths of just the first few files in the directory, 
>>> if there might be a faster way of doing that.
>>> 
>>> Thanks for any suggestions
>>> Jonny
> 
___

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: Identify image file count in directory

2015-11-13 Thread Gary L. Wade
Try going down a level to the BSD layer APIs for directory contents traversal.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Nov 13, 2015, at 8:28 AM, Jonathan Taylor <jonathan.tay...@glasgow.ac.uk> 
> wrote:
> 
> Hi all,
> 
> I want to be able to identify quickly (programatically) how many image files 
> reside in a particular directory. At present I call:
>  [NSFileManager defaultManager] contentsOfDirectoryAtPath:dir error:nil];
> and then examine the type suffixes (which in comparison is very quick). When 
> looking at a directory over a network or on an external drive, the 
> NSFileManager call can take several seconds for a directory containing 18k 
> files of which half are images.
> 
> These sorts of numbers are in fact a common use case for me, and I would like 
> to avoid this delay. This is for preview information in an NSOpenPanel, so I 
> don't want to make things this unresponsive - but at the same time it is very 
> useful to have access to this information for the preview.
> 
> Can anybody advise on a quicker way of achieving what I want to achieve? The 
> fact that 'ls' takes almost as long makes me think this is probably a fairly 
> insurmountable problem, but at the same time the quantity of information 
> transferred (of the order of 200k of data) should not take 2 seconds to 
> transfer, so in that sense it doesn't seem unreasonable to try and see if 
> there is a faster way.
> 
> I would prefer to get the filenames themselves, but I could settle for just a 
> count of the total number of files (of any kind) in the directory *and* the 
> ability to get the paths of just the first few files in the directory, if 
> there might be a faster way of doing that.
> 
> Thanks for any suggestions
> Jonny

___

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: The joys of people using valueForKey to get objects out of a dictionary.

2015-11-10 Thread Gary L. Wade
Lots of stuff with that. An immutable dictionary can't be changed. Someone 
doesn't know how to spell unknown (NSUnknosnKeyException). And not sure if that 
period is part of the key username or just good English, but if given as part 
of the key, it becomes a key path with an empty key. Anyway, this is a 
programmer error, not an API issue.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Nov 10, 2015, at 1:32 PM, Alex Zavatone <z...@mac.com> wrote:
> 
> And you guys have no idea how useful this discussion was to me today.
> 
> Even though the KVO valueForKey: method doesn't crater with an 
> NSUnknownException with ease, it turns out that this wonderful code is also 
> using the KVO method of setValue: forKey: on a dictionary.
> 
> And guess what?
> 
> *** Terminating app due to uncaught exception 'NSUnknosnKeyException', 
> reason, [<__NSDictionaryI setValue:forUndefinedKey:]: this class is not 
> key value coding-compliant for the key username.'
> *** First throw call stack:
> 
> 
> THANK YOU.  
> 

___

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

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

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

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

Re: Safe time to add accessory view to NSSavePanel in sandboxed app?

2015-10-19 Thread Gary L. Wade
That looks familiar back when I dealt with adding an accessory view under sand 
boxing. I don't have the code base available to me to know what I did 
differently or remind me further, but I know I did something different in the 
sandboxed version than the non-sandboxed. There's a number of web pages you 
should find related to the save panel UI hierarchy under sand boxing that 
should help, though. Search on things like NSSavePanel, sandbox, NSRemoteView, 
etc.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Oct 19, 2015, at 8:22 AM, Marek Hrušovský <xhrus...@gmail.com> wrote:
> 
> I just went through my crashes and this thread popped up in google.
> 
> I have additional information (one helpful method in the stack). Even if I
> dig deep I still can't figure out what can cause the issue. Is anyone able
> to get from "_hierarchyDidChangeInView" the line where it crashes?
> 
> 
> Anyway I created rdar://23165196
> 
> 
> Marek.
> 
> 
> Date/Time:   2015-10-14T19:16:34Z
> 
> OS Version:  Mac OS X 10.11.0 (15A278b)
> 
> Report Version:  104
> 
> 
> Exception Type:  SIGSEGV
> 
> Exception Codes: SEGV_MAPERR at 0x7fc7a764438
> 
> Crashed Thread:  0
> 
> 
> Thread 0 Crashed:
> 
> 0   libobjc.A.dylib  0x7fff84dcbe5d objc_msgSend +
> 29
> 
> 1   ViewBridge   0x7fff9519ea42
> -[NSVBAccessoryWindow _hierarchyDidChangeInView:] + 69
> 
> 2   AppKit   0x7fff86593aea -[NSView
> _setSuperview:] + 2602
> 
> 3   AppKit   0x7fff86592c28 -[NSView
> addSubview:] + 448
> 
> 4   AppKit   0x7fff865fa754 -[NSWindow
> setContentView:] + 638
> 
> 5   ViewBridge   0x7fff951d1253
> setWindowContentView + 75
> 
> 6   ViewBridge   0x7fff951b5d8b
> -[NSRemoteViewBase setAccessoryView:] + 208
> 
> 7   AppKit   0x7fff86df9ed8
> -[NSVBSavePanel(NSSavePanelSPI) _sendAccessoryView:] + 49
> 
> 80x00010b56e3b0 0x10b4bf000 + 717744
> 
>> On Sat, Jul 18, 2015 at 12:14 AM, Martin Wierschin <mar...@nisus.com> wrote:
>> 
>> I just had a beta tester contact me about a very similar error/crash. It's
>> slightly different than I've seen before, but it certainly seems related.
>> 
>> The tester was closing a window backed by NSDocument. In response the
>> AppKit document machinery was attempting to create an NSSavePanel, to allow
>> the user to save or discard the file, but NSRemoteView threw an
>> exception[1].
>> 
>> As I mentioned earlier in this thread, I've come to anticipate this. I now
>> wrap the relevant NSDocument method to catch any exceptions and display a
>> warning alert that the system save panel is (apparently) temporarily
>> unavailable. This time the app crashed while trying to generate that alert;
>> -[NSAlert init] was loading some localized string and crashed[2].
>> 
>> I doubt this is going to be reproducible, but it's reported as
>> rdar://21881669.
>> 
>> ~Martin Wierschin
>> 
>> 
>> [1] INITIAL EXCEPTION:
>> 
>> MyApp[807]: *** Assertion failure in -[NSRemoteView
>> setServiceObject:forKey:],
>> /SourceCache/ViewBridge/ViewBridge-105/NSRemoteView.m:3142
>>failed:  invalid
>>in: NSInternalInconsistencyException line 0
>>STACK TRACE:
>> ...
>> libobjc.A.dylib   objc_exception_throw
>> CoreFoundation+[NSException raise:format:arguments:]
>> Foundation-[NSAssertionHandler
>> handleFailureInMethod:object:file:lineNumber:description:]
>> ViewBridge-[NSRemoteViewBase setServiceObject:forKey:]
>> FoundationNSKeyValueNotifyObserver
>> FoundationNSKeyValueDidChange
>> Foundation-[NSObject(NSKeyValueObserverNotification)
>> didChangeValueForKey:]
>> AppKit-[NSDocument _preparedSavePanelForOperation:]
>> ...
>> AppKit-[NSDocument
>> canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:]
>> AppKit-[NSWindow __close]
>> AppKit-[NSControl sendAction:to:]
>> ...
>> AppKitNSApplicationMain
>> MyApp MyAppMain
>> MyApp start
>> 
>> 
>> 
>> [2] SUBSEQUENT CRASH:
>> 
>> Exception Type:EXC_BAD_ACCES

Re: CNCopySupportedInterfaces

2015-10-02 Thread Gary L. Wade
The original API still works in iOS 9, but to use the new method, you need to 
ask Apple for an entitlement by sending an email to networkextens...@apple.com. 
It took me around a week for approval. Be sure to explain your need, especially 
how simple it is in the scheme of the expectations you read in their docs.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Oct 2, 2015, at 9:21 AM, Gerriet M. Denkmann <gerr...@mdenkmann.de> wrote:
> 
> I am trying to update some source code which does every second:
> 
> CNCopySupportedInterfaces and CNCopyCurrentNetworkInfo and extracts the 
> values of kCNNetworkInfoKeySSID and kCNNetworkInfoKeyBSSID.
> 
> All this is deprecated in iOS 9.0.
> 
> Xcode 7.0 tells me:
> 'CNCopySupportedInterfaces' is deprecated: first deprecated in iOS 9.0 - For 
> captive network applications, this has been completely replaced by 
> . For other applications, there is no 
> direct replacement. Please file a bug describing your use of this API to that 
> we can consider your requirements as this situation evolves.
> 
> “The NEHotspotHelper interface allows an application to participate in the 
> process of joining Wi-Fi/hotspot networks.”
> 
> I have no idea, whether this app is a “captive network application”. It 
> certainly has nothing to do with Hotspots.
> It is just an app which tries to communicate with a light bulb.
> 
> Any ideas, what to do?
> 
> Gerriet.

___

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

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

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

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

Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface

2015-09-17 Thread Gary L. Wade
Also, in case you're pulling multiple values per instrument object in your new 
timer (e.g., temperature, time, frequency, etc.), and these may be updating on 
background threads, a simple way to get these is to pull all the values needed 
into local variables in a synchronize block based on the particular instrument 
object. Just be sure to do the same on your background threads when updating 
them; using the synchronize block to set multiple values at once is better than 
using multiple atomic properties.

This also helps present a more unified front for your data per instrument since 
individual updates may show a temperature from the last reading and a frequency 
from this reading whereas a single full-pull will show the user only the one 
reading.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Sep 17, 2015, at 6:47 AM, Gary L. Wade <garyw...@desisoftsystems.com> 
> wrote:
> 
> Okay, so what it appears you have is over 100 timers being fired whose only 
> purpose is to transfer a single value from one variable to another so that 
> bindings will hear that change and update your UI.
> 
> A better approach is to remove bindings completely, make a single timer on 
> the main queue that fires every quarter-second (I believe that was your 
> interval from another email), which is associated with the view/window 
> controller that manages all your text fields and instrument objects, have 
> that timer use a single cached formatter and loops through all your 100+ 
> objects, getting their values, formatting them, and setting each appropriate 
> text field's string value.

___

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: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface

2015-09-17 Thread Gary L. Wade
Just as I thought. You're overloading the system by tightly coupling your model 
and your view. Let your instruments (models) do their work, and let your 
controller consult them when ready and update the view; don't use your 
controller to tell the models to update the views.

Using an office metaphor, you have 100 employees doing work, and they are told 
by a secretary to report their progress to their manager, and they are all 
going to the manager at the same time, all crowding in and stepping over each 
other. It's more efficient for a single secretary to jot that info down and 
take it to the manager.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Sep 17, 2015, at 7:25 AM, Jean Suisse <jean.li...@gmail.com> wrote:
> 
> Thanks for your reply. 
> If I understand you correctly, I am already doing all that by having one 
> updateUI function per instrument, which does:
> 
> self.myProperty = self->myStorageVariable
> 
> on every variables.
> All updateUI selectors are sent to all instruments, at the same time, from 
> the main thread by a timer dispatch source, once every second.
> 
> 
> 
>> On 17 sept. 2015, at 16:18, Gary L. Wade <garyw...@desisoftsystems.com> 
>> wrote:
>> 
>> Also, in case you're pulling multiple values per instrument object in your 
>> new timer (e.g., temperature, time, frequency, etc.), and these may be 
>> updating on background threads, a simple way to get these is to pull all the 
>> values needed into local variables in a synchronize block based on the 
>> particular instrument object. Just be sure to do the same on your background 
>> threads when updating them; using the synchronize block to set multiple 
>> values at once is better than using multiple atomic properties.
>> 
>> This also helps present a more unified front for your data per instrument 
>> since individual updates may show a temperature from the last reading and a 
>> frequency from this reading whereas a single full-pull will show the user 
>> only the one reading.
>> --
>> Gary L. Wade (Sent from my iPad)
>> http://www.garywade.com/
>> 
>>> On Sep 17, 2015, at 6:47 AM, Gary L. Wade <garyw...@desisoftsystems.com> 
>>> wrote:
>>> 
>>> Okay, so what it appears you have is over 100 timers being fired whose only 
>>> purpose is to transfer a single value from one variable to another so that 
>>> bindings will hear that change and update your UI.
>>> 
>>> A better approach is to remove bindings completely, make a single timer on 
>>> the main queue that fires every quarter-second (I believe that was your 
>>> interval from another email), which is associated with the view/window 
>>> controller that manages all your text fields and instrument objects, have 
>>> that timer use a single cached formatter and loops through all your 100+ 
>>> objects, getting their values, formatting them, and setting each 
>>> appropriate text field's string value.
> 
___

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: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface

2015-09-17 Thread Gary L. Wade
Okay, so what it appears you have is over 100 timers being fired whose only 
purpose is to transfer a single value from one variable to another so that 
bindings will hear that change and update your UI.

A better approach is to remove bindings completely, make a single timer on the 
main queue that fires every quarter-second (I believe that was your interval 
from another email), which is associated with the view/window controller that 
manages all your text fields and instrument objects, have that timer use a 
single cached formatter and loops through all your 100+ objects, getting their 
values, formatting them, and setting each appropriate text field's string value.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

On Sep 17, 2015, at 4:02 AM, Jean Suisse <jean.li...@gmail.com> wrote:

>> What makes you think that:
>> 
>> (a) this is a lot of activity?
> 
> 
> It is not a lot of activity. I am not trying to do performance optimization. 
> Right now, the app is taking 3 % CPU on the latest 13” MBP Retina.
> I am trying to find why my app can’t run for two days without exhausting the 
> 16 GB RAM it has.
> 
>> (b) your monolithic replacement runs faster than this?
> 
> I don’t know, but as long as it runs reasonably I am not sure I care. The MAC 
> is dedicated to the project. There is no user to complain. All I can tell is 
> that there is no visible jump in CPU consumption.
> 
>> In design terms, you have two instances of the MVC pattern, not one. You 
>> have inputs (V-1) updating a model (M), and you have UI elements (V-2) 
>> tracking the same model (M). So you have two design problems: input to 
>> model, and model to UI. It’s much harder to try to solve inputs-to-UI in a 
>> single coordinated step — nor do I think you need to.
>> 
>> I know nothing of the details of your app, of course, but if, for example, 
>> only 20% of the inputs change every second, then suppressing input-to-model 
>> updates entirely, at the source, seems like a good approach to performance 
>> problems, without involving the UI. Separately, if the overall rate of UI 
>> updates is very high (in particular if it’s over 100% per second), then 
>> using a timer to limit the model-to-UI update rate sounds like a simple 
>> approach, without involving the inputs.
> 
> Well, at this point it is better for me to say more.
> 
> It is a scientific data acquisition app. Basically, I mad many electronic 
> boards performing various tasks (actuation & measurements mainly). These 
> electronic boards have been incorporated in nice boxes to build what I will 
> call hereafter “instruments”.
> These instruments either communicate wirelessly or not, depending on their 
> physical location, and use different protocol (buses, interfaces) according 
> to their nature. All these instruments together allow me to cover a large 
> area and monitor around 150 parameters every second. 
> 
> The application does that. Of these 150 variables, a little above 100 are 
> displayed on a UI that is refreshed every second.
> This in itself is a challenge and I had to add some piece of electronics, 
> work on the (custom) protocol and on the firmware of the boards to get it to 
> work reliably. Especially for the wireless part. One solution was to have 
> distinct data buses (distinct communication interfaces).
> 
> Now, this job is done and the design of the app reflects some of these 
> constraints.
> 
> First, I have a communication interface server which ensures that there is 
> only one instance representing each data bus connection. Same for the 
> electronic board server. It ensures that that there is only one object for 
> each physical board and communication interface (so dealing with concurrency 
> is dead simple). Then I have actuator objects, sensor objects, instruments 
> objects all requesting their electronic board on their bus to these object 
> servers. I manipulate the instruments objects. Communication follows. 
> Communication is slow. It is expected.
> 
> Then, I have one dispatch source that takes care of synchronization & 
> timestamps. Four that trigger data collection from the devices through the 4 
> buses (1 wireless, 2 RS-485, one GPIB), one that collects measured values 
> during the last cycle, takes care of the processing & on the disk storage. 
> And now, one extra that sync the UI.
> 
> Everything works fine with no leaks, except for that last part. This is where 
> the issue lies. The timer dispatch source that syncs the UI is dead simple. 
> It only sends updateUI to each object representing an instruments.
> 
> These objects are declared as:
> 
> @interface MyInstrument : JSScientificInstrument
> {
>double aM

Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface

2015-09-17 Thread Gary L. Wade
Yes, I saw that code, but it only set a single variable and appeared to only be 
associated with a single instrument. If you have 100+ instruments, that would 
be 100+ separate updates. You know your code better than I and may be 
simplifying things for us, but I've seen cases sounding very much like yours 
where bindings is not the right solution. From how I read this, you are tightly 
coupling your view to your model. Consider decoupling your view-updating code 
like I suggested and you should see a significant change without a hack.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Sep 17, 2015, at 7:00 AM, Jean Suisse <jean.li...@gmail.com> wrote:
> 
> Thanks. But I already have one single timer dispatch source that updates all 
> the UI only by transferring double / int values from instance variables to 
> bound properties. The timer fires every second and causes the whole 100+ 
> fields to be updated. This, however, does not prevent KVO to operate for each 
> setter being called.
> More information in my first post where you can see the implementation of the 
> timer dispatch source and of the updateUI functions and in a previous e-mail 
> I sent today. Data format varies based on the data being displayed (I use the 
> formatters to display the correct physical unit for each measurement).

___

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: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface

2015-09-16 Thread Gary L. Wade
I don't see why you're using a strong reference from the weak reference inside 
your timer. You may be confusing ARC with that and your etc code. Change your 
code to just use weakself rather than strongself when calling updateUI. If 
there's a strong reference needed, try using self only. Also, is it possible 
your function never ends? Check your etc code there.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Sep 16, 2015, at 4:00 AM, Jean Suisse <jean.li...@gmail.com> wrote:
> 
> Dear All,
> 
> I have an app that uses Cocoa and dispatch sources leaking a lot (ca. 5GB / 
> 17h). The origin seems to come from a combination of dispatch sources, 
> Bindings & Core Animation. Below is a brief description of the app, what 
> issues I encounter and the related code.
> 
> DESCRIPTION OF THE APPLICATION
> I have a scientific data acquisition App that is expected to run continuously 
> for a year and collect data every second from 144 sensors. The app is written 
> in Objective-C, targets MAC OS, and uses GCD a lot. Basically, I start 
> several dispatch queues running blocks to deal with scientific instruments 
> connected to different data buses. I use appropriate synchronization tools or 
> locking mechanisms to run everything safely and deal with concurrency.
> 
> ISSUES
> At first, I did bind the 115 textfields (most having number formatters) on 
> the main view directly to the properties of the class instances representing 
> different physical scientific instruments. The issue was that it caused the 
> UI being refreshed from various threads while my app was operating (timer 
> dispatch sources manipulating the objects to collect data from instruments 
> causing UI refresh through bindings). I got the message "CoreAnimation: 
> warning, deleted thread with uncommitted CATransaction; set 
> CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces” a lot.
> 
> So, I made a simple function (refreshUI) which transfers the data from 
> non-bound properties of the objects to bound-properties of the objects like 
> this :
> 
> 
> // [myInstrument updateUI];
> - (void)updateUI
> {
>assert([NSThread isMainThread]);
> 
>// LEFT:  property of the object tied to the UI through bindings made in IB
>// RIGHT: as a quick fix: variable member of the object updated using a 
> background thread.
>self.lastPT100Temperature= self->l_PT100Temperature;
>self.lastPAAtmosphericPressure= self->l_PAAtmosphericPressure;
>
>// etc...
> }
> 
> This function is called once every second on the main thread like this :
> 
> - (void)startUIAutoUpdate
> {
>// @property (strong) dispatch_source_t uiRefreshTimer;
>self.uiRefreshTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 
> 0, 0, dispatch_get_main_queue());
>dispatch_source_set_timer(self.uiRefreshTimer, DISPATCH_TIME_NOW, 1.0 * 
> NSEC_PER_SEC, 0.25 * NSEC_PER_SEC);
> 
>__weak typeof(self) weakself = self;
>dispatch_source_set_event_handler(self.uiRefreshTimer,
>^{
>@autoreleasepool
>{
>__strong typeof(weakself) strongself = weakself;
> 
>[strongself.myInstrument updateUI];
>// etc...
>}
>};
> 
>dispatch_resume(self.uiRefreshTimer);
> }
> 
> OBSERVATIONS
> The app starts by taking around 25 MB of memory (reported by Activity 
> monitor). After 17h, I see around 5GB of memory used. After a few days… the 
> app crashes. On the other hand, if I comment the family of lines 
> "[strongself.myInstrument updateUI]", the app can run for a month using only 
> 25-35 MB of memory. Data are still collected every second and stored on disk 
> of course, but not shown on screen.
> 
> If I prevent my app from trying to communicate with the instruments (by not 
> instantiating the objects representing the communication interface) I can 
> make it run faster and take thousands of dummy data points a second (and 
> store them on the disk). The leaking issue is a little increased, but not by 
> a factor of 1000. Only by a factor of 30 to 60. This is consistent with a UI 
> refresh issue.
> 
> Additionally, I was unable to find any leaks with Instruments (but I barely 
> know how to use it) and the amount of memory reported by Instruments is far 
> less than the one reported by Activity monitor (but still, the system starts 
> swapping a lot after a while, so Activity monitor must be right). But 
> interestingly, when switching apps with CMD-TAB, Instruments shows memory 
> jumps (memory brutally decreases).
> 
> QUESTION
> Well, I feel a little lost at this point. I lack the know-how to further 
> investigate the issue. Does anyo

Re: Adding Constraints in Code

2015-09-14 Thread Gary L. Wade
Without digging into your code, it sounds like you've got some wrong 
assumptions of how things work and that you're doing way too much. Try taking 
Apple's example and iteratively add your own pieces:

https://developer.apple.com/library/mac/samplecode/InfoBarStackView/Introduction/Intro.html#//apple_ref/doc/uid/DTS40013589-Intro-DontLinkElementID_2
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.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: Auto Layout Problems

2015-09-04 Thread Gary L. Wade
It seems your thread keeps changing subjects so it's been difficult to follow 
your troubles back to something at the start, or maybe something's gotten lost.

If you have a view in a XIB, you can usually choose to embed it in a scroll 
view (there's a menu item for that) which should take care of your issues, 
provided that view is the one which changes size.

If it doesn't, look at NSScrollView for a method named something like reflect 
document size change and call it after changing your view's size.

The scroll view and clip view work together to keep everything coordinated with 
the document view's size, which just refers to your sizable view that you 
embedded within a scroll view (a stack view if I've followed things correctly). 
Be very sure you need another view between them before adding one. If so, that 
should be the scroll view's document view and you should only handle changing 
its size.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.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: Auto Layout Problems

2015-09-04 Thread Gary L. Wade
As I mentioned, start with your stack view in your window, embed it in a scroll 
view using the menu command to do this, and add your constraints on the scroll 
view to position it within your window. It's easier and less error-prone if you 
do it this way. If you'd rather do it in code, do a search for a tutorial using 
NSScrollView Autolayout.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Sep 4, 2015, at 10:48 AM, Dave <d...@looktowindward.com> wrote:
> 
> Hi,
> 
>> It seems your thread keeps changing subjects so it's been difficult to 
>> follow your troubles back to something at the start, or maybe something's 
>> gotten lost.
> 
> 
> What I’d dearly love to know right now is how to setup the Constraints for a 
> Scroll View and Clip View etc. in XCode/IB for Mac.
> 
> If I have a window in a NIB like this:
> 
> WindowInitially - Width=846, Height=594
>View
>ScrollViewInitially - X=20,Y=20, Width=806, 
> Height=554
>Flipped Clip View
>View
> 
> How do I set the constraints for the above Views in XCode/IB? 
> 
> I want the Scroll View to Stretch/Contract if the window is resized.
> 
> After this, I’d like to add a StackView to the Scroll View (in XCode/IB) and 
> have it Match the Size/Position of the Scroll View.
> 
> I’ve found (sketchy) articles describing how to it in XCode/IB for iOS and 
> I’’ve found (again sketchy) an article how to do it in Code for Mac.
> 
> Ideally I’d like to be able to do this and target 10.9 and using XCode 6.4.
> 
> All the Best
> Dave

___

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

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

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

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

Re: Auto Layout Problems

2015-09-03 Thread Gary L. Wade
Some of it does, but it still helps if you need to support earlier.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Sep 3, 2015, at 11:19 AM, Dave <d...@looktowindward.com> wrote:
> 
> Hi,
> 
>> Check out this year's WWDC videos on auto-layout, the part 1/2 ones. I 
>> believe (just now seeing this post) they will answer what you want and help 
>> you know that  you are not alone in your pain.
> 
> 
> Thanks for this, I’m watching them now.
> 
> In case anyone wants to watch them, they are at:
> 
> https://developer.apple.com/videos/wwdc/2015/?id=218
> 
> and
> 
> https://developer.apple.com/videos/wwdc/2015/?id=219
> 
> I take this requires XCode 7 and Mac OS X 10.11?
> 
> Thanks 
> Dave
> 
>> On 3 Sep 2015, at 18:33, Gary L. Wade <garyw...@desisoftsystems.com> wrote:
>> 
>> Check out this year's WWDC videos on auto-layout, the part 1/2 ones. I 
>> believe (just now seeing this post) they will answer what you want and help 
>> you know that  you are not alone in your pain.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.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: Auto Layout Problems

2015-09-03 Thread Gary L. Wade
Check out this year's WWDC videos on autolayout, the part 1/2 ones. I believe 
(just now seeing this post) they will answer what you want and help you know 
that  you are not alone in your pain.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Sep 3, 2015, at 10:23 AM, Dave <d...@looktowindward.com> wrote:
> 
> All I want is a dynamic list of views that can be disclosed or undisclosed. 
> I’m really beginning to think I’d be better off using Manual Layout and using 
> Table View or whatever.

___

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: NSTableView: Rows from bottom up

2015-09-01 Thread Gary L. Wade
One way to do this is to not use a table view but just a simple scroll/clip 
view setup and embed your content within it, pinning it only to the left, 
right, and bottom edges of the clip view and do your drawing in that view. You 
might be able to do it with a table view (and the typically associated 
scroll/clip view) if you disconnect the top connection of the table view from 
its clip view. I think they use the autolayout/alignment setting, but you might 
need full autolayout. After doing that, just draw your items in the 
reverse-order or insert from bottom of a table view to get it to grow up. 
Half-awake right now, but hope that gets you started.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Aug 31, 2015, at 6:51 PM, Eric Gorr <mail...@ericgorr.net> wrote:
> 
> Normally when one adds the first row to a NSTableView, it will appear at the 
> top of the view and additional rows will appear below it. Is it possible to 
> have the first row appear at the bottom of the NSTableView and for new rows 
> to appear above it?
> 
> No doubt this would require some extensive customization. I am open to 
> alternative solutions, but the one invariant will remain…first row at the 
> bottom and additional rows appearing above.
> 
> I could fake it by creating a large enough number of rows so the view is 
> filled and setting the scroll position to the bottom, but I find that to be a 
> bit inelegant…although, I would go that route before doing something 
> completely custom.
> 
> If you are wondering why someone might need such a thing, consider the case 
> of a calculator where the most common way to view the numbers (at least for 
> RPN entry) is for the most recent entry or calculation is to appear at the 
> bottom and previous entries to appear above it.

___

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: Tech update avoiding legacy code

2015-08-14 Thread Gary L. Wade
Many have mentioned the technical things, but when it comes to your business 
reasons, and you mentioned a point there, it might help to see why some of your 
customers haven't upgraded and see about addressing that. They may be fine with 
what they currently have, or they might see your update being the final reason 
to upgrade their computer or OS. Don't assume they won't, just ask, or just 
tell them the next version will require such-and-such OS X and leave it up to 
them for the next step.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.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 6.4 on the Developer download site.

2015-08-07 Thread Gary L. Wade
Be sure you have Developer Tools selected as a filter. For some reason, 
versions after than 6.1.1 were not tagged for iOS or OS X.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Aug 7, 2015, at 1:27 PM, Alex Zavatone z...@mac.com wrote:
 
 Yeah, no idea.  I downloaded i fine on another Mac.
 
 
 On Aug 7, 2015, at 4:00 PM, Jonathan Mitchell wrote:
 
 
 On 7 Aug 2015, at 20:45, Alex Zavatone z...@mac.com wrote:
 
 We were told a few times that the latest Xcodes should always be on the 
 developer downloads site at:
 
 https://developer.apple.com/downloads/
 
 I'm trying to download a copy of Xcode 6.4's installer and I can't see 
 anything up on that site that's more recent than 6.1.1 using Safari and 
 searching for Xcode
 
 Any ideas here?
 hmm...
 I can see it fine and can download from 
 http://adcdownload.apple.com/Developer_Tools/Xcode_6.4/Xcode_6.4.dmg.
 Not sure what gremlins you have encountered.
 
 Jonathan

___

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

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

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

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

Re: NSPropertyListSerialization weirdness

2015-07-26 Thread Gary L. Wade
When the file arrives, verify that the contents of it have also arrived. It's 
possible you may just be processing that a file was created but nothing yet has 
been put into it.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

 On Jul 26, 2015, at 2:28 PM, Robert Martin robmar...@frontiernet.net wrote:
 
 I’m having some issues. I’m tracking a folder that is I watch via kqueue, and 
 if a .plist arrives, I process it immediately. The plist contains a 
 dictionary, which is successfully read with dictionaryWithContentsOfFile:. If 
 I log the dictionary description, it is accurate. The dictionary only 
 contains strings, arrays of string, NSNumbers, or NSDates.
 
 Though I can guarantee that the plist is well formed when it’s sent, if I try 
 to serialize it with:
 
 NSData* plist = [NSPropertyListSerialization 
 dataWithPropertyList:updateDictionary];
 
 I get a null, and an error (200) that the plist contains null.
 
 Before I make that call, I put in a check for nulls, but none are found:
 
[updateDictionary enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL 
 *stop) {

if( obj == nil ){
*stop = YES;
NSLog( @nil obj for key: %@, key );
}

*stop =  NO;
}];
 
 I cannot understand how a dictionary which contains no nulls and only valid 
 classes can generate the NSPropertyListSerialization error. Any ideas?
 
 Rob

___

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: Auto Layout and Resizable NSViews

2015-07-20 Thread Gary L. Wade
Depending on your design, why not just use an NSSplitView to do all that for 
you?
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.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: C Sharp?

2015-07-17 Thread Gary L. Wade
As mentioned before, the app I referred to that Apple flagged was for the Mac 
App Store not the iOS App Store. If what you say is true, the current team will 
probably want to try again even after a recent rejection (far more recent than 
2010; we even talked with an evangelist a few months ago); I've forwarded it on.

My personal opinion, borne on a long history of going both ways on many 
products (cross platform Mac code on Windows and Windows code on Mac) has shown 
a product is far better when someone makes the effort to target the target 
platform not take shortcuts like this.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jul 17, 2015, at 8:26 AM, Jens Alfke j...@mooseyard.com wrote:
 
 
 On 16 Jul 2015, at 21:26, Gary L. Wade garyw...@desisoftsystems.com 
 mailto:garyw...@desisoftsystems.com wrote:
 
 Just keep in mind that according to Apple's App Store rules, this qualifies 
 as interpreted code. I worked on a really well known app that used a C# 
 component for a fairly important piece of functionality, and that part could 
 not be in our App Store version (the non-App Store could keep it), and our 
 company and Apple were criticized royally in the press.
 
 
 This isn’t the case anymore.
 
 There was a period in 2010 or so where Apple decided on a whim that iOS apps 
 couldn’t contain _any_ interpreted code (other than JavaScript in a 
 UIWebView.) That’s probably when the above happened. This policy was complete 
 bollocks, and Apple rescinded it about six months later … probably after a 
 number of big game developers showed them that nearly all game engines use 
 interpreters (mostly Lua or Python, and Unity uses C#) for in-game logic, and 
 it would be a shame if they had to withdraw all the top-selling games from 
 the App Store, wouldn’t it?
 
 The policy is back to forbidding _downloaded_ executable/interpretable code 
 (again except for JS executed in a WebView), which is sort of annoying but 
 generally makes sense from a security perspective. I was just reading 
 yesterday about some Android malware by Hacking Team that made it through 
 Google Play review because the nasty code wasn’t packaged in the app but 
 downloaded afterwards.
 
 —Jens

___

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

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

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

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

Re: C Sharp?

2015-07-17 Thread Gary L. Wade
That link isn't very useful. It pretty much regurgitates what Apple has already 
published and doesn't address the issue of rejection. Nevertheless, it's not my 
concern anymore, but I've forwarded your statements on to the team for further 
evaluation.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jul 17, 2015, at 9:02 AM, Jonathan Mitchell jonat...@mugginsoft.com 
 wrote:
 
 It looks like submitting to the Mac App store is a flyer:
 http://developer.xamarin.com/guides/mac/deployment,_testing,_and_metrics/publishing_to_the_app_store/#Upload_to_Mac_App_Store

___

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: C Sharp?

2015-07-16 Thread Gary L. Wade
Just keep in mind that according to Apple's App Store rules, this qualifies as 
interpreted code. I worked on a really well known app that used a C# component 
for a fairly important piece of functionality, and that part could not be in 
our App Store version (the non-App Store could keep it), and our company and 
Apple were criticized royally in the press.

Don't be that app. C# makes apps fall flat.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jul 16, 2015, at 1:14 PM, Jonathan Mitchell jonat...@mugginsoft.com 
 wrote:
 
 
 On 16 Jul 2015, at 19:56, Glenn R. Martin lifewar...@yahoo.com wrote:
 
 Is there any reason we can't just provide a lipo'd fat archive of both 32 
 and 64?
 I don’t know why this isn’t done (or else I am missing something).
 I can build Mono okay on OS X but I never located the packaging script that 
 takes the built libraries and builds the framework bundle.
 IIRC the actual Mono framework bundle is a bit non standard with some 
 components not exactly where you would expect them to be.
 
 Jonathan

___

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

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

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

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

Re: C Sharp?

2015-07-16 Thread Gary L. Wade
Actually the requirements are for both Mac and iOS; the app I referred to was 
on the Mac App Store. But, if that's not an issue, then that's okay. I just 
wanted to point that out in case it was a potentiality.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jul 16, 2015, at 2:49 PM, Dave d...@looktowindward.com wrote:
 
 
 On 16 Jul 2015, at 21:26, Gary L. Wade garyw...@desisoftsystems.com wrote:
 
 Just keep in mind that according to Apple's App Store rules, this qualifies 
 as interpreted code. I worked on a really well known app that used a C# 
 component for a fairly important piece of functionality, and that part could 
 not be in our App Store version (the non-App Store could keep it), and our 
 company and Apple were criticized royally in the press.
 
 Don't be that app. C# makes apps fall flat.
 
 First off I think that’s for iOS not Mac and secondly this App isn’t going 
 the App Store so it doesn’t matter anyway.
 
 Cheers
 Dave
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
 
 This email sent to garyw...@desisoftsystems.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: Just a request for a quick sanity check please.

2015-07-14 Thread Gary L. Wade
If the NSURLConnection in question has been started asynchronously, your 
described scenario sounds appropriate. In fact, it's what Apple recommends 
since the class will handle things in the background and only report back on 
progress. A synchronous request would fall into the questionable realm.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jul 14, 2015, at 8:27 AM, Alex Zavatone z...@mac.com wrote:
 
 I'm looking at some Cocoa spaghetti that seems to violate all the laws or 
 reason and I'd just appreciate some verification that there is no reason 
 whatsoever that a sane Cocoa developer would ever do this before I go and 
 change this code.
 
 Am I correct in assuming that there is no rational reason why a sane person 
 would force an NSURLRequest and NSURLConnection to run on the main thread 
 with a dispatch_sync for an operation that should not block the UI and 
 doesn't need to be sync?
 
 Why would someone force an NSURLConnection to run on the main thread?
 
 My brain hurts looking at this.
 
 It's too early in the day to want a third cup of coffee.

___

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: Edit menu localisation, default application menu

2015-07-11 Thread Gary L. Wade
 On Jul 11, 2015, at 2:03 AM, Uli Kusterer witness.of.teacht...@gmx.net 
 wrote:
 
 In particular, use unique keys for each bit of text you localize, don't use 
 the English strings. Words in languages are like circles in a Venn diagram, 
 they overlap, but are rarely identical. Therefore, it's very easy to 
 mis-translate something by using a translation that is correct in one context 
 and nonsensical in another, because the other language would use a different 
 word.

I agree with this but should point out that this goes against the philosophies 
of some within Apple (including a team I briefly worked on) who insist on using 
the full English string as the key and using genstrings to generate and match 
such strings.

One such example on an older product I worked on had the single word State 
used as labels for two different selections for very good reasons. For example, 
one place might have an answer California (geopolitical location) and another 
context would be On (condition of a variable), but at least on that product, we 
had not coalesced the strings in the way genstrings does; however, our British 
English translation did for a brief time humorously label On and Off with 
County (I imagined a Monty Python skit could from that).
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.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: PSA: floor(NSFoundationVersionNumber) doesn't work with Yosemite or later

2015-07-11 Thread Gary L. Wade
On Jul 10, 2015, at 5:31 PM, Ben Kennedy b...@zygoat.ca wrote:

 Once Yosemite stops being updated, we can of course use the constant for the 
 last version that’s released, but since we still can’t say with 100% 
 certainty that there won’t be a 10.10.5, we can’t really rely on this.
 
 No kidding. (Never mind the fact that the notion of using a floating point 
 number for such identification is inherently laughable, but I guess that was 
 codified in yore.

For all version numbers I encounter, I encapsulate them with a class I've 
written that parses them according to their formatting (build numbers with 
embedded letters, dotted values, etc.) and stores them in an NSIndexPath making 
comparisons between two versions very easy. Whenever I encounter a new version 
number format, I add a new parser and string formatter tied to a new enum.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.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: selectText of NSTextField on focus

2015-07-06 Thread Gary L. Wade
You want to select the text using the associated text view of the NSTextField 
control.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jul 6, 2015, at 10:54 AM, Richard Charles rcharles...@gmail.com wrote:
 
 
 On Jul 6, 2015, at 10:15 AM, Richard Charles rcharles...@gmail.com wrote:
 
 I have a NSTextField subclass that selects all of the text when the user 
 clicks it. This is accomplished by overriding becomeFirstResponder.
 
 - (BOOL)becomeFirstResponder
 {
   BOOL result = [super becomeFirstResponder];
   if(result) {
   [self performSelector:@selector(selectText:) withObject:self 
 afterDelay:0];
   }
   return result;
 }
 
 http://stackoverflow.com/questions/2195704/selecttext-of-nstextfield-on-focus
 
 This has worked perfectly for years until 10.10 Yosemite. Now when the user 
 clicks into the text field nothing is selected.
 
 Also the following error will often occur on 10.10 Yosemite when clicking on 
 the text field.
 
 2015-07-06 10:09:04.287 MyApp[727:15035] Bad cursor rect event, flags = 256
 
 Does anyone have any insight into what is going on?
 
 Thanks so much.
 
 --Richard Charles
 
 Update
 
 The documentation for -[NSTextField selectText:] states If the receiver 
 isn’t in some window’s view hierarchy, this method has no effect.”
 
 I have verified that the text field is in the window’s view hierarchy. I have 
 verified that -[NSTextField selectText:] is getting called. (Actually it is 
 getting called twice, once by the frameworks for some reason, and once by 
 me.) Calling the method -[NSTextField isSelectable] returns YES.
 
 It appears that -[NSTextField selectText:] is broken in 10.10 Yosemite. It 
 just does not work.
 
 --Richard Charles

___

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

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

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

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

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Gary L. Wade
 On Jun 13, 2015, at 5:14 PM, Michael David Crawford mdcrawf...@gmail.com 
 wrote:
 
 To code for OS X or iOS in C++ I can use ZooLib which I prefer quite a
 lot to any other framework I've ever used.
 …
 Available for Software Development in the Portland, Oregon Metropolitan Area.

And that's an example of how there's always consequences to our actions.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.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: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Gary L. Wade
To answer your question, Swift adds an expressiveness for nullability to APIs, 
more type expressiveness on collection constituents, a better pattern for 
if/else if/else if/.../else for object-equality testing that mirrors C 
switch/case, less conversion needed between analogous C types and Cocoa-related 
types, and with Swift 2, a compiler-supported, single-runtime-coded method to 
deal with unsupported APIs on older OSes. There are others, by the way.

All of these things can be done with Objective-C and lots of C-based code, but 
those require comments, extra code, and an understanding on the part of the 
developer to remember certain patterns whereas with Swift, the compiler 
enforces these.

One can write object-oriented code that mirrors the functionality of C++ by 
using structures, function pointers, and multiple synchronized arrays, but when 
you have a means to do all that for you, you're free to move on to developing 
what you really want rather than working on the plumbing all the time. Of 
course, compiler developers must think of these things, but the vast majority 
of us aren't them.

Disclaimer: I've not jumped onto the Swift bandwagon yet due to a variety of 
reasons, but I will soon.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

 On Jun 13, 2015, at 4:42 PM, Carl Hoefs newsli...@autonomy.caltech.edu 
 wrote:
 
 Bingo. Even after reading all the posts in this thread, I still don’t know 
 what problem Swift addresses, and no one seems to be able to answer that 
 question — not even Apple in its marketing hype.

___

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

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

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

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

Re: Language options: Objective-C, Swift, C or C++?

2015-06-13 Thread Gary L. Wade
 On Jun 13, 2015, at 5:14 PM, Michael David Crawford mdcrawf...@gmail.com 
 wrote:
 
 To code for OS X or iOS in C++ I can use ZooLib which I prefer quite a
 lot to any other framework I've ever used.
 …
  Available for Software Development in the Portland, Oregon Metropolitan Area.

And that's an example of how there's always consequences to our actions.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.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: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Gary L. Wade
Since Swift is new, it's been designed to handle the problems you get with 
Objective-C's fully dynamic nature. Also, there's only so much you can modify 
Objective-C before it's no longer a superset of C. You might have heard the 
reason the caret character was used for blocks is due to it being the only 
non-ambiguous character that could be used.

Besides, in Swift, we can now have variable names in Klingon script! Well, when 
Klingon is finally added to Unicode, that is.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jun 12, 2015, at 7:32 PM, Carl Hoefs newsli...@autonomy.caltech.edu 
 wrote:
 
 What problem/issue/deficiency is Swift intended to address?

___

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: NSDocumentTitlebarPopoverViewController zombie on Yosemite

2015-05-28 Thread Gary L. Wade
We saw the same issue starting with 10.10.3 and continuing through current 
10.10.4 builds. Write up a radar and reference radar://problem/20368338 as a 
duplicate instance.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On May 28, 2015, at 11:34 AM, Matthew LeRoy mle...@minitab.com wrote:
 
 Hi,
 
 Anybody know anything about NSDocumentTitlebarPopoverViewController, and/or 
 why I’m getting application crashes due to a zombie’d instance thereof?
 
 Document-based app, Deployment Target and SDK both 10.8. Built using Xcode 
 5.1.1 (5B1008) on Yosemite 10.10.3; running on the same system. Here’s what I 
 do:
 
 1. Run my app.
 2. Open an existing document from disk.
 3. Click on the document name in the window’s titlebar to open the Document 
 name/tag/location popover.
 4. Wait a second or two.
 5. Click elsewhere in my document window to close the popover.
 6. Crash.
 
 Sometimes the crash happens immediately after the popover disappears; other 
 times it happens 1-3 seconds later. It doesn’t happen every time, but always 
 within two to three repetitions of steps 3–5. Here’s the stack trace when it 
 crashes:
 
 frame #0: 0x7fff84a13d20 CoreFoundation`___forwarding___ + 768
 frame #1: 0x7fff84a13998 CoreFoundation`__forwarding_prep_0___ + 120
 frame #2: 0x7fff92603547 ViewBridge`-[NSRemoteViewBase 
 endAllModalSessions:] + 177
 frame #3: 0x7fff925fbe74 ViewBridge`-[NSRemoteViewBase 
 viewWillMoveToWindow:] + 367
 frame #4: 0x7fff864b90de AppKit`-[NSView _setWindow:] + 257
 frame #5: 0x7fff849ea705 CoreFoundation`__53-[__NSArrayM 
 enumerateObjectsWithOptions:usingBlock:]_block_invoke + 133
 frame #6: 0x7fff849e9e09 CoreFoundation`-[__NSArrayM 
 enumerateObjectsWithOptions:usingBlock:] + 313
 frame #7: 0x7fff86c3d474 AppKit`__21-[NSView _setWindow:]_block_invoke735 
 + 169
 frame #8: 0x7fff864b9c54 AppKit`-[NSView _setWindow:] + 3191
 frame #9: 0x7fff864c73d7 AppKit`-[NSVisualEffectView _setWindow:] + 214
 frame #10: 0x7fff86722747 AppKit`-[NSPopoverFrame _setWindow:] + 111
 frame #11: 0x7fff8670961f AppKit`-[NSWindow dealloc] + 1201
 frame #12: 0x7fff8679c9f5 AppKit`-[_NSPopoverWindow dealloc] + 74
 frame #13: 0x7fff864b68cc AppKit`-[NSWindow release] + 193
 frame #14: 0x7fff8497fdb0 CoreFoundation`CFRelease + 304
 frame #15: 0x7fff849a0bbd CoreFoundation`-[__NSArrayI dealloc] + 125
 frame #16: 0x7fff9211d89c 
 libobjc.A.dylib`objc_object::sidetable_release(bool) + 236
 frame #17: 0x7fff92103e8f libobjc.A.dylib`(anonymous 
 namespace)::AutoreleasePoolPage::pop(void*) + 575
 frame #18: 0x7fff849a16f2 CoreFoundation`_CFAutoreleasePoolPop + 50
 frame #19: 0x7fff8c1c1762 Foundation`-[NSAutoreleasePool drain] + 153
 frame #20: 0x7fff8650ccc1 AppKit`-[NSApplication run] + 800
 frame #21: 0x7fff86489354 AppKit`NSApplicationMain + 1832
 
 After enabling Zombie Objects, I get the following in the console:
 
 2015-05-28 14:19:58.291 MyApp[23684:2561441] *** 
 -[NSDocumentTitlebarPopoverViewController isKindOfClass:]: message sent to 
 deallocated instance 0x60146f60
 
 Google is no help, although it did uncover the following tweet from just a 
 few days ago: https://twitter.com/tonyarnold/status/603424801152086017.
 
 Anybody run across this before, or have any thoughts on what the problem 
 could be and/or how to debug?
 
 Thanks!
 
 Matt

___

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: Inserting a task into the run loop

2015-03-22 Thread Gary L. Wade
This all depends on how deep your simulation is, but devices are rarely so 
synchronous in operation, and I'd run a device on a separate thread to 
simulate its independent nature, and have its operation changes posted to an 
appropriate queue, such as the main one. If the main queue needs to communicate 
back, it should post to the device's queue. In the days when a runloop needed 
more consideration, I'd use a runloop source scheduled on an appropriate 
runloop that gets triggered by the device.

If the purpose of your work is to simulate all this, though, using any of 
these, even your original runloop design, might add the wrong constraints to 
your system.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

 On Mar 22, 2015, at 4:28 PM, Graham Cox graham@bigpond.com wrote:
 
 
 On 23 Mar 2015, at 9:52 am, Ken Thomases k...@codeweavers.com wrote:
 
 I'd be curious to know how run all the time, run as often as possible, 
 and an endless loop jibe with not heavyweight processing and isn't 
 going to be a huge drain on anything in your mind.
 
 Processor intensive code is not code which does hard work.  It's just code 
 that runs all the time.
 
 I think you need to think more about what you need and whether it's 
 reasonable.
 
 
 Yes, I'm thinking about that :)
 
 The code in question is the data model for a digital logic simulation. Each 
 cycle of the loop it looks at whether any state of any device has changed 
 and propagates the change. If no state has changed, it doesn't really do 
 anything - it just iterates over a bunch of devices checking a flag. If some 
 state has changed it still may not really do anything - some state changes 
 ultimately get reflected in the UI in various ways, but many are simply 
 internal changes that have no UI to update (the user gets to decide because 
 they can build anything). The model is hierarchical so if there's no state 
 change to any device, the root of the system doesn't have its flag set 
 either, so the root level which implements the whole simulation cycle just 
 sits and spins waiting on that flag.
 
 What I do want (I think) - is that the simulation is very fine-grained 
 compared with user interaction with it. Essentially, each cycle of the 
 simulation is equivalent to the propagation delay of a device (I use the 
 term device to mean anything that has some logical function other than just 
 propagating a signal from one point to another, i.e. a wire). To allow 
 realistic timing these delays want to be very small. I'm obviously not 
 expecting to achieve real-time simulation with propagation delays in the 
 order if nanoseconds, and the cycle time itself can pretend to be whatever I 
 want, but I do want these times to be realistically short with respect to 
 user interaction, so for example if they flip a switch to change the state of 
 an input, an entire circuit will respond to that change with realistic 
 delays, so it appears to operate in real time, and an analysis of the timing 
 will show realistic propagation delays which appear to be reported in 
 nanoseconds.
 
 The cycle-based approach works really well because it allows feedback loops 
 around devices to work correctly without getting stuck in an infinite loop, 
 but if I allow the cycle loop to sleep and wait for user input, my cycle 
 timing ends up off because it has no idea how many faked cycles it should 
 account for, or if I actually use the true measured time, the propagation 
 delays are revealed as unrealistically long - many milliseconds rather than 
 some faked nanoseconds. Perhaps all I need to do is to think about these 
 timing calculations rather than trying to make my loop run faster??? Not 
 sure...
 
 I believe I want my simulation to run as fast as possible but because in an 
 idle state a given circuit may simply sit there doing nothing it shouldn't be 
 burning up a lot of processing time as such.
 
 --Graham

___

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

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

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

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

Re: Cleaning up a project from static/global variables

2015-03-21 Thread Gary L. Wade
If you’re wanting to look at all the globals in your project in one place,
go to the Symbol Navigator and make sure the Class/Protocol filter is
turned off and the Project-Defined filter is turned on.  This will give
you easy access to your project-defined globals.
--
Gary L. Wade
http://www.garywade.com/

On 3/21/2015, 12:48 PM, Eyal Redler eyred...@netvision.net.il wrote:


I can do a search for static but some are plain globals: variables
defined outside of any method.

Eyal



 On Mar 21, 2015, at 6:34 PM, Quincey Morris
quinceymor...@rivergatesoftware.com wrote:
 
 On Mar 21, 2015, at 09:07 , Eyal Redler eyred...@netvision.net.il
wrote:
 
 I have a rather large ObjC and C project that I want to clean-up in
order to make it re-enterent/thread safe.
 There are all sorts of issues I need to deal with here but one of the
most troubling is the rather liberal use of static and global variables
through the project. Fixing the issues is not a problem but I need a
way to be able to find these in all the files (other then actually
scanning each file manually). Are there any tools that can help me do
this?
 
 An Xcode project? Why can’t you use global find (Command-3)? And if
searching textually is too crude, there are options near the top of the
global find panel that allow you to search symbolically.
 




___

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: Displaying a scaling, relative time or date

2015-01-08 Thread Gary L. Wade
When it comes to any localized date or number formatters, see if ICU supports 
it, especially the included version on the earlier OS you need to support. If 
not but a later one does, you could just include it in your app.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

 On Jan 7, 2015, at 4:52 PM, Ken Thomases k...@codeweavers.com wrote:
 
 On Jan 7, 2015, at 6:18 PM, Graham Cox graham@bigpond.com wrote:
 
 I want a label in my interface to display a relative time using a sensible 
 approximate scale depending on the value. I'm not sure if I can use 
 NSDateFormatter for this - it seems it's a bit too fixed in using only the 
 units you assign.
 
 For example, if the value is less than a minute, it should say x seconds 
 ago, if it's in the range of 1-59 minutes, x minutes ago, about an hour 
 ago, x hours ago, yesterday, x days ago, about a week ago, x weeks 
 ago, about a month ago, x months ago - you get the picture. Is this 
 possible using NSDateFormatter, or do I have to roll my own for this?
 
 If you can require 10.10 or iOS 8, there's a new class for this: 
 NSDateComponentsFormatter.  There's no class reference for it yet.  It's 
 described in the Foundation release notes 
 https://developer.apple.com/library/mac/releasenotes/Foundation/RN-Foundation/#10_10Formatters
  and in its header file.
 
 If you can't require those versions of the OSes, then I think you have to 
 roll your own.  Or find a third-party library/framework/class.
 
 Regards,
 Ken

___

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

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

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

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

Re: WTF is happening?

2014-12-13 Thread Gary L. Wade
If all you care about is if an object is a proxy or not, look at isProxy.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

 On Dec 13, 2014, at 11:06 AM, Maxthon Chan m...@maxchan.info wrote:
 
 What I am doing here is scanning all loaded classes for subclasses of a 
 certain class. Before any NSObject method can be issued I have to check if it 
 is actually NSObject or NSProxy derivative instead of an Object derivative 
 that does not support NSObject methods. This calls for runtime equivalent for 
 one of the following NSObject methods:
 
 - [NSObject respondsToSelector:(SEL)aSelector] = 
 class_respondsToSelector(Class, SEL) // this crashed.
 + [NSObject conformsToProtocol:(Protocol *)aProtocol] = 
 class_conformsToProtocol(Class, Protocol *) // check for NSObject protocol, 
 this does not work.
 + [NSObject isSubclassOfClass:(Class)aClass] // no equivalent, have to 
 implement it myself
 
 I ended up creating this:
 
 BOOL class_isSubclassOfClass(Class cls, Class other)
 {
for (Class c = cls; c; c = class_getSuperclass(c))
if (c == other)
return YES;
return NO;
 }
 
 If i remembered it right GNUstep runtime have this function. I will file a 
 bug report to Apple and ask them to add this, as it is useful in class 
 scanning and i am using this technique heavily in jailbreak detection.
 
 On Dec 14, 2014, at 01:20, Kyle Sluder k...@ksluder.com wrote:
 
 On Sat, Dec 13, 2014, at 10:19 AM, Phillip Mills wrote:
 Why do you think the problem is with “respondsToSelector:”?  The error
 says you’re accessing past the end of a string.
 
 Because the crash happens in a call stack that originates in
 class_respondsToSelector, and involves none of Maxthon's code.
 
 --Kyle Sluder

___

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

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

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

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

Re: WTF is happening?

2014-12-13 Thread Gary L. Wade
Are you saying that Apple's well-documented approach to see if an object is 
derived from NSProxy does not work? If that's the case, you need to submit a 
bug report to Apple. That's a serious issue that only Apple can help you with.

If you are using objects not derived from NSObject nor NSProxy, then change 
your design.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

 On Dec 13, 2014, at 11:40 AM, Maxthon Chan m...@maxchan.info wrote:
 
 Ain’t work! Will crash if an Object derivative showed up.
 
 I am scanning ALL loaded classes and only subclasses of a certain class is 
 interested. But due to the nature of this class scanning before I can make 
 sure that the class derives from NSObject I cannot call any method on it.
 
 On Dec 14, 2014, at 03:34, Gary L. Wade garyw...@desisoftsystems.com wrote:
 
 If all you care about is if an object is a proxy or not, look at isProxy.
 --
 Gary L. Wade (Sent from my iPad)
 http://www.garywade.com/
 
 On Dec 13, 2014, at 11:06 AM, Maxthon Chan m...@maxchan.info wrote:
 
 What I am doing here is scanning all loaded classes for subclasses of a 
 certain class. Before any NSObject method can be issued I have to check if 
 it is actually NSObject or NSProxy derivative instead of an Object 
 derivative that does not support NSObject methods. This calls for runtime 
 equivalent for one of the following NSObject methods:
 
 - [NSObject respondsToSelector:(SEL)aSelector] = 
 class_respondsToSelector(Class, SEL) // this crashed.
 + [NSObject conformsToProtocol:(Protocol *)aProtocol] = 
 class_conformsToProtocol(Class, Protocol *) // check for NSObject protocol, 
 this does not work.
 + [NSObject isSubclassOfClass:(Class)aClass] // no equivalent, have to 
 implement it myself
 
 I ended up creating this:
 
 BOOL class_isSubclassOfClass(Class cls, Class other)
 {
  for (Class c = cls; c; c = class_getSuperclass(c))
  if (c == other)
  return YES;
  return NO;
 }
 
 If i remembered it right GNUstep runtime have this function. I will file a 
 bug report to Apple and ask them to add this, as it is useful in class 
 scanning and i am using this technique heavily in jailbreak detection.
 
 On Dec 14, 2014, at 01:20, Kyle Sluder k...@ksluder.com wrote:
 
 On Sat, Dec 13, 2014, at 10:19 AM, Phillip Mills wrote:
 Why do you think the problem is with “respondsToSelector:”?  The error
 says you’re accessing past the end of a string.
 
 Because the crash happens in a call stack that originates in
 class_respondsToSelector, and involves none of Maxthon's code.
 
 --Kyle Sluder
 

___

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

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

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

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

Re: Trouble getting ISO-8859-1 encoded feed to parse and display

2014-11-23 Thread Gary L. Wade
First, be sure the content in the XML document you're getting back matches the 
encoding in the header. If it doesn't and you have no control over the creation 
of it, you'll have to figure out the character set yourself. There's also some 
methods in NSString that will try to figure out that for you and return that. 
Secondly, ISO-8859-1 and UTF-8 are not equivalent.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

 On Nov 23, 2014, at 1:06 PM, Diederik Meijer | Ten Horses 
 diede...@tenhorses.com wrote:
 
 Hi list,
 
 I am having trouble getting useful data from this url on some, but not all, 
 iOS devices: https://www.taxpublications.deloitte.co.uk/tis/dtp.nsf/pub1.xml
 
 The feed has this opening tag: ?xml version=1.0 encoding=ISO-8859-1 ?
 
 When I just pull in the feed’s contents using a NSURLConnection, it will show 
 up on some, but not all, devices.
 
 When I try to log the response data, by creating a string that I init with 
 the downloaded data and NSUTF8StringEncoding, the log will show a null 
 string. So putting the downloaded data into a string using UTF8 doesn’t work.
 
NSString *dataString = [[NSString alloc] initWithData:self.dataContainer 
 encoding:NSUTF8StringEncoding];
 
 
 Still, in that case, some devices will show the parsed feed, some won’t.
 
 I tried converting the data into NSISOLatin1 and then putting it back into 
 NSData using UTF8, as below, but that doesn’t help.
 
 -(void)connectionDidFinishLoading:(NSURLConnection *)connection {
NSString *dataString = [[NSString alloc] initWithData:self.dataContainer 
 encoding:NSISOLatin1StringEncoding];
[self setDataContainer:[[dataString 
 dataUsingEncoding:NSUTF8StringEncoding] mutableCopy]];
self.xmlItems = [NSMutableArray array];
NSXMLParser *parser = [[NSXMLParser alloc] 
 initWithData:self.dataContainer];
[parser setDelegate:self];
[parser parse];
 }
 
 
 I validated the feed’s XML and got no errors..
 
 Anybody out there with experience in solving this?
 
 
 Many thanks!
 
 
 
 Diederik
 ___
 
 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/garywade%40desisoftsystems.com
 
 This email sent to garyw...@desisoftsystems.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: start with OSX 5.1.1

2014-07-30 Thread Gary L. Wade
Your Xcode 3.2.6 project most likely references at most 10.6, which is not 
supported by Xcode 5.1.1, so you'll need to adjust your project's SDKs to match 
those installed. Select the project in the file viewer, choose the build 
settings panel, and enter SDK in the search field.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jul 29, 2014, at 11:02 PM, N!K pu56ucl...@alumni.purdue.edu wrote:
 
 
 After using Xcode 3.2.6 occasionally, I downloaded 5.1.1 and typed in a very 
 simple program in .h and .m to try it out.
 
 Run immediately generated the error
 
 The run destination My Mac 64–bit is not valid for Running the scheme 
 ‘var,prop,synth'.
 The scheme 'var,prop,synth' contains no buildables that can be built for the 
 SDKs supported by the run destination My Mac 64–bit. Make sure your targets 
 all specify SDKs that are supported by this version of Xcode.”
 
 I couldn’t find any applicable instructions with Google. 
 My iMac is 64 bit (runs photoshop cs6}.
 Referring to the program as a scheme is new to me, and I don’t know how to 
 check what SDKs are in my Xcode 5.1 application, as it is listed in 
 Applications.  As much as I could find out is that it has 4.96 Gb. This is 
 not  like 3.2.6, which came in a Developer folder with a list of items for 
 direct access.
 
 Please help me get started.
 
 Nick

___

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

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

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

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

Re: start with OSX 5.1.1

2014-07-30 Thread Gary L. Wade
True, but some details appear to be missing, and it sounds more like there was 
an original project from the 3.2.6 days that was opened in 5.1.1 (the op is 
only new to 5.1.1, not Xcode). It sounds more like after the project was opened 
in 5.1.1, some changes were made to the project like making a new header and 
source file which the op assumed to be the problem, probably because the 
project hadn't been built first.

I've seen that kind of error lots of times just by trying to build some really 
old projects. Sometimes recreating the project from scratch is best, but most 
of the time just adjusting the deployment target and base SDKs gets things 
going.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jul 30, 2014, at 10:12 AM, Jens Alfke j...@mooseyard.com wrote:
 
 
 On Jul 30, 2014, at 6:53 AM, Gary L. Wade garyw...@desisoftsystems.com 
 wrote:
 
 Your Xcode 3.2.6 project most likely references at most 10.6, which is not 
 supported by Xcode 5.1.1, so you'll need to adjust your project's SDKs to 
 match those installed. Select the project in the file viewer, choose the 
 build settings panel, and enter SDK in the search field.
 
 Honestly, if it’s a simple project and the OP is new-ish to Xcode, it’d be 
 easier just to create a new project in Xcode 5 and add the existing source 
 files.
 
 —Jens
___

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

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

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

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

Re: start with OSX 5.1.1

2014-07-30 Thread Gary L. Wade
If you do that, make sure the owner/groups match the app to make sure you don't 
modify them accidentally.

And one of these days Apple will utilize those deprecation/available attributes 
so we can arbitrarily set and test SDKs without having to do any of this.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jul 30, 2014, at 9:21 PM, Roland King r...@rols.org wrote:
 
 
 
I'm not sure whether this counts as just a point of order or something, 
 but my  Project Format 3.2 compatible project targets 10.6 just fine in 
 xcode 5.1.1, ( and xcode 433 and 402 ).  To install the 10.6 SDK into 
 Xcode 5, I just dragged it in the finder from my xcode 3 installation into 
 my xcode 5 installation… done.
 
 And about once a year the guys this comes up on the Xcode list and the guys 
 from Apple who write and support Xcode ask people please not to do that 
 because it’s not something supported or tested and may yield unpredictable 
 results. Generally people report success doing it but drive with care. 

___

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: [NSMutableData resetDataRangeTo:(NSRange)range];

2014-07-14 Thread Gary L. Wade
The reason you can't do exactly what you're asking is because there may be 
other owners of the immutable object. Since NSMutableData is a subclass of 
NSData, you should ask yourself where you're creating the object and try 
creating it from the start as mutable, and also if there are owners of the 
object that would be okay with that difference.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

 On Jul 14, 2014, at 12:15 PM, Carl Hoefs newsli...@autonomy.caltech.edu 
 wrote:
 
 Okay, 1 last question on this. Is there a way to promote-in-place an NSData 
 object into an NSMutableData object?  -becomeMutable or some such? I'm trying 
 to avoid copying megabytes of data/sec if it's avoidable.

___

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

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

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

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

Re: Issue with -[NSOutlineView autosaveExpandedItems] - SOLVED

2014-07-11 Thread Gary L. Wade
On 7/11/2014, 1:29 PM, Bill Cheeseman wjcheese...@gmail.com wrote:

 And I've discovered another difficulty, although I think I can handle it.


Sounds like it’s time to update Cocoa Recipes to a 3rd edition to fully
share these nuggets.
--
Gary L. Wade
http://www.garywade.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: UUIDs for FAT Drives

2014-07-08 Thread Gary L. Wade
Some observations about your sample code, keep in mind that when you
finalize your production code, that volume paths cannot necessarily be
completely represented in ASCII, there shouldn’t be a need to go from an
NSString to a C-String to a CFURLRef/NSURL (just go from the NSString to
the CFURLRef/NSURL), and drives are physical entities while volumes are
logical data on those, so you may have multiple volumes per drive.
--
Gary L. Wade
http://www.garywade.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: Simple question? NSButton/checkbox color

2014-06-06 Thread Gary L. Wade
If I were colorizing such a button, I'd try overriding drawRect: and have the 
superclass draw in my own focused image, desaturate anything that's fully 
opaque (check boxes aren't necessarily rectangular nor completely contained), 
and then apply the desired color with a less-than-1.0 (25% maybe) alpha. After 
that I'd draw my focused image within the context that was given at the time my 
drawRect: was called. However, you would need to be careful to be sure whatever 
background color is present is preserved and also not tinted, and any shadows 
are correctly handled, and you'd need to handle any intermediate drawing states 
(including the actual check mark, whatever it may be) and retina issues that 
may come up.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.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: How to write a .icns file

2014-06-02 Thread Gary L. Wade
The file format for an icns file is the same as an 'icns' resource, which is 
documented in IconStorage.h.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jun 2, 2014, at 5:04 PM, John Brownie john_brow...@sil.org wrote:
 
 On Sat May 31 2014 12:37:59 GMT+1000 (PGT) Gary L. Wade wrote:
 Maybe you could get by just saving those icons that are more modern? You may 
 truly need to keep them, but there's practically no need for 'ICN#' and 
 their like anymore in modern OS X. The most modern ones (especially the 
 retina-based ones) are just wrappers around PNG, JPEG, image file data, 
 anyway.
 
 I haven't read of any limitations like you describe, so maybe it's a bug, 
 possibly a half-Carbon accidental-deprecation (I found this happened for 
 compositing icons).
 
 Since the 'icns' format is well documented, why not make as many subsets as 
 required using ImageIO and then programmatically combine all your 'icns' 
 into a single 'icns'? It's a kludge, but it would work.
 
 If you want to investigate more, maybe see if the 15-image limitation only 
 happens when one of the modern icon formats is present like a retina-based 
 one. Then, that might add fuel to your bug report and/or provide extra info 
 for your 'icns' merge operation.
 
 Thanks for the thoughts. I am not sure that I agree with the statement that 
 the 'icns' format is well documented. A search turned up the Wikipedia page, 
 which is pretty cursory, but eventually led me to the IconFamily page, which 
 looks (at a first glance) to do what I need, though it hasn't been updated in 
 more than four years, and doesn't mention retina.
 
 Digging more deeply into what I'm getting, there are eight different icon 
 sizes (16x16, 18x18, 32x32, 36x36, 48x48, 128x128, 256x256, 512x512), seven 
 of which occur twice (all but 48x48), clearly being the normal and @2x 
 versions. As a first work-around, just grabbing the unique sizes and using 
 ImageIO to create a .icns file (via NSData) works, sort of. I only seem to 
 get one representation, is32 (16x16 24-bit), which is weird, since I'm giving 
 it eight types. I don't see a simple way of working out which ones are the 
 @2x versions for the purposes of creating a full .icns file, either.
 
 All in all, it's rather opaque as to how it works, but I'm moving ahead 
 rather slowly on it.
 
 John
 -- 
 John Brownie, john_brow...@sil.org or j.brow...@sil.org.pg
 Summer Institute of Linguistics  | Mussau-Emira language, Mussau Is.
 Ukarumpa, Eastern Highlands Province | New Ireland Province
 Papua New Guinea | Papua New Guinea

___

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

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

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

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

Re: How to write a .icns file

2014-05-30 Thread Gary L. Wade
Maybe you could get by just saving those icons that are more modern? You may 
truly need to keep them, but there's practically no need for 'ICN#' and their 
like anymore in modern OS X. The most modern ones (especially the retina-based 
ones) are just wrappers around PNG, JPEG, image file data, anyway.

I haven't read of any limitations like you describe, so maybe it's a bug, 
possibly a half-Carbon accidental-deprecation (I found this happened for 
compositing icons).

Since the 'icns' format is well documented, why not make as many subsets as 
required using ImageIO and then programmatically combine all your 'icns' into a 
single 'icns'? It's a kludge, but it would work.

If you want to investigate more, maybe see if the 15-image limitation only 
happens when one of the modern icon formats is present like a retina-based one. 
Then, that might add fuel to your bug report and/or provide extra info for your 
'icns' merge operation.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

 On May 29, 2014, at 3:38 PM, John Brownie john_brow...@sil.org wrote:
 
 Simplified from the previous question, which didn't get any responses:
 
 How can I write a .icns file when there are 15 images, which is too many for 
 ImageIO to handle? I can get it as an NSImage, but can't see how to write it 
 to a file (or to an NSData object).
 
 John
 -- 
 John Brownie, john_brow...@sil.org or j.brow...@sil.org.pg
 Summer Institute of Linguistics  | Mussau-Emira language, Mussau Is.
 Ukarumpa, Eastern Highlands Province | New Ireland Province
 Papua New Guinea | Papua New Guinea

___

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: string literals and performance

2014-05-25 Thread Gary L. Wade
The performance benefit for choosing the first style over the second style 
comes in if you need to debug your app or change the contents of a string 
literal.

If you hard code the same string everywhere you use it, as with the second 
case, you are either going to copy/paste or type it all over again. If you type 
it, this can lead to misspellings which can be frustrating to debug especially 
if the string is a key or a format.

If you use a named constant like the first case, the compiler will tell you 
when you make a misspelling with the variable.

Similarly, if you decide to change the contents of string, a named constant 
improves your performance by you only changing it one place rather than having 
to change it in multiple places. Even a global search and replace requires some 
proofing to be sure you don't change too many instances.

For example, if any of these strings are localizable, using separate named 
constants per meaning will keep you safe when dealing with false friends. As an 
example of one app I worked on, we had two strings that were identical in 
English but different in Spanish: State as in California and State as in On/Off 
but Estados for the former and Condicion for the latter.

While it is true you will see little, if any, performance difference in the 
execution of your code, you will find your coding and debugging performance 
improved by doing these safer and best practices of software development.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On May 24, 2014, at 9:08 PM, 2551 2551p...@gmail.com wrote:
 
 Are there any performance implications that would suggest preferring one or 
 the other of these different styles?
 
 NSString *s = @sing me a song;
 [myClass aMethod: s];
 
 and
 
 [myClass aMethod: @sing me a song];

___

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: Document architecture: locking document files while open

2014-05-22 Thread Gary L. Wade
I've only just run across this as a potential solution to a prospective need, 
but might Kernel Authorizations be what you need?

https://developer.apple.com/library/mac/technotes/tn2127/_index.html
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On May 22, 2014, at 9:21 AM, Jens Alfke j...@mooseyard.com wrote:
 
 
 On May 22, 2014, at 8:51 AM, Matthew LeRoy mle...@minitab.com wrote:
 
 Does anyone have any idea if there is a way to get the document architecture 
 to lock a document file when it is opened?
 
 If you implement the lower-level read/write methods in NSDocument, you have 
 full control over opening and closing the file. You can then make whatever 
 filesystem calls you want to lock/unlock it.
 
 When I say “lock”, I’m talking about an exclusive file lock at the 
 filesystem level, as in no other user or process can open, move, or delete 
 the file.
 
 There’s no such thing in standard Unix. The closest thing is “advisory” locks 
 (i.e. flock(2)), which are opt-in and can be ignored, and only prevent 
 modifying the file, not opening/moving/deleting it.
 
 HFS+ does have extended attributes that, I _think_ include some sort of 
 “immutable” option, but from what you say below I don’t think that’s relevant 
 here.
 
 This causes all kinds of kooky and undesired behavior if a document on a 
 remote filesystem is first opened in the Mac version (which does not lock 
 the file), then opened concurrently by the Windows version (which locks the 
 file).
 
 OK, here it gets even messier, because you’re talking about locking files on 
 a file server. This involves the semantics of the file sharing protocol (you 
 didn’t specify what it is), of OS X’s client implementation of that protocol, 
 and of the underlying filesystem of the disk volume being shared. There are 
 significant differences between the behavior of NFS, AFP and SMB, and between 
 different versions of those, and different versions of OS X connecting to 
 them … it’s quite a rat-hole. I’ve seen people give vehement advice to 
 _never_ use SQLite databases on shared volumes, for example, because problems 
 with file locking can easily cause database corruption.
 
 At a minimum you’re going to need to describe exactly what software is 
 involved on both sides, and what file server protocol is in use.
 
 —Jens

___

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

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

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

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

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gary L. Wade
German Anna, Chinese Mei-Jia, and Korean Yuna all speak my English text
(Shakespeare, actually, in my test case) with accents from each language.
I also verified Mei-Jia speaks Chinese from a Chinese play in my app, too.
 Do you get any calls in your delegate methods (you have set the delegate
on your speech synthesizer instance, right)?  One difference I’ve done is
to initWithVoice: with nil and later call setVoice:.  Also, I haven’t
tried this sequence myself, but I noticed in your sample code you’re
calling phonemesFromText: right after startSpeakingString:.  Maybe
phonemesFromText: is short-circuiting the speaking?  It’s been a while
since I’ve worked on my app, but I remember some calls will stop any
current speaking.
--
Gary L. Wade
http://www.garywade.com/

On 5/14/2014, 11:15 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote:



On 15 May 2014, at 08:41, Jens Alfke j...@mooseyard.com wrote:

 On May 14, 2014, at 6:24 PM, Gerriet M. Denkmann gerr...@mdenkmann.de
wrote:
 
 But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which
has 24 voices (which is nice) but all 24 have VoiceLanguage =
VoiceLocaleIdentifier = en_US (which seems rather odd).
 
 The non-English voices are optional downloads — you can get them via
the Dictation/Speech system pref pane. Pull down the System Voice pop-up
and choose Customize…

Thanks. Just did that.

Did set System Voice to Anna (a German voice).
Now, when I select some (German) text and do Control-Click → Speech →
Start Speaking it just works. Very good.

But this:

NSString *voiceIdentifier =
@com.apple.speech.synthesis.voice.anna.premium;
NSString *text = @Der Osten ist rot.;
NSSpeechSynthesizer  *syn = [ [ NSSpeechSynthesizer alloc ]
initWithVoice: voiceIdentifier ];  //  non-nil
BOOL ok = [ syn startSpeakingString: text ];   //  returns YES, but does
NOT speak
NSString *pp = [ syn phonemesFromText: text ]; //  returns empty string

does not work as expected.
Same problem with all other voices I just downloaded. Only the default
(en-US) voices work as they should.

What am I missing?

Gerriet.



___

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

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

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

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

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gary L. Wade
If you need the phonemes, look at the willSpeakPhoneme delegate method. You can 
use it in conjunction with the other delegates in a manner like NSString 
enumerates sentences and words―not a perfect comparison, but it should help you 
conceptually.

If I recall, the feedback window solves a very narrow need, one that didn't 
help me much, so I didn't explore it, especially since the delegate methods 
gave me what I needed.

I wouldn't doubt that NSSpeechSynthesizer gets deprecated in favor of the AV 
variety based on the way Apple has historically ported underlying technologies 
between platforms, but if not or you need to support older OSes, be careful 
about some of its property retrieval methods, especially the phoneme dictionary 
per voice, since in at least one OS and earlier it returned a retained object 
vs an autoreleased object against the Objective-C memory naming contract.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On May 15, 2014, at 5:53 AM, Gerriet M. Denkmann gerr...@mdenkmann.de 
 wrote:
 
 
 On 15 May 2014, at 15:53, Gary L. Wade garyw...@desisoftsystems.com wrote:
 
 Also, I haven’t tried this sequence myself, but I noticed in your sample 
 code you’re
 calling phonemesFromText: right after startSpeakingString:.  Maybe
 phonemesFromText: is short-circuiting the speaking?
 
 Right on! 
 Putting phonemesFromText: BEFORE startSpeakingString: finally gets me to hear 
 all my new voices.
 
 But: phonemesFromText: still returns an empty string.
 This is a pity, because getting the phonemes is the goal of the whole 
 exercise.
 
 With or without delegate.
 
 Another thing: setUsesFeedbackWindow: YES has no visible effect whatsoever 
 with any voice.
 
 
 It’s been a while
 since I’ve worked on my app, but I remember some calls will stop any
 current speaking.
 --
 Gary L. Wade
 http://www.garywade.com/
 
 On 5/14/2014, 11:15 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote:
 
 
 
 On 15 May 2014, at 08:41, Jens Alfke j...@mooseyard.com wrote:
 
 On May 14, 2014, at 6:24 PM, Gerriet M. Denkmann gerr...@mdenkmann.de
 wrote:
 
 But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which
 has 24 voices (which is nice) but all 24 have VoiceLanguage =
 VoiceLocaleIdentifier = en_US (which seems rather odd).
 
 The non-English voices are optional downloads ― you can get them via
 the Dictation/Speech system pref pane. Pull down the System Voice pop-up
 and choose Customize…
 
 Thanks. Just did that.
 
 Did set System Voice to Anna (a German voice).
 Now, when I select some (German) text and do Control-Click → Speech →
 Start Speaking it just works. Very good.
 
 But this:
 
 NSString *voiceIdentifier =
 @com.apple.speech.synthesis.voice.anna.premium;
 NSString *text = @Der Osten ist rot.;
 NSSpeechSynthesizer  *syn = [ [ NSSpeechSynthesizer alloc ]
 initWithVoice: voiceIdentifier ];//non-nil
 BOOL ok = [ syn startSpeakingString: text ];//returns YES, but does
 NOT speak
 NSString *pp = [ syn phonemesFromText: text ];//returns empty string
 
 does not work as expected.
 Same problem with all other voices I just downloaded. Only the default
 (en-US) voices work as they should.
 
 What am I missing?
 
 Gerriet.
 

___

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

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

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

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

Re: How to speak Chinese on 10.9.2

2014-05-15 Thread Gary L. Wade
Well, that's not fun. It's been a while since I tried it out, though. Well, 
write up some bugs, and if you have a sample app showing what you need, it'll 
at least get addressed. Speech is a priority although the forms of that 
priority might be different than we expect. And, if you are one of us going to 
WWDC in a couple of weeks, be ready to talk with whatever group you'll need to; 
that's how I found out the cause of the memory leak bug by one of the team 
members bringing up the source code right there.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On May 15, 2014, at 8:38 AM, Gerriet M. Denkmann gerr...@mdenkmann.de 
 wrote:
 
 
 On 15 May 2014, at 22:12, Gary L. Wade garyw...@desisoftsystems.com wrote:
 
 If you need the phonemes, look at the willSpeakPhoneme delegate method. You 
 can use it in conjunction with the other delegates in a manner like NSString 
 enumerates sentences and words―not a perfect comparison, but it should help 
 you conceptually.
 
 Unfortunately the documentation says about 
 speechSynthesizer:willSpeakPhoneme: 
 This method is not sent for modern voices. And this seems indeed to be the 
 case.
 
 Another problem with: speechSynthesizer:willSpeakWord:ofString: - while it 
 works fine for German or Chinese, it gives complete garbage for Thai.
 
 
 If I recall, the feedback window solves a very narrow need, one that didn't 
 help me much, so I didn't explore it, especially since the delegate methods 
 gave me what I needed.
 
 I wouldn't doubt that NSSpeechSynthesizer gets deprecated in favor of the AV 
 variety based on the way Apple has historically ported underlying 
 technologies between platforms, but if not or you need to support older 
 OSes, be careful about some of its property retrieval methods, especially 
 the phoneme dictionary per voice, since in at least one OS and earlier it 
 returned a retained object vs an autoreleased object against the Objective-C 
 memory naming contract.
 --
 Gary L. Wade (Sent from my iPhone)
 http://www.garywade.com/
 
 On May 15, 2014, at 5:53 AM, Gerriet M. Denkmann gerr...@mdenkmann.de 
 wrote:
 
 
 On 15 May 2014, at 15:53, Gary L. Wade garyw...@desisoftsystems.com 
 wrote:
 
 Also, I haven’t tried this sequence myself, but I noticed in your sample 
 code you’re
 calling phonemesFromText: right after startSpeakingString:.  Maybe
 phonemesFromText: is short-circuiting the speaking?
 
 Right on! 
 Putting phonemesFromText: BEFORE startSpeakingString: finally gets me to 
 hear all my new voices.
 
 But: phonemesFromText: still returns an empty string.
 This is a pity, because getting the phonemes is the goal of the whole 
 exercise.
 
 With or without delegate.
 
 Another thing: setUsesFeedbackWindow: YES has no visible effect whatsoever 
 with any voice.
 
 
 It’s been a while
 since I’ve worked on my app, but I remember some calls will stop any
 current speaking.
 --
 Gary L. Wade
 http://www.garywade.com/
 
 On 5/14/2014, 11:15 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote:
 
 
 
 On 15 May 2014, at 08:41, Jens Alfke j...@mooseyard.com wrote:
 
 On May 14, 2014, at 6:24 PM, Gerriet M. Denkmann gerr...@mdenkmann.de
 wrote:
 
 But the only thing in 10.9.2 I found was NSSpeechSynthesizer, which
 has 24 voices (which is nice) but all 24 have VoiceLanguage =
 VoiceLocaleIdentifier = en_US (which seems rather odd).
 
 The non-English voices are optional downloads ― you can get them via
 the Dictation/Speech system pref pane. Pull down the System Voice pop-up
 and choose Customize…
 
 Thanks. Just did that.
 
 Did set System Voice to Anna (a German voice).
 Now, when I select some (German) text and do Control-Click → Speech →
 Start Speaking it just works. Very good.
 
 But this:
 
 NSString *voiceIdentifier =
 @com.apple.speech.synthesis.voice.anna.premium;
 NSString *text = @Der Osten ist rot.;
 NSSpeechSynthesizer  *syn = [ [ NSSpeechSynthesizer alloc ]
 initWithVoice: voiceIdentifier ];//non-nil
 BOOL ok = [ syn startSpeakingString: text ];//returns YES, but 
 does
 NOT speak
 NSString *pp = [ syn phonemesFromText: text ];//returns empty 
 string
 
 does not work as expected.
 Same problem with all other voices I just downloaded. Only the default
 (en-US) voices work as they should.
 
 What am I missing?
 
 Gerriet.
 

___

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

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

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

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

Re: NSNumberFormatter 10.0+ style exception with zero

2014-05-07 Thread Gary L. Wade
There are occasional bugs when converting from earlier formats. What I do 
besides reporting the bug is to look at the underlying XML in the earlier 
version of the XIB and the later version and try to manually make the necessary 
changes using a text editor. I've sometimes had to quit Xcode, edit the XIB, 
lock the XIB so Xcode won't change it, and then relaunch Xcode. You may not 
have to go that far, but I wouldn't doubt that support for pre-10.4 number 
formatters to be lost in test for later-XIB formats.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On May 7, 2014, at 2:37 PM, Howard Moon how...@antarestech.com wrote:
 
 Ok, this seems to be an IB issue.  I've made my own NSNumberFormatter, set 
 its properties, and set it as the formatter for my text fields, all in code, 
 and that works perfectly.  No idea why the same object created in Xcode 
 fails, but I'll do whatever it takes to make it work, I guess!
 
 Regards,
Howard
 
 
 On May 7, 2014, at 1:47 PM, Howard Moon how...@antarestech.com wrote:
 
 Hm, it may be that something else is at play here.  I did make ONE change 
 when porting… I put my text fields inside a tab view.  I wonder if maybe 
 there's a problem accessing the number formatter from a control inside a tab 
 view?  All the connections *appear* to be there, and the call stack does 
 show that it's accessing an NSNumberFormatter (and there's only on in my 
 project).  Need to run a test...
 
 Ok… I just tested the same code using the OLD xib, WITHOUT the tab view, and 
 it works with no problems!
 
 So… does anyone know if simply adding a (two-tab) tab view and dragging 
 existing objects on its pages causes any problems like this? Is there a 
 connection I've overlooked that I need to make once the objects are inside 
 that tab view?
 
 Thanks,
-Howard
 
 On May 7, 2014, at 9:34 AM, Howard Moon how...@antarestech.com wrote:
 
 Hi,
 
is the 10.0+ style of NSNumberFormatter no longer supported?  I recently 
 moved from developing in Xcode3 under OS X 10.7 to Xcode 4 under OS X 10.8, 
 and from having a Base SDK of 10.6 to 10.7, and from a Deployment Target of 
 10.5 to 10.6, and am now having problems with my xib-base NSTextFields 
 connected to an NSNumberFormatter.  The formatter uses the 10.0+ style, 
 allowing me to set the Zero field, which I am setting to the string N/A.  
 This worked fine, even when running in 10.8 or 10.9, but crashes now that 
 I've compiled under these new conditions.
 
 Here is the call stack when the exception is thrown:
 
 2014-05-07 08:32:15.225 Cubase 7.5[947:707] -[__NSCFString string]: 
 unrecognized selector sent to instance 0x1050188d0
 2014-05-07 08:32:15.226 Cubase 7.5[947:707] NSInvalidArgumentException - 
 -[__NSCFString string]: unrecognized selector sent to instance 0x1050188d0
 0   CoreFoundation  0x7fff92b32aee 
 __exceptionPreprocess + 174
 1   libobjc.A.dylib 0x7fff8b8b13f0 
 objc_exception_throw + 43
 2   CoreFoundation  0x7fff92bc940a 
 -[NSObject(NSObject) doesNotRecognizeSelector:] + 186
 3   CoreFoundation  0x7fff92b2102e ___forwarding___ 
 + 414
 4   CoreFoundation  0x7fff92b20e18 
 _CF_forwarding_prep_0 + 232
 5   Foundation  0x7fff93bc592b 
 -[NSNumberFormatter(NSNumberFormatterCompatibility2) 
 __oldnf_stringForObjectValue:] + 192
 6   AppKit  0x7fff8bd2ba93 -[NSCell 
 _stringForEditing] + 83
 7   AppKit  0x7fff8bd35a32 -[NSCell 
 _skipsSynchronizationForEditingTextView:] + 34
 8   AppKit  0x7fff8bc5e43f -[NSCell 
 setObjectValue:] + 296
 9   AppKit  0x7fff8bc5e2fd 
 -[NSTextFieldCell setObjectValue:] + 43
 10  AppKit  0x7fff8be51cbd -[NSCell 
 _setIntegerValue:] + 196
 11  AppKit  0x7fff8be47f49 -[NSControl 
 setIntValue:] + 138
 ...
 
 I am simply calling setIntValue with a value of 0, which in previous builds 
 would set the text field's text to N/A.  But now this exception is 
 thrown, and I don't know why or what to do about it.  If the 10.0 style of 
 NSNumberFormatter is no longer supported, why is it still available in 
 Xcode 4, and why does it compile and run, up to the point I set its value 
 to 0?
 
 Thanks,
-Howard
 
 ___
 
 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/howard%40antarestech.com
 
 This email sent to how...@antarestech.com
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin

Re: Help with Help

2014-04-29 Thread Gary L. Wade
It's best to use Apple's help. However, you may want to consider the case where 
your app supports a localization that Apple's Help app doesn't and give the 
user the option of opening your help pages in the user's web browser. In one 
app some time back, the help would show English while the user was running 
Turkish. That particular case may be workable now, but a similar one may occur. 
See how Apple does this in Xcode for their documentation viewer.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Apr 29, 2014, at 10:52 AM, Gordon Apple g...@ed4u.com wrote:
 
 We would like to get a recommendation on the best way to generate a help
 system for a fairly complex application. We started by using a simple web
 view and created about 120 screens in BBEdit, mostly drill-down outlines.
 Unfortunately, this has been proven to be difficult to maintain. We¹ve
 looked into web generators like RapidWeaver, Freeway, and even Dreamweaver,
 but all of these have been described as ³roach motels² where you enter but
 can never leave.
 
 We would like to have both local and web-based or web-updated content and
 have contextual help. This all brings us to Apple¹s ³Help Book², which seems
 to have been around forever and presents its own learning curve. So the
 question is: Is this the way to go?  It it still current? What are the
 experiences in using it?

___

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: ARC Retain Cycles

2014-04-26 Thread Gary L. Wade
On 4/26/2014, 10:48 AM, Jens Alfke j...@mooseyard.com wrote:

Autorelease is a great example of There Ain't No Such Thing As A Free
Lunch. (TANSTAAFL)


I can see a new T-shirt with the saying (unless someone else already
thought of it like the Exercise becomes Eggs Are Sides for Bacon):

[T]here [A]in't [N]o [S]uch [T]hing [A]s [A] [F]ree [L]unch

TANSTAAFL

TANS TAA FL
Tends To Fail
--
Gary L. Wade
http://www.garywade.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: ARC Retain Cycles

2014-04-26 Thread Gary L. Wade
I think (from my experience of some junior developers in my realm) some of
these expectations comes from the progression of how autocomplete writes
your code for you in Xcode, so if it leaves something off, it’s Xcode’s
fault.

I personally don’t agree, and I delay the timing for autocomplete.  Xcode
guesses me wrong at least 1/3 of the time.
--
Gary L. Wade
http://www.garywade.com/

On 4/26/2014, 11:06 AM, Alex Kac a...@webis.net wrote:


You’re a programmer - you’re supposed to know what happens under the
hood. That’s part and parcel of developing good, optimized software.



___

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: Fast NSArray compare

2014-04-15 Thread Gary L. Wade
Also, if your folder hierarchy, traversal code, and checks can deal well
with it, you¹ll get better performance by short-circuiting based on upper
directory checks.

For example, if you know you¹re in /Downloads, don¹t compare against
/Documents/AboutUs.pdf. Just use the /Documents set of file objects when
you¹re in /Documents.
--
Gary L. Wade
http://www.garywade.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: accessing values along NSIndexPath

2014-03-26 Thread Gary L. Wade
If all you have is a nested set of arrays, then you¹ll have to write your
own objectAtIndexPath: method that walks your nested set of arrays.
--
Gary L. Wade
http://www.garywade.com/

On 3/26/2014, 1:14 PM, Torsten Curdt tcu...@vafer.org wrote:


Going through a NSTreeController feels like cracking a nut with a
sledge-hammer.
Then I would rather roll my own.

There is really no other way?

On Wed, Mar 26, 2014 at 8:56 PM, Lee Ann Rucker lruc...@vmware.com
wrote:
 First you need a NSTreeController to manage your NSArray, then:

NSTreeNode *topNode = [treeController arrangedObjects];
return [topNode descendantNodeAtIndexPath:indexPath];


 On Mar 26, 2014, at 12:02 PM, Torsten Curdt wrote:

 The Apple docs state:

 The NSIndexPath class represents the path to a specific node in a
 tree of nested array collections

 I can't find how to use the index path to access the tree though.
 It should be something along the lines of:

  NSIndexPath *indexPath = ...
  NSArray *nestedArrays = ...
  id obj = [nestedArrays objectByIndexPath:indexPath];

 but I just cannot seem to find the right selector for this.

 I could easily implement this myself - but there must be something
 like this already!? No?

 cheers,
 Torsten



___

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: CFXMLCreateStringByUnescapingEntities() bombs on #13207494

2014-03-25 Thread Gary L. Wade
Since this could be a security exploit with malformed data being allowed
in a bad way, you might set your bug to be a security issue and that¹ll
raise eyebrows fast.  You do remember how you could crash an app by using
a malformed file URL some time back?
--
Gary L. Wade
http://www.garywade.com/


On 3/25/2014, 3:08 PM, Jerry Krinock je...@ieee.org wrote:

I¹ve now submitted this as Bug ID #16424156, which includes a demo
project that has the original open source function, and a patched version
which seems to work.  Some serious testing is needed, but no more time
for this issue today.  The code in the demo project is also pasted in
below, for anyone would like to review the patch.  Criticisms and/or
suggested test cases would be appreciated!



___

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: Class name as NSString and problem with NSLog?

2014-03-19 Thread Gary L. Wade
You¹ll get more mileage out of that in Radar (they don¹t officially² do
Apple-isms), and you might want to add to your bug that the
format-recognizer NS_FORMAT_FUNCTION (see NSString.h) should be extended
for predicate formats or a new one, NS_PREDICATE_FORMAT_FUNCTION, should
be added for such extensions, and that it should be applied to the
appropriate methods in NSPredicate.h.
--
Gary L. Wade
http://www.garywade.com/


On 3/19/2014, 2:13 PM, Sean McBride s...@rogue-research.com wrote:

On Thu, 6 Mar 2014 15:47:08 -0800, Greg Parker said:

 I remember the ³Month Of Apple Bugs²** that a hacker group ran in
2007,
 where they published a new app or OS security vulnerability every day
 for month. A lot of them were caused by format-string vulnerabilities.
 Soon thereafter the compiler team at Apple added that format-string
 security warning :)
 
 Though it still doesn't work for NSPredicate APIs:, all these years
later, ex:
 
 ---
 #import Foundation/Foundation.h
 
 int main (void)
 {
  NSPredicate* predicate = [NSPredicate predicateWithFormat:@foo ==
%d];
 
  return !!predicate;
 }
 ---
 
 clang -Weverything -fsyntax-only ~/test.m gives nothing!
 
 rdar://10699748  Dupes welcome. :)

The problem is that +predicateWithFormat: accepts conversions that are
not part of NSString's format string syntax. Adding format string
warnings for new format string syntaxes requires compiler changes.

Incase anyone wants to cc themselves, I created this bug:

http://llvm.org/bugs/show_bug.cgi?id=19200

Cheers,

-- 

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

___

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

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

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsyste
ms.com

This email sent to garyw...@desisoftsystems.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: NSDecimalNumber queries

2014-03-09 Thread Gary L. Wade
The class NSDecimalNumber can already handle arithmetic operations. Look up its 
documentation directly.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Mar 9, 2014, at 4:34 AM, jonat...@mugginsoft.com 
 jonat...@mugginsoft.com wrote:
 
 I require to use NSDecimalNumber extensively.
 
 When creating NSDecimalNumbers it is advised not to use the NSNumber subclass 
 initWithXXX methods:
 http://www.cocoabuilder.com/archive/cocoa/227178-question-on-estimating-arraywithcapacity.html#227253
 I presume that this still applies.
 
 To me it would seem that there is ample scope for a decent NSDecimalNumber 
 category providing factory and convenience methods.
 Adding lists of objects for example:
 
 - (void)addDecimalNumbers:(NSDecimalNumber *)number, … 
 NS_REQUIRES_NIL_TERMINATION;
 
 Is anybody aware of a useful pre-existing NSDecimalNumber category?
 
 My searches have turned up:
 https://github.com/jmoody/LJS/blob/master/Categories/Foundation/NSDecimalNumber%2BLjsAdditions.m
 
 Jonathan

___

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

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

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

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

Re: NSNumber : method to return pointer to represented value

2014-02-22 Thread Gary L. Wade
NSDecimal is a structure with associated C-level functions that could
theoretically work with the not-yet-supported floating point decimal types
in LLVM that were in later versions of GCC whereas NSDecimalNumber is an
Objective C class subclassed from NSNumber that provides NSDecimal
encapsulation.
--
Gary L. Wade
http://www.garywade.com/

On 2/22/2014 7:33 AM, jonat...@mugginsoft.com jonat...@mugginsoft.com
wrote:


Hence NSDecimal -getValue: populates a pointer to a double.


___

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

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

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

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

Re: Disabling screen capture

2014-02-21 Thread Gary L. Wade
You did go to this page, right?

https://developer.apple.com/membercenter/index.action#requestTechSupport

I remembered one form on the site, not this one, that I had to submit by 
deleting all the data and doing it again. Some freaky web page issue; I think 
it was a phone number field that kept trying to be reformatted but in a way the 
back end didn't like it, so I turned off JavaScript while filling it in and 
then submitted it. If things still don't work, try emailing d...@apple.com and 
explain this issue and your real issue.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Feb 21, 2014, at 8:13 PM, Bradley O'Hearne br...@bighillsoftware.com 
 wrote:
 
 On Feb 21, 2014, at 3:02 PM, Jens Alfke j...@mooseyard.com wrote:
 
 The best answer I’ve seen is that you’ll need to file a DTS support incident 
 and go through those official channels.
 
 I’ve spent the last hour trying to post an issue to DTS via the Apple Mac 
 Developer Program Member Center….no dice. Despite the fact I have all fields 
 filled out, I keep getting the error message: 
 
 “We are unable to process your request. Please enter all required data.”
 
 If anyone has any insight how to get past this, let me know.
 
 Thanks, 
 
 Brad
 

___

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: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Gary L. Wade
Yeah, that demo issue came up yesterday, so I filed my own rdar://16013973
and as you know, it always helps to add duplicates!  I marked mine as an
issue with Security and Always.  I suggested only showing the hints on the
actual device and doing a secondary broadcast without the hint on
secondary devices, especially simulators and AirPlay similar to how the
old DVD anti-copy-protection thing worked.
--
Gary L. Wade
http://www.garywade.com/


On 2/8/2014 9:56 AM, Kyle Sluder k...@ksluder.com wrote:

On Feb 8, 2014, at 5:37 AM, David Delmonte ddelmo...@mac.com wrote:
 
 I realized I could do this: 1. use just an NSTextField, and 2. if
(hiding) textField.stringValue = @**;
 Is there something I'm missing?

Please don't do this. NSSecureTextFieldCell uses a custom field editor
that protects the password from being snarled via Accessibility or event
taps.

Also, computer screens are much more likely to be visible to other people
than phone screens, and people in general are more confident typists on
physical keyboards than on virtual ones. Showing characters as they type
is doing a disservice. (In fact, now that AirPlay Mirroring is so
prevalent, I've been meaning to file a Radar asking Apple to remove the
³show last character typed² feature from UIKit.)

--Kyle Sluder



___

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

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

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

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

Re: Can I Hide / Show an NSTextField / NSSecureTextField in Cocoa?

2014-02-08 Thread Gary L. Wade
Very true, and that's why I asked Apple in a Radar to fix it since, if it
CAN be done, they're more in a position to do it (masters of the hardware
and software) than relying upon each developer to make secondary screens.

Maybe the hint text could be a layer not available for secondary device
consumption on top of the actual bullet being displayed?  Maybe a bit
slow/cumbersome and possibly only activated when a secondary screen is
used, but that's how I might start out trying to do it myself.  I haven't
tried it myself, but I wonder if screenshots are only possible with the
bullet and no hint text; maybe a tie-in?

It's all academic for us; this needs to be addressed by Apple, so file
your Radar you've been threatening to do, and maybe it'll make the next
upgrade.
--
Gary L. Wade
http://www.garywade.com/


On 2/8/2014 10:10 AM, Kyle Sluder k...@ksluder.com wrote:

On Feb 8, 2014, at 10:06 AM, Gary L. Wade
garyw...@desisoftsystems.com wrote:
 
 Yeah, that demo issue came up yesterday, so I filed my own
rdar://16013973
 and as you know, it always helps to add duplicates!  I marked mine as an
 issue with Security and Always.  I suggested only showing the hints on
the
 actual device and doing a secondary broadcast without the hint on
 secondary devices, especially simulators and AirPlay similar to how the
 old DVD anti-copy-protection thing worked.

AirPlay mirroring is done in hardware, IIRC. App authors have the ability
to create a second screen and put the AirPlay content there, but for apps
that don¹t do that the OS just feeds data from the GPU framebuffer to the
MPEG encoder. It needs to be turned off on all screens if AirPlay is
active.

--Kyle Sluder



___

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

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

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

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

Re: libcrypto linking problem in Leopard

2014-01-06 Thread Gary L. Wade
There's lots of hurt trying to support that old. One thing that changed from 
10.5 to 10.6 is some linking options so the dylibs are different. I tried to do 
the same thing you're trying for the sake of cross-platform compatibility, 
and I found it more resolvable to just factor out those calls that were in 
those libraries and call the OS X-explicit frameworks. If you want greater 
context, there are lots of other discussions on SO and elsewhere.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Jan 6, 2014, at 5:41 AM, Appa Rao Mulpuri appar...@ivycomptech.com wrote:
 
 Hi Dave,
 
 Able to change the path in the Mach O with the Install_name_tool, but
 while launching the app, it is checking the compatibility version and
 failing to launch.  Here is the Otool output:
 
 /usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.8, current
 version 47.2.0)
 
 Regards,
 
 Apparao Mulpuri
 Senior Systems Analyst, Mac Poker
 
 
 
 On 1/4/14 1:52 AM, St John, David R david.stj...@xerox.com wrote:
 
 
 On Jan 3, 2014, at 2:37 AM, Jean-Daniel Dupas devli...@shadowlab.org
 wrote:
 
 The simplest advice is don't use libcrypto.
 
 If you just need simple functionality, you may have a look at the
 CommonCrypto API which is partially available on 10.5 ( I think Digest
 and Cryptors where available at this time).
 
 If you need something more complex, you should use the Security
 framework, unfortunately the whole 10.5 API (CDSA) has been deprecated
 in favor of a cleaner but incompatible API.
 
 So you will have to write the code twice if you want to support 10.5
 and be futur proof.
 
 Unfortunately, if you're using asymmetric encryption, you have to use the
 deprecated CDSA APIs, since (AFAIK) the newer APIs don't support it.
 
 Charles
 
 I had the same problem with libnetsnmp and solved it with a Run Script
 build phase.  The linker puts the versioned dylib in the executable even
 though you include the non-versioned dylib, this switches the versioned
 back to non-versioned.
 
 install_name_tool -change ³versioned dylib² ³non-versioned dylib
 $TARGET_BUILD_DIR/$EXECUTABLE_PATH²
 
 In my case: install_name_tool -change /usr/lib/libnetsnmp.15.dylib
 /usr/lib/libnetsnmp.dylib $TARGET_BUILD_DIR/$EXECUTABLE_PATH
 
 Hope this helps,
 
 Dave
 
 
 
 ___
 
 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
 
 Please do not post admin requests or moderator comments to the list.
 Contact the moderators at cocoa-dev-admins(at)lists.apple.com
 
 Help/Unsubscribe/Update your Subscription:
 https://lists.apple.com/mailman/options/cocoa-dev/apparaom%40ivycomptech.c
 om
 
 This email sent to appar...@ivycomptech.com
 
 This email and any attachments are confidential, and may be legally 
 privileged and protected by copyright. If you are not the intended recipient 
 dissemination or copying of this email is prohibited. If you have received 
 this in error, please notify the sender by replying by email and then delete 
 the email completely from your system. Any views or opinions are solely those 
 of the sender. This communication is not intended to form a binding contract 
 unless expressly indicated to the contrary and properly authorised. Any 
 actions taken on the basis of this email are at the recipient's own risk.
 
 ___
 
 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/garywade%40desisoftsystems.com
 
 This email sent to garyw...@desisoftsystems.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: Fast hash of NSData?

2013-11-30 Thread Gary L. Wade
Getting the attributes of a file is a very fast operation provided you use
the right calls; all of that information is in its catalog and should
require at most one block read and at least a lookup in an OS-related
cache.  If you are accessing the file system across a network (I doubt it
from your earlier info in which you said the user is dropping an image on
your app or document), this could be a bit slower, but using the right API
or info on a protocol stream should give you what you're needing.  You
might be looking at things from too high a level; consider a much
lower-level solution if appropriate.

FYI, I've worked on a few backup and sync apps/processes and am pretty
comfortable with file system bottlenecks both local and remote.
--
Gary L. Wade
http://www.garywade.com/


On 11/30/2013 2:47 AM, Graham Cox graham@bigpond.com wrote:

It¹s also likely to be slow in itself - grabbing this sort of data from
the file system requires hitting the disk, possibly multiple times.



___

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: Fast hash of NSData?

2013-11-29 Thread Gary L. Wade
If it is possible to compare the attributes of your file besides length, such 
as modified date, created date, inode, etc., then you might be able to further 
catch the cases where the length is the same but the data changed is large 
enough that you would rather delay any full-file access whether by full-byte 
compare or computing a hash.

If you can rely on file attributes, then only if the significant ones change 
would I use the new file. Assuming we're talking about graphics files, I doubt 
Photoshop (as an example app) will allow a user to invert all colors, a task 
that could theoretically keep the same length, and then save that file, and 
then subverting the OS keep the same modification and creation date as before. 
If a user does that (since Photoshop would not, it would have to be 
deliberate), then they're purposely trying to fool your app—or they're OCD 
and/or trying to prevent a quantum entanglement with a parallel universe (or 
it's an installer that would fix time stamps for some esoteric reason).

If you don't have access to any important file attributes, and your data is 
awfully big, you could try a preliminary compare of a random smaller set of 
blocks. On the other hand, since you already have local access to both files, 
you might compare the time it takes to do full-byte compares of memory mapped 
forms of the data against calculating the hash. Depending on vector functions, 
registers, and word-compare-size (128 bits at a time?) you might be able to 
more quickly ascertain equality. Hashes for large file equality are a whole lot 
more necessary when the latency of file access is orders of magnitude larger 
than local file access (consider across-network full-copying of files, 
something backup and sync products want to be fast at).
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Nov 29, 2013, at 1:49 PM, Kyle Sluder k...@ksluder.com wrote:
 
 You also have another, damn-quick hash key that takes zero disk access to 
 compute: -[NSData length].

___

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: Mavericks Printing and inverted NSScrollView NSClipView NSTableView presentation

2013-10-27 Thread Gary L. Wade
What I've done when needing such a mission-critical response from Apple is 
submit a tech support incident. This will get you a faster response and more 
than a note saying your bug is a duplicate. Reference your bug number. I'm not 
sure about the policy, but I think it's credited back to you if it's really 
Apple's bug.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

 On Oct 27, 2013, at 3:49 PM, John Bishop j...@mulligansoftware.com wrote:
 
 We've filed a bug report (15328543), but this is such a killer for our 
 customers we need to find out what's going on and offer them a workaround 
 (other than de-installing Mavericks) or a fix.

___

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   >