Re: ITMS-90276 Missing Bundle Identifier

2019-12-12 Thread Shane Stanley via Cocoa-dev
On 12 Dec 2019, at 12:52 am, Torsten Curdt via Cocoa-dev 
 wrote:
> 
> I am not sure - is there a better place to ask questions about codesigning
> and problems with submissions to the MAS?
> 
> I am trying to submit an app to the MAS that includes an automator workflow
> in the bundle resources (Contents/SharedSupport/Examples). When uploading
> to iTunes Connect I get an error message that the workflows is missing a
> bundle identifier.
> 
>  ERROR ITMS-90276: "Missing Bundle Identifier. The application bundle
> contains a tool or framework ... that is missing the bundle identifier in
> its Info.plist file."
> 
> Of course I could just add this to the Info.plist - but it feels wrong to
> modify it.

Just modify it. Automator often generates illegal ones anyway.

-- 
Shane Stanley 
, 


___

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

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

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

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


Re: Mojave vs. AppleScript

2018-10-30 Thread Shane Stanley
On 31 Oct 2018, at 10:25 am, Michal L. Wright  wrote:
> 
> I get the following runtime error: 
> 
> iData Pro[18598:682248] skipped scripting addition 
> "/Library/ScriptingAdditions/Adobe Unit Types.osax" because it is not 
> SIP-protected.

Unless you're actually calling something that uses Adobe Unit Types.osax, that 
message is probably a red herring. Try removing Adobe Unit Types.osax -- AFAIK 
it hasn't done anything for years anyway.

-- 
Shane Stanley 
, 


___

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

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

Help/Unsubscribe/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 clear macOS app bundle cache

2018-09-04 Thread Shane Stanley
On 4 Sep 2018, at 11:28 pm, Alastair Houghton  
wrote:
> 
> On 4 Sep 2018, at 00:19, Shane Stanley  wrote:
>> 
>> On 3 Sep 2018, at 11:31 pm, Andreas Falkenhahn  
>> wrote:
>>> 
>>> I'm looking for a solution to flush the app bundle cache
>> 
>> If you find one, I'd love to know what it is. I had no luck at all.
> 
> Is the application in question sandboxed?

No.

-- 
Shane Stanley 
, 


___

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

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

Help/Unsubscribe/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 clear macOS app bundle cache

2018-09-03 Thread Shane Stanley
On 3 Sep 2018, at 11:31 pm, Andreas Falkenhahn  wrote:
> 
> I'm looking for a solution to flush the app bundle cache

If you find one, I'd love to know what it is. I had no luck at all.

-- 
Shane Stanley 
, 


___

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

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

Help/Unsubscribe/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 menu items

2017-10-06 Thread Shane Stanley
On 7 Oct 2017, at 10:41 am, Kevin Perry <kpe...@apple.com> wrote:
> 
> This should be handled automatically by NSDocumentController’s implementation 
> of -validateUserInterfaceItem: / -validateMenuItem:. Any chance you’re 
> overriding either of those methods and returning YES for menu items you don’t 
> own (instead of calling super)?

Quite possibly. Thanks for the nudge.

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


___

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

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

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

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


Disabling menu items

2017-10-06 Thread Shane Stanley
I fear I'm missing something simple. When I enter the versions browser, I want 
to disable the items on the Open Recent submenu. But I'm not seeing anywhere 
obvious to do it; that menu looks like it's all handled opaquely. Any clues?


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


___

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

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

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

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


Re: Annual codesign pain point

2017-06-18 Thread Shane Stanley
On 19 Jun 2017, at 3:12 pm, Graham Cox <graham@bigpond.com> wrote:
> 
> Not sure why this wasn’t picked up in my previous builds though, since I was 
> compiling on 10.11.

The change was made in 10.12.

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


___

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

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

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

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


Re: Annual codesign pain point

2017-06-18 Thread Shane Stanley
On 19 Jun 2017, at 1:06 pm, Graham Cox <graham@bigpond.com> wrote:
> 
> resource fork, Finder information, or similar detritus not allowed

See: <https://developer.apple.com/library/content/qa/qa1940/_index.html>

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


___

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

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

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

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


Re: Creating "Application Scripts" subfolder in sandboxed environment

2017-06-09 Thread Shane Stanley
On 9 Jun 2017, at 10:13 pm, Dragan Milić <mi...@mac.com> wrote:
> 
> NSError *error;
> NSURL *scriptsFolder = [[NSFileManager defaultManager] 
> URLForDirectory:NSApplicationScriptsDirectory inDomain:NSUserDomainMask 
> appropriateForURL:nil create:YES error:]
> 
> This works fine if the scripts subfolder already exists. However, it if 
> doesn't, the application can't create it. If I pass "NO" as fourth parameter 
> I get back the url, but it's useless (it contains only the path), since the 
> folder is nonexistent. If I pass "YES" as fourth parameter, so that the 
> folder is created if necessary, I get the following error:
> 
> Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save 
> the file “com.mydomain.myapp” in the folder “Application Scripts”.” UserInfo 
> {NSFilePath=/Users/milke/Library/Application Scripts/com.mydomain.myapp, 
> NSUnderlyingError=0x608000259bf0 {Error Domain=NSPOSIXErrorDomain Code=1 
> "Operation not permitted"}}

You will get that error if your app isn't correctly code-signed.

> The application also tries to be friendly to users and offers them to 
> "install" predefined scripts (bundled in the application package) into that 
> folder.

Your app can't do that -- scripts can only be installed in that folder by the 
user.

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


___

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

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

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

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


Re: Need replacement of Component Manager::OpenDefaultComponent

2017-02-27 Thread Shane Stanley
On 28 Feb 2017, at 5:43 am, sumit bansal <sumitonline.ban...@gmail.com> wrote:
> 
> API: OpenDefaultComponent, whenever we call this API, we always get a new
> instance to that component.
> 
> *As per definition: *OpenDefaultComponent* Opens a connection to a
> registered component of the component type and subtype specified by your
> application. *
> 
> 
> But with the following API, we always get the same instance even on calling
> multiple times.
> ComponentInstance compInstance = [[OSALanguage defaultLanguage]
> componentInstance];
> 
> 
> My requirement is to get the different instance on every call.


ComponentInstance compInstance = [[OSALanguageInstance 
languageInstanceWithLanguage:[OSALanguage languageForName:@"AppleScript"]] 
componentInstance]


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



___

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

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

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

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


Re: Need replacement of Component Manager::OpenDefaultComponent

2017-02-26 Thread Shane Stanley
On 26 Feb 2017, at 1:35 pm, dangerwillrobinsondan...@gmail.com wrote:
> 
> Yeah but even with OSAKit, to implement a language you need to link to Carbon 
> and use deprecated Carbon calls. 

I think you'll find that most (if not all) the calls you need to use are no 
longer marked as deprecated.

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



___

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

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

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

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


Re: Some help with NSComparisonPredicate please

2017-02-16 Thread Shane Stanley
On 17 Feb 2017, at 10:54 am, sqwarqDev <sqwarq...@icloud.com> wrote:
> 
> Still looking for help with this, if anyone’s got any idea?

Use LIKE instead of CONTAINS? 

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



___

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

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

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

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

Re: NSTextView tab stop count

2016-10-14 Thread Shane Stanley
On 15 Oct. 2016, at 12:43 am, tridiak <trid...@ihug.co.nz> wrote:
> 
> This works up to 12. Above that, it sticks to 12.

Are you sure you're just not seeing them because the text in some columns is 
longer than you tab width? 

I just made a simple example with this:

NSMutableAttributedString *mas = [[NSMutableAttributedString alloc] 
initWithString:@"\t1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t20\t21\t22\t23\t24\t25\t26\t27\t28\t29\t30"];
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
NSMutableArray* ma=[NSMutableArray array];
for (int t=0; t< 31; t++) {
[ma addObject:[[NSTextTab alloc] initWithType:NSLeftTabStopType 
location:t*28.0f]];
}
[style setTabStops:ma];
[mas addAttribute:NSParagraphStyleAttributeName value:style 
range:NSMakeRange(0,mas.length)];
[self.textView insertText:mas];

It works as expected.

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



___

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

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

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

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

Re: Triggering a segue from code

2016-09-22 Thread Shane Stanley
On 23 Sep. 2016, at 1:17 pm, Kyle Sluder <k...@ksluder.com> wrote:
> 
> -close used to render windows more thoroughly dead

So can we assume that the close button generally calls -close?

On a tangent here...

In Safari, it used to be that if a script asked for the app's windows, 
-orderedWindows would return a list of open windows. Under Sierra, however, the 
list returned can include windows that have been closed via the close box -- 
you might have closed them half-an-hour ago. They show with a visible property 
of false, but by setting it to true they reappear -- no Web contents, but the 
URL, title, etc all intact. And the only way to close them is again via script 
-- their close buttons do nothing.

It's probably just a bug, although DTS don't seem to think so, but these 
windows seem surprisingly resistant to death.

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



___

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

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

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

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

Re: How to update UI from a background thread

2016-09-22 Thread Shane Stanley
On 22 Sep. 2016, at 10:20 pm, Dave <d...@looktowindward.com> wrote:
> 
> myNetworkleScriptSourceString = [[NSString alloc] 
> initWithContentsOfFile:myNetworkleScriptFilePath 
> encoding:NSUTF8StringEncoding error:];
> if (myErrorInfo != nil)

You should be testing for !myNetworkleScriptSourceString; you shouldn't touch 
myErrorInfo unless myNetworkleScriptSourceString is nil.

> [myNetworkleScript executeAndReturnError:];
> if (myErrorDictionary != nil)

Check the result of executeAndReturnError: first.

> So I’m wondering if it is something to do with the AppleScript handling?

What happens if you just comment out the execution line? (My guess is it will 
make no difference.)

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



___

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

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

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

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

Re: How to update UI from a background thread

2016-09-22 Thread Shane Stanley
On 23 Sep. 2016, at 1:42 am, Jens Alfke <j...@mooseyard.com> wrote:
> 
> AFAIK, AppleScripts can only be run on the main thread. But it’s been many OS 
> releases since I worked with them.

FYI, that hasn't been the case for quite some time.

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



___

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

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

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

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

Re: Package installation on MacOS Sierra

2016-09-18 Thread Shane Stanley
On 19 Sep 2016, at 8:36 AM, Graham Cox <graham@bigpond.com> wrote:
> 
> I have the classic .dmg approach to installation, where a disk image includes 
> an alias for /Applications and the user drags the app icon to it. On 10.12, 
> the alias appears to point to nothing, and has a generic file icon. Has this 
> kind of installer image been obsoleted by 10.12? If so, what can we do to 
> replace it in a way that works across various OS versions?

FWIW I just tried one of those .dmgs here on 10.12 and it behaved as expected.

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



___

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

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

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

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

Re: Strange toolbar item error

2016-09-17 Thread Shane Stanley
On 18 Sep 2016, at 3:12 AM, Kyle Sluder <k...@ksluder.com> wrote:
> 
>> For anyone seeing the same thing, the solution seems to be to change the
>> max size of the toolbar items to the unexpected "expected" size.
> 
> Yes, the intent of the warning message is to get you to do that. But
> since you’re linking against and deploying to Mavericks, I fear you’ll
> wind up with too-big buttons on older OSes. Could you please file a bug
> report with a sample project attached, and send me the bug number?

Will do. So if I understand you correctly, my options are:

* Change the max size as above, and have toolbar items potentially appear the 
wrong size pre-Sierra;

* Ignore the warning and have everything appear as it should in each version;

* Perhaps set the max size in code, based on the running OS version.

FWIW, I'm also seeing it on another project, which is more complex: the toolbar 
items are all moderately subclassed, it doesn't use autolayout, and it's all 
done in code rather than a nib. I've tried a few things, but I can't see any 
way to make the warning go away. 

I think I understand the point of the message, but the adamant tone is going to 
put developers in an invidious position if users start logging bugs with them 
over it.

>> I
>> thought I'd already tried this without success, until I realized what was
>> happening: I had edited the values, then closed the toolbar editor in IB.
>> I've now realised that the changes were not being saved; when I reopened
>> the toolbar editor, the old values were still showing. Running once with
>> the toolbar editor open seems to have made the changes 'take". (And yes,
>> I tried cleaning at various stages.)
> 
> This sounds worthy of investigation. Could you please file a bug report
> detailing the _exact_ steps that resulted in your changes being
> forgotten? Send me that bug number too please.

It's #28348587.

>> Along the way I discovered another problem in Xcode 8: setting a button
>> to image-only in IB still shows any title if there is one.
> 
> I think we have a bug report on this already.

I've already filed #28348535, which includes a simple example.

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



___

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

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

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

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

Re: Strange toolbar item error

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

I checked under the latest(?) GM, and it's still showing "Deployment 
Target(10.9)".

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

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

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



___

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

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

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

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

Re: Strange toolbar item error

2016-09-14 Thread Shane Stanley
On 15 Sep 2016, at 3:24 PM, Shane Stanley <sstan...@myriad-com.com.au> wrote:
> 
> On 15 Sep 2016, at 2:54 PM, Kyle Sluder <k...@ksluder.com> wrote:
>> 
>> What’s your app’s deployment target? What’s the deployment target of
>> your nib (listed in the file inspector while the nib is open for
>> editing)?
> 
> The app's deployment target is 10.9, and the nib's is set to "Deployment 
> Target(10.9)".

Just to be clear: that's what's showing now, but I'm not running 10.12 now. So 
I suppose Xcode 8 could be changing it under 10.12.

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



___

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

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

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

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

Re: Strange toolbar item error

2016-09-14 Thread Shane Stanley
On 15 Sep 2016, at 2:54 PM, Kyle Sluder <k...@ksluder.com> wrote:
> 
> What’s your app’s deployment target? What’s the deployment target of
> your nib (listed in the file inspector while the nib is open for
> editing)?

The app's deployment target is 10.9, and the nib's is set to "Deployment 
Target(10.9)".

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



___

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

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

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

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

Strange toolbar item error

2016-09-14 Thread Shane Stanley
Under 10.12 GM, I'm seeing entries like this in Console:

NSToolbarItem () had to adjust the size of 
 from {38, 25} to the expected size of {40, 27}. Make 
sure that this toolbar item view has a valid frame/min/max size. This is an app 
bug, please do not file a bug against AppKit or NSToolbar! Break on 
_NSToolbarAdjustedBorderedControlSizeBreakpoint

I'm seeing it in a couple of apps -- one using a standard nib approach, and one 
generating the toolbar fully in code. 

In the nib one, the toolbar has buttons on the toolbar items, and IB won't even 
allow any size other than 25px deep. I've tried fiddling with the toolbar item 
sizes, to no avail. I added the suggested breakpoint, but I don't see it break. 
If the message weren't so adamant, I'd be inclined to question it.

Anyone else seen it, or have suggestions?


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



___

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

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

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

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

Re: XIP archive won't extract for my users

2016-09-10 Thread Shane Stanley
On 11 Sep 2016, at 9:42 AM, SevenBits <sevenbitst...@gmail.com> wrote:
> 
> Following the recent trend by Apple, I have begun packaging my app
> downloads as an "XIP" file. Several of my users are reporting that, upon
> downloading the file, they can't extract it because "the archive doesn't
> come from Apple". 

From the latest update to 'macOS Code Signing In Depth':

> Important: Starting with macOS Sierra, only XIP archives signed by Apple will 
> be expanded. Developers who have been using XIP archives will need to move to 
> using signed installer packages or disk images.


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



___

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

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

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

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

Re: Set the size of a sheet when it's first loaded

2016-08-25 Thread Shane Stanley
On 25 Aug 2016, at 10:22 PM, Sandor Szatmari <admin.szatmari@gmail.com> 
wrote:
> 
> What are you calling to set the window's frame?  I am under the impression 
> that calling setFrame: is not respected when using autolayout.

Thanks -- that's the simple thing I was forgetting.

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



___

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

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

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

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

Set the size of a sheet when it's first loaded

2016-08-25 Thread Shane Stanley
I have a window that is shown as a sheet over another window. The sheet 
contains a small table, and I want the sheet to be sized vertically to show 
however many rows are required. So just before I show the sheet I update the 
table and adjust the window's frame. This works fine -- except for the first 
time the sheet appears, when it always appears with the size set in the nib.

I'm using autolayout, and I'm calling the code to set the window's frame and 
reload the table's data before showing the sheet (but after calling window to 
ensure it's loaded). The table is being updated, but not the size. I've also 
tried setting the frame in the sheet controller's windowDidLoad, but that 
appears to be too late.

I'm sure I'm missing something simple... 

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



___

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

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

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

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

Re: Issue with read/write to NSFileHandle

2016-06-30 Thread Shane Stanley
On 30 Jun 2016, at 4:33 PM, Graham Cox <graham@bigpond.com> wrote:
> 
> Yes, is that wrong?
> 
> If it is wrong, what’s the purpose of +[NSFileHandle 
> fileHandleForUpdatingURL:…] which is intended for read/write, as opposed to 
> making a separate one for read and another for write?

I think it's meant for simple cases where the same object is read and writing, 
more or less. Try separate read/write handles. 

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



___

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

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

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

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

Re: Issue with read/write to NSFileHandle

2016-06-29 Thread Shane Stanley
On 30 Jun 2016, at 1:40 PM, Graham Cox <graham@bigpond.com> wrote:
> 
> Reading the documentation, NSFileHandle seems to have only one file offset, 
> which is common to both read and write, which is a bit puzzling, because 
> surely you’d want to write at the end of the file, but read from wherever 
> you’d read from last time.

You're not trying to use the same handle for both, are you?

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



___

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

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

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

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

Re: XCode snapshot function?

2016-05-09 Thread Shane Stanley
On 10 May 2016, at 11:21 AM, Graham Cox <graham@bigpond.com> wrote:
> 
> Where is the snapshot function in XCode these days (XCode 7.3)?

Disappeared a few versions back, I believe.

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


___

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

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

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

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

Re: Alternatives to NSMatrix that uses bindings similar to NSMatrix's bindings

2016-04-08 Thread Shane Stanley
On 8 Apr 2016, at 9:23 AM, Graham Cox <graham@bigpond.com> wrote:
> 
> If you have a bunch of “naked” radio buttons, all having the same target and 
> selector (but presumably different tags, so you can distinguish them), they 
> will automatically act as a group.

But that doesn't help with the problem of bindings for selectedIndex, does it?

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



___

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

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

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

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

Re: Datasource methods in view-based tables

2016-02-12 Thread Shane Stanley
On 13 Feb 2016, at 11:24 AM, Quincey Morris 
<quinceymor...@rivergatesoftware.com> wrote:
> 
> The documentation is incorrect to call it “mandatory”. If you look in the 
> header file, you’ll find it described as optional for view-based table views. 
> So, fuhggeddaboudit.

Thanks, Quincey. I keep forgetting about checking the headers.

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



___

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

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

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

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

Datasource methods in view-based tables

2016-02-12 Thread Shane Stanley
I'm working on a project that involves view-based tables largely configured in 
code. I'm actually populating the cells in -tableView:viewForTableColumn:row:, 
and I see the (very) simple example in Apple's docs does the same thing. But 
that leaves me wondering about the role of the datasource method 
-tableView:objectValueForTableColumn:row:. The documents insist it's required, 
but as far as I can see, it's not doing anything. In a simple test, omitting it 
seems to make no difference.

Is it really required, and if so, would it matter if it just returned nil all 
the time? I guess I just see something that's called so often is wasting cycles 
if it's not needed.

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



___

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

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

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

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

Re: More Xcode 7 inconsistency?

2016-01-06 Thread Shane Stanley
On 14 Oct 2015, at 2:27 PM, Shane Stanley <sstan...@myriad-com.com.au> wrote:

> On 14 Oct 2015, at 1:33 PM, Graham Cox <graham@bigpond.com> wrote:
>> 
>> I’ve been passing nil forever, only now does Xcode 7 complain, presumably 
>> because only now is the _Nonnull attribute added. But either the 
>> documentation or the addition of _Nonnull is wrong.
> 
> FWIW, I've had an open bug on this since July (#21667200). You might also 
> notice the docs say "dict can be nil", and there isn't a "dict" to be seen 
> (presumably it means docAttributes).

Coming back to this, my bug has just been closed, with a pointer to:

<https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSAttributedString_AppKitAdditions/index.html#//apple_ref/doc/uid/TP40004007>

And sure enough, where it once said:

- (NSData * nullable)RTFFromRange:(NSRange)aRange
  documentAttributes:(NSDictionary * nonnull)docAttributes

it now says:

- (NSData *)RTFFromRange:(NSRange)aRange
  documentAttributes:(NSDictionary *)docAttributes


The description is unchanged:

> If there are no document-level attributes, dict can be nil.

Great.

However, when I look at the .h file, it's all wrapped in 
NS_ASSUME_NONNULL_BEGIN, and using the method with nil prompts exactly the same 
warning. So the contradiction between the documentation and actual behavior 
still stands, just not so obviously.

All of which led me to also look at this in the same document:

- (instancetype)initWithRTFD:(NSData *)rtfdData
  documentAttributes:(NSDictionary * _Nullable *)docAttributes


for which the .h file (Xcode 7.2) actually says:

- (nullable instancetype)initWithRTF:(NSData *)data 
documentAttributes:(NSDictionary * __nullable * __nullable)dict;

Am I just being a pedant or is this all a bit hopeless?


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



___

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

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

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

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

Re: NSWindow

2015-11-30 Thread Shane Stanley
On 1 Dec 2015, at 5:23 AM, Jerry Krinock <je...@ieee.org> wrote:
> 
> 1.  Create a NSWindow, send it a -display message, and then in that same run 
> loop cycle execute some task of noticeable duration.  In 10.10, the window 
> will appear on the screen before the task starts.  In 10.11, the window does 
> not appear until after the task is complete.

I'm glad I wasn't the only one caught by surprise on that. I don't doubt that 
Quincey's conclusions are correct, but there are situations where there are not 
particularly easy ways to get around it.

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



___

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

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

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

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

Re: Bunch of CoreData based NSDocument questions.

2015-11-29 Thread Shane Stanley
On 30 Nov 2015, at 9:41 AM, Ben Kennedy <b...@zygoat.ca> wrote:
> 
> This doesn't seem to square with the behaviour of, e.g., Preview.app. I hate 
> this app (and the auto-save architecture in general) because it gleefully 
> allows me to damage my own files without realizing it.
> 
> More specifically: open an image in Preview; crop it arbitrarily; then quit.  
> Go look at the source file on disk -- it has been irreparably damaged: the 
> crop was immediately saved!
> 
> Re-launch Preview, and observe that there is no way to undo this damage. As 
> far as I can tell, one is forced to dig in to the Time Machine BS in order to 
> resurrect the file.

System Preferences -> General, check "Ask to keep changes when closing 
documents".

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



___

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

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

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

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

Re: Bunch of CoreData based NSDocument questions.

2015-11-29 Thread Shane Stanley
On 30 Nov 2015, at 10:08 AM, Ben Kennedy <b...@zygoat.ca> wrote:
> 
> Either I was not aware of or had forgotten about that setting, but 
> regardless, it's already turned on.

Then your claim that "there is no way to undo this damage" is incorrect. Open 
an image in Preview, crop it, and quit. Open it again and you'll see the 
document is marked dirty/Edited, and you can get back to the original either by 
clicking the close button and Revert Changes, or choosing File -> Revert 
Changes...

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



___

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

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

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

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

Re: Bunch of CoreData based NSDocument questions.

2015-11-29 Thread Shane Stanley
On 30 Nov 2015, at 10:28 AM, Ben Kennedy <b...@zygoat.ca> wrote:
> 
> Are you suggesting this is sensible or intuitive?!

I'm not suggesting anything other than that it's not as you thought. One man's 
intuitive is another's weird. It is what it is. 

> Is this what the average user expects? 

I don't know -- I don't think many of us here really count as average users.

> The app has no business overwriting my original file without either a) my 
> explicitly hitting save, or b) prompting me to allow a save.

You might try clicking the "Close windows when quitting an app" checkbox, too.

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



___

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

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

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

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

Re: Bunch of CoreData based NSDocument questions.

2015-11-29 Thread Shane Stanley
On 30 Nov 2015, at 10:44 AM, Ben Kennedy <b...@zygoat.ca> wrote:
> 
> If I, as a 20-year Mac power user find this baffling, I can only imagine that 
> an average user would find it no more coherent.

But an average user comes at it without that 20 years' of expectations, so 
what's intuitive to her might be totally different. It may well be that it's 
more baffling to you *because* you're a long-time power user.

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



___

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

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

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

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

Re: dateFromString won't accept this string:

2015-11-23 Thread Shane Stanley
On 24 Nov 2015, at 9:26 AM, Alex Zavatone <z...@mac.com> wrote:
> 
> Here’s a pretty good (really really good) reference:

Except it's out-of-date.

<http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns>

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



___

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

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

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

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

Re: Installing older OS X

2015-11-17 Thread Shane Stanley
On 18 Nov 2015, at 11:50 AM, Quincey Morris 
<quinceymor...@rivergatesoftware.com> wrote:
> 
> I want to install 10.8.5 somewhere, to debug an app compatibility issue on 
> that OS, but I can’t seem to figure out how.

Does this help?

<https://support.apple.com/en-us/HT201372>


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



___

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

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

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

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

Re: More AppleScript-ObjC Bridge Weirdness

2015-11-11 Thread Shane Stanley
On 12 Nov 2015, at 4:29 AM, Dave <d...@looktowindward.com> wrote:
> 
> I restarted my Mac and and added as string on the handler definition and  it 
> started working (not sure which of these helped):

The "as string" did it. Passing from Objective-C to AppleScript uses lazy 
conversion; it doesn't happen unless you ask for it.
> 
> But now I have another problem with types/classes on the:
> 
>   set kMessageID of myDictionary to (the id of myMessage 
> as string)
>   set kMessageClass of myDictionary to (the class of 
> myMessage as string)
> 
> When I look at the returned dictionary I see:
> 
>kMessageClass = "\U00abclass outm\U00bb";
>kMessageID = 540;
> 
> Which are not of type NSString which is what I expected. However, if I run 
> the script in the Script Editor I get the String Equivalents:
> 
> kMessageID:"540”, 
> kMessageClass:"outgoing message"

You're expecting roughly the equivalent of an enum being returned as a string 
rather than an int in Objective-C, or a constant necessarily matching what it 
represents. Script Editor has the dictionary loaded so it can do the 
conversion, but a running app doesn't, so it converts the underlying code as 
best it can.

You need to test the options and build your own string:

if class of myMessage is outgoing message then
set kMessageClass of myDictionary to "outgoing message"
...

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



___

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

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

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

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

Re: Another AppleScript-ObjC Bridge Question

2015-11-10 Thread Shane Stanley
On 10 Nov 2015, at 9:46 PM, Dave <d...@looktowindward.com> wrote:
> 
> Just to clarify, I don’t need a “_” at all, anywhere? 

No.

> The reason I added them is because in uses them in the example at:

That's pre-10.9 syntax. Open Script Editor, and enter the code you see there:

on square_(aNumber)
   return aNumber ^ 2
end square_

Now compile and it will end up as:

on square:aNumber
return aNumber ^ 2
end square:

Same thing, different syntax.

(And you should always use Open with External Editor so you can edit and 
compile your code outside Xcode -- if you don't, you won't catch things like 
terminology clashes.)

See the section on handlers in the AppleScript Language Guide.


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



___

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

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

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

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

Re: Another AppleScript-ObjC Bridge Question

2015-11-09 Thread Shane Stanley
On 10 Nov 2015, at 1:47 AM, Dave <d...@looktowindward.com> wrote:
> 
> Got it working now, tt seems you don’t need the “_” after the name for init? 
> 
> Are the rules for when you need a “_” or not documented anywhere?

You don't need -- and in fact cannot use -- an underscore anywhere. The 
doThis:withThat: interleaved syntax was introduced to AppleScript in 10.9; 
before that, you would use doThis_andThat_() (which is what happens under the 
hood, and can still be used). But never an underscore where there is no 
parameter.

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



___

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

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

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

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

Re: AppleScript-ObjC Bridge Question

2015-11-01 Thread Shane Stanley
On 2 Nov 2015, at 12:59 AM, Dave <d...@looktowindward.com> wrote:
> 
> Yes, I was looking at it, but I’m confused how it knows the difference 
> between self and super?

I misread you code. If you really want to do this:

-(void) initWithParam:(NSString*) theParam
{
self = [self initWithParam:theParam andAnotherParam:nil];
if (self == nil)
return;

//  Do something

return self;
}

Then try something like:

on initWithParam:theParam
my initWithParam:theParam andAnotherParam:(missing value)
-- do something
return me
end init

Only use continue if the method is also defined in the AS class.

But unless you have to init the subclass that way, it would be a lot simpler to 
do a simple alloc()'s init(), and then set the (inherited) properties of the 
result.

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



___

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

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

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

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

Re: AppleScript-ObjC Bridge Question

2015-10-31 Thread Shane Stanley
On 31 Oct 2015, at 10:58 PM, Dave <d...@looktowindward.com> wrote:
> 
> So:
> 
>continue init()
> 
> Calls the Superclass? 

Yes.

> How would I do this:
> 
> -(void) initWithParam:(NSString*) theParam
> {
> self = [self initWithParam:theParam andAnotherParam:nil];
> if (self == nil)
>   return;
> 
> //  Do something
> 
> return self;
> }

Probably:

on initWithParam:theParam
continue initWithParam:theParam andAnotherParam:(missing value)

-- Add your subclass-specific initialization here.
-- If an error occurs here, return missing value.

return me
end init

But the differing inits smells a bit to me -- especially as it's unnecessary.

> 
> Thanks a lot, if you could point me to some documentation on this

There is none to speak of.

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


___

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

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

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

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

Re: AppleScript-ObjC Bridge Question

2015-10-31 Thread Shane Stanley
On 1 Nov 2015, at 12:05 AM, Dave <d...@looktowindward.com> wrote:
> 
> continue initWithParam:theParam andAnotherParam:(missing value) of me ?
> 
> Otherwise how will it know to call super or self?

From the AppleScript Language Guide:

> A continue statement causes AppleScript to invoke the handler with the same 
> name in the parent of the current handler.

No me.

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



___

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

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

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

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

Re: AppleScript-ObjC Bridge Question

2015-10-30 Thread Shane Stanley
On 31 Oct 2015, at 2:40 AM, Dave <d...@looktowindward.com> wrote:
> 
> Well, obviously it does get called, but how do you actually define in is 
> AppleScript? I mean what is the equivalent of:

I posted it several messages back:

on init()
continue init()

-- Add your subclass-specific initialization here.
-- If an error occurs here, return missing value.

return me
    end init

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



___

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

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

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

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

Re: AppleScript-ObjC Bridge Question

2015-10-30 Thread Shane Stanley
On 30 Oct 2015, at 8:46 PM, Dave <d...@looktowindward.com> wrote:
> 
> I can’t seem to find any other documentation on this and was wondering if 
> init would get called if I defined it, when I execute the following:

Why wouldn't it?

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



___

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

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

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

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

Re: AppleScript-ObjC Bridge Question

2015-10-29 Thread Shane Stanley
On 30 Oct 2015, at 1:14 AM, Dave <d...@looktowindward.com> wrote:
> 
> Using the AppleScript-ObjC bridge is it possible to define an init method in 
> the .applescript file and have it called like a normal Cocoa init?

Sure. If you create a document-based ASObjC project, you'll see an example:

on init()
continue init()

-- Add your subclass-specific initialization here.
-- If an error occurs here, return missing value.

return me
end init


> Is it possible to use different init methods, e.g. 
> 
> -(id) initWithParameterDictionary:(NSDictionary*) theParameterDictionary;

Yes, as long as the parameters are objects and not primitive types.

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



___

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

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

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

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

Re: More Xcode 7 inconsistency?

2015-10-14 Thread Shane Stanley
On 15 Oct 2015, at 4:02 AM, David Duncan <david.dun...@apple.com> wrote:
> 
> The helpful followup is that it is generally encouraged to use empty 
> containers (@[] or @{}) over nil when there is no semantic difference, as is 
> the case for the aforementioned API.

OK, but the docs still say: "The dictionary contains values from Document Types 
and must at least contain NSDocumentTypeDocumentAttribute." That suggests to me 
that an empty dictionary is not allowed.

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



___

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

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

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

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

Re: More Xcode 7 inconsistency?

2015-10-13 Thread Shane Stanley
On 14 Oct 2015, at 1:33 PM, Graham Cox <graham@bigpond.com> wrote:
> 
> I’ve been passing nil forever, only now does Xcode 7 complain, presumably 
> because only now is the _Nonnull attribute added. But either the 
> documentation or the addition of _Nonnull is wrong.

FWIW, I've had an open bug on this since July (#21667200). You might also 
notice the docs say "dict can be nil", and there isn't a "dict" to be seen 
(presumably it means docAttributes).

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



___

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

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

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

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

Re: Display USB Video Camera output : AVFoundation?

2015-09-09 Thread Shane Stanley
On 10 Sep 2015, at 2:22 pm, Jerry Krinock <je...@ieee.org> wrote:
> 
> In a Mac app, I need to display real-time video (as in “movies”) from a USB 
> camera on the screen.

Have a look at the sample code AVRecorder.

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



___

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

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

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

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

Visual glitch

2015-09-04 Thread Shane Stanley
My app has developed a visual glitch, and I'm hoping for some advice on how to 
rectify it. It occurs when entering or leaving the version browser, and it's a 
bit hard to describe, but part of what is mostly background area goes black. 
And I think it started happening when I moved to auto-layout, although I can't 
be certain.

There's no sign of it when I zoom or switch to/from full-screen mode; only 
going to/from the version browser (and only when I choose a version on the 
left, when leaving the version browser). 

The document window has a sidebar area to the left, although the black area 
tends to extend to the right of it, to a width that can vary. With the sidebar 
collapsed, the glitch is still there, although in a smaller way.

There's nothing particularly fancy in terms of constraints. The main split view 
has holding priorities of 270/250, and the left and right views it contains 
have >= constraints with a priority of 1000, but neither seem violated at any 
stage.

Any suggestions?

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



___

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

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

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

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

Crash help?

2015-08-20 Thread Shane Stanley
I'm try to track down a crash, and I'm not sure where to begin. This is what I 
see:

Crashed Thread:0  Dispatch queue: com.apple.main-thread

Exception Type:EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:   KERN_INVALID_ADDRESS at 0x07fb9095d6f0
Exception Note:EXC_CORPSE_NOTIFY

VM Regions Near 0x7fb9095d6f0:
CoreAnimation  000117933000-000117934000 [4K] rw-/rwx 
SM=PRV  
-- 
STACK GUARD7000-70001000 [4K] ---/rwx 
SM=NUL  stack guard for thread 5

Application Specific Information:
objc_msgSend() selector name: retain


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libobjc.A.dylib 0x7fff96ee44dd objc_msgSend + 29
1   com.apple.CoreFoundation0x7fff927b8b59 
_CFPreferencesSetValueWithContainer + 153
2   com.apple.Foundation0x7fff91fa30af 
-[NSUserDefaults(NSUserDefaults) setObject:forKey:] + 46
3   com.apple.CoreFoundation0x7fff9279ca3f -[NSSet 
makeObjectsPerformSelector:] + 223
4   com.apple.AppKit0x7fff8aa5fd26 -[NSIBObjectData 
nibInstantiateWithOwner:options:topLevelObjects:] + 1142
5   com.apple.AppKit0x7fff8aa3e9c1 loadNib + 384
6   com.apple.AppKit0x7fff8aa3dee5 
+[NSBundle(NSNibLoading) _loadNibFile:nameTable:options:withZone:ownerBundle:] 
+ 300
7   com.apple.AppKit0x7fff8abdc7d0 
+[NSBundle(NSNibLoadingInternal) 
_loadNibFile:externalNameTable:options:withZone:] + 150
8   com.apple.AppKit0x7fff8abdc588 -[NSWindowController 
loadWindow] + 310
9   com.apple.AppKit0x7fff8abd79f3 -[NSWindowController 
window] + 80
10  com.apple.AppKit0x7fff8abe8bf2 -[NSWindowController 
showWindow:] + 36
11  com.apple.AppKit0x7fff8abfffea -[NSDocument 
showWindows] + 93
12  com.apple.AppKit0x7fff8af979dc 
__80-[NSDocumentController 
openDocumentWithContentsOfURL:display:completionHandler:]_block_invoke1035 + 200
13  com.apple.CoreFoundation0x7fff927acaec 
__CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
14  com.apple.CoreFoundation0x7fff9279e865 __CFRunLoopDoBlocks 
+ 341
15  com.apple.CoreFoundation0x7fff9279e02e __CFRunLoopRun + 910
16  com.apple.CoreFoundation0x7fff9279da38 CFRunLoopRunSpecific 
+ 296
17  com.apple.HIToolbox 0x7fff9a36f3bd 
RunCurrentEventLoopInMode + 235
18  com.apple.HIToolbox 0x7fff9a36f153 
ReceiveNextEventCommon + 432
19  com.apple.HIToolbox 0x7fff9a36ef93 
_BlockUntilNextEventMatchingListInModeWithFilter + 71
20  com.apple.AppKit0x7fff8aac01e7 _DPSNextEvent + 1076
21  com.apple.AppKit0x7fff8ae8c90d -[NSApplication 
_nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 454
22  com.apple.AppKit0x7fff8aab60b8 -[NSApplication run] 
+ 682
23  com.apple.AppKit0x7fff8aa38396 NSApplicationMain + 
1176
24  libdyld.dylib   0x7fff89e345ad start + 1

It's a document-based app and I can produce it at will by: closing a document, 
waiting a couple fo seconds, then opening it (or any other document).

It doesn't happen under 10.9 or 10.10, nor in the first few 10.11s. 

Any suggestions?

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Crash help?

2015-08-20 Thread Shane Stanley
On 20 Aug 2015, at 7:16 pm, Mike Abdullah mabdul...@karelia.com wrote:
 
 Try running your app with zombies enabled

I spent a couple of hours playing with that the other day. After your email I 
tried again: success in minutes, thank you! I was failing to remove an 
observer...

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Regarding these Olivia messages. Can we do something about the list security?

2015-07-30 Thread Shane Stanley
On 30 Jul 2015, at 9:36 pm, Alex Zavatone z...@mac.com wrote:
 
 Including me, I know of three people who have gotten these.

FWIW, it's also happening to on at least one other Apple mailing list. Olivia 
seems to get around.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Anyone recommend Dash?

2015-07-09 Thread Shane Stanley
On 9 Jul 2015, at 5:02 pm, Roland King r...@rols.org wrote:
 
 I didn’t think you could do paid upgrades through the appstore. 

You can also buy Dash outside the App Store.

Apart from the Profiles UI, I'm a big fan.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Predicate warning from text view

2015-07-08 Thread Shane Stanley
On 8 Jul 2015, at 9:49 pm, David Durkee da...@dwdurkee.com wrote:
 
 I am seeing this in my application too, and turning off Markup did eliminate 
 it. I was really glad to see your email about that. Makes me want to see if 
 any other mysterious bugs go away with Markup turned off.
 
 In my case it is not a subclass of a NSTextView, but a straight instance of 
 one.

FYI, my bug report has been closed as a duplicate since I posted, so I guess 
that's also confirmation of a sort.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Predicate warning from text view

2015-07-07 Thread Shane Stanley
On 25 Oct 2014, at 10:23 am, Martin Wierschin mar...@nisus.com wrote:

 I have a subclass of a text view in my app. When I double-click on other 
 than a word (ie, a space or return), I get entries like these in the Console:
 
 _NSExtensionIsSafeExpressionForObjectWithSubquerySubstitutions: Expression 
 considered unsafe: SUBQUERY(extensionItems, $extensionItem, 
 $extensionItem.attachments.@count == 1 AND 
 SUBQUERY($extensionItem.attachments, $attachment, (NOT ANY 
 $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO com.adobe.pdf) AND 
 (NOT ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO 
 public.image)).@count == 0).@count
 
 
 I observed this log statement during the Yosemite beta period, on a stock 
 system with no additional extensions/apps installed, aside from my own app 
 being tested on OS X 10.10. My app (which also uses an NSTextView subclass) 
 produced that log statement, but TextEdit also produced a very similar log:
 
 TextEdit[578]: 
 _NSExtensionIsSafeExpressionForObjectWithSubquerySubstitutions: Expression 
 considered unsafe: SUBQUERY($extensionItem.attachments, $attachment, ANY 
 $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO public.image)
 
 
 I filed it as rdar://17541734 rdar://17541734 which was marked as a 
 duplicate of rdar://17432480 rdar://17432480 which is apparently closed 
 now. Perhaps the problem was reintroduced, or this has a different source? 
 
 In any case, I never observed any actual ill effects in my app whenever the 
 logging was triggered.

Just coming back to this...

I *think* that the number of these entries seems to have increased since I 
upgraded to 10.10.4  -- Console can be flooded with dozens at a time. But I've 
also found that they *stop* if turn off the Markup extension, and start back up 
when I turn it back on.

Can anyone else who is seeing the problem confirm that turning Markup solves 
the problem? nd aAny thoughts on how I might get Markup to stop poking in my 
window, especially as it can't actually do anything there?

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/

___

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

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

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

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

Re: [Swift] best way to support 'keyword' args, symbolic values, show values as literals?

2015-06-16 Thread Shane Stanley
On 17 Jun 2015, at 1:59 am, Dave d...@looktowindward.com wrote:
 
 I’m was about to add AppleScript Handling to my App and I’ll need to do a lot 
 of NSAppleEventDescriptor fishing, is there any advance documentation 
 relating to this?

Look in the NSAppleEventDescriptor header file -- it should be self-explanatory.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: iOS version check

2015-06-12 Thread Shane Stanley
On 13 Jun 2015, at 4:46 am, Steve Christensen puns...@mac.com wrote:
 
 I hadn't seen the NSProcessInfo method before so I took a peek at the header 
 and noticed that it's available as of iOS 8:
 
 - (BOOL) isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion)version 
 NS_AVAILABLE(10_10, 8_0);
 
 If your app still needs to run on iOS 7 then using the UIDevice method may be 
 a better way to go.

There's always -respondsToSelector:, which should then account for iOS 7.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Getting at NSTextFinder from text view

2015-04-14 Thread Shane Stanley
On 14 Apr 2015, at 10:05 pm, Martin Hewitson martin.hewit...@aei.mpg.de wrote:
 
 Hmm, are you sure about this? I was just able to produce one. In my first 
 text storage I have a long string and search for a common word like “the”. 
 Then I switch to the second text storage which has a much shorter string and:

This is what I'm doing in my text view subclass:

[self setIncrementalSearchingEnabled:NO];
[self.textFinder noteClientStringWillChange];
//  modify textStorage here
[self setIncrementalSearchingEnabled:YES];

Seems to be working in my (admittedly limited) testing.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/

___

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

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

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

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

Re: Getting at NSTextFinder from text view

2015-04-14 Thread Shane Stanley
On 14 Apr 2015, at 8:39 pm, Mark Wright blue.bucon...@virgin.net wrote:
 
 It would seem that in both your cases NSTextView should be fully aware of all 
 this by itself.  Perhaps the problem is in switching the NSTextStorage out 
 without notifying the text view of the change?  Are you swapping the 
 textStorage instance completely?  Perhaps changing it’s content and wrapping 
 with editing calls would work? :
 
 [textStorage beginEditing];
 [textStorage setAttributedString:theNewAttributedString];
 [textStorage endEditing];
 
 Maybe there’s another way to inform the parent textView that it’s content has 
 been changed.

FWIW, the above make no difference here.
 
 Shane, in your case I agree, -noteClientStringWillChange sounds like exactly 
 the method that’s needed.  I can’t see how to get to the textView’s 
 textFinder either.  You can get to the *findBar* with [[self.textView 
 enclosingScrollView] findBarView] but that’s just an NSView and likely to not 
 be helpful.  If you’re not creating your own textFinder (and it seems from 
 Martin’s experience that even if you do it doesn’t work) then the only thing 
 I can think of is to somehow notify the textView that its content has changed 
 and hope and presume that it has an internal mechanism for also notifying its 
 textFinder.

I implemented my own text finder and used -noteClientStringWillChange, and 
still no luck. What *seems* to be working is to disable incremental searching 
first, changing the text, then enabling it again. I use this elsewhere to get 
around another bug with text finder, at someone from Apple's suggestion.  
Depending on the state of the text finder at the time, it behaves a little 
differently for the first subsequent search, but that's a relatively small 
price to pay. 

It seems a lot of overhead for each time I modify the text, so maybe there's 
some way I can test if a search is active first.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Getting at NSTextFinder from text view

2015-04-14 Thread Shane Stanley
On 14 Apr 2015, at 9:19 pm, Martin Hewitson martin.hewit...@aei.mpg.de wrote:
 
 But if it fails for the first subsequent search, then the crashes will still 
 happen if the old search results are out of range of the new string. Right? 

No, there's no crash -- and it doesn't fail. In fact, the odd behavior I was 
alluding to actually seems to be a normal inconsistency in the find bar's 
behavior.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Getting at NSTextFinder from text view

2015-04-14 Thread Shane Stanley
On 14 Apr 2015, at 11:18 pm, Martin Hewitson martin.hewit...@aei.mpg.de wrote:
 
 Yeah, that’s what I’m doing, and I managed to create that crash. When you 
 modify the textStorage, do you swap it out? I’m doing
 
  [self.layoutManager replaceTextStorage:textStorage];

No -- I'm doing:

[[self textStorage] setAttributedString:string];


-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Getting at NSTextFinder from text view

2015-04-13 Thread Shane Stanley
On 13 Apr 2015, at 11:17 pm, Mark Wright blue.bucon...@virgin.net 
mailto:blue.bucon...@virgin.net wrote:
 
 To hide the find bar I use the following:
 
 [self.textFinder performAction:NSTextFinderActionHideFindInterface]

I guess if I go that option, I can just message the text view. At this stage 
the main thing is to stop the crashes.

Thanks!

-- 
Shane Stanley sstan...@myriad-com.com.au mailto:sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/ 
http://www.macosxautomation.com/applescript/apps/

___

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

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

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

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

Re: Getting at NSTextFinder from text view

2015-04-13 Thread Shane Stanley
On 13 Apr 2015, at 5:31 pm, Martin Hewitson martin.hewit...@aei.mpg.de wrote:
 
 The way I’ve been doing this is to keep hold of my own text finder in my 
 NSTextView subclass:
 
   snip
 
 Unfortunately I still get reports of crashes similar to what you report.

You almost had me convinced, until I read that last line ;-)

 I’m happy to share my test project, if you are interested.

I am, thanks.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Getting at NSTextFinder from text view

2015-04-12 Thread Shane Stanley
My document window includes several text views, all with find bars and 
incremental searching enabled, and searching works as expected. However, if I 
change the contents of a view via its text storage, and the user is in the 
middle of a search (that is, the gray overlay is showing with finds 
highlighted), I get either a crash (out-of-range error) or nonsense highlighted 
(the same ranges highlighted even though the content differs).

It looks to me like I need to call either -cancelFindIndicator or 
-noteClientStringWillChange on the text finder before I change the text. But I 
can't see how I can actually get hold of the frameworks-provided text finder to 
message it.

I fear I'm missing something simple. Any clues?

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Number formatter errors

2015-04-01 Thread Shane Stanley
On 2 Apr 2015, at 3:41 am, Sean McBride s...@rogue-research.com wrote:
 
 Do you have 'validates immediately' on?

No -- I didn't actually have a binding at that stage, which is why I wasn't 
seeing the result I expected. I'd missed the fact that bindings were the driver 
of the error dialog.


-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: View-based tableview and outlets to NSFormatters

2015-04-01 Thread Shane Stanley
On 2 Apr 2015, at 5:05 am, Sean McBride s...@rogue-research.com wrote:
 
 I swear this was discussed, but can't find it in the archives...
 
 It seems Interface Builder won't let me connect the 'formatter' outlet of a 
 textfield that's within a view-based tableview to a top-level formatter that 
 lives in the same nib.

I suspect this is what you are looking for, if not what you want to hear: 
http://prod.lists.apple.com/archives/cocoa-dev/2015/Mar/msg00107.html

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Number formatter errors

2015-03-31 Thread Shane Stanley
I start a new project, then drag a text field with attached number formatter 
into the window. I set the formatter's minimum to 0 and maximum to 1. I run, 
then enter 3 and hit return. I get a beep, but no error dialog. Yet I have 
existing projects where a dialog appears. I'm sure I'm missing something 
simple, but it's escaping me. Any hints?


-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Number formatter errors

2015-03-31 Thread Shane Stanley
On 1 Apr 2015, at 1:33 pm, Shane Stanley sstan...@myriad-com.com.au wrote:
 
  I'm sure I'm missing something simple, but it's escaping me.

Yep. Bindings.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/

___

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

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

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

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

Re: Display an Alert Sheet at a Specified Screen Position

2015-03-26 Thread Shane Stanley
On 27 Mar 2015, at 12:55 pm, Scott Ribe scott_r...@elevated-dev.com wrote:
 
 Be warned, starting with Mavericks things went wacko-batshit stupid if the 
 sheet is near the screen bounds...

My app is 10.9 and later only, but I think I'm mostly protected by virtue of a 
minimum size for that splitview subview. (My use of it elsewhere with an open 
panel is more problematic, however. I just can't think of anything better.) 

And full-screen mode just puts them back at the top of the window regardless.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Display an Alert Sheet at a Specified Screen Position

2015-03-26 Thread Shane Stanley
On 27 Mar 2015, at 10:45 am, Quincey Morris 
quinceymor...@rivergatesoftware.com wrote:
 
 AFAIK custom sheet positioning is basically never done. (And I don’t know 
 that you can force custom positioning on a NSAlert sheet.)

FWIW, you can -- I do it. (Think of a deep-ish document window divided into top 
and bottom sections, and the user is doing stuff in the bottom part -- it makes 
more sense, it seems to me, to have the alert appear from the top of the bottom 
view than at the top of the window.)

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Bindings in view-based tables

2015-03-05 Thread Shane Stanley
On 6 Mar 2015, at 10:32 am, Quincey Morris 
quinceymor...@rivergatesoftware.com wrote:
 
 Er, what exactly was bound to what?

In the cell-based table, the table's (sole) column's Font Size is bound to the 
shared user defaults controller with a Controller Key of values and Model Key 
Path of tableTextSize.

The buttons are in a radio group, with the Selected Tag bound to the same 
thing. (The two buttons have tags of 11 and 13 respectively).

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Bindings in view-based tables

2015-03-05 Thread Shane Stanley
On 6 Mar 2015, at 12:06 pm, Ken Thomases k...@codeweavers.com wrote:
 
 It seems you can't delete the cell view that's under the table column in the 
 first NIB.

It also seems that the row height is based on its height.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Bindings in view-based tables

2015-03-05 Thread Shane Stanley
On 6 Mar 2015, at 4:25 pm, Ken Thomases k...@codeweavers.com wrote:

 So you're saying it's a bug?
 
 I think the bug is that IB hides the existence of the sub-NIB.  If IB 
 presented the sub-NIB with all of the usual placeholders and put a Shared 
 User Defaults Controller into it when you set a binding on it, etc., that 
 would help make this clear.
 
 Also, it's a bug that IB will blithely let you create connections from 
 objects in the sub-NIB to objects outside the sub-NIB when those connections 
 won't survive to runtime.

That's what I was getting at, I guess. There's no indication that one is doing 
anything wrong (other than failure to work, of course).
 
 It also seems that the row height is based on its height.
 
 How so?  To my knowledge, Cocoa doesn't yet support determining row height 
 automatically based on the height of cell views (presumably determined by 
 auto layout).  UIKit has that, but AppKit does not.  And it's not clear to me 
 if it makes sense for a table that can have multiple columns, since each 
 column's cell view can be different.
 
 You set the table view's row height on the table view itself, on the Size 
 inspector.  There is an Automatic mode, but that uses the row size style from 
 System Preferences.

I had it set to automatic mode, and the unused table cell view was set to X 
points high. Each time I changed its height and ran it again, the height of the 
rows changed accordingly. No big deal because I needed to implement the 
delegate method anyway, but I was surprised.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Bindings in view-based tables

2015-03-05 Thread Shane Stanley
I'm converting a cell-based table to a view-based table in an old project. It 
contains a pair of buttons, Big and Small, that set a value in user defaults to 
13 or 11. The same value was used via bindings to set the Font Size in the 
table. It worked fine with a cell-based table, but I'm having no luck with 
view-based tables. I presumed the text field in the table cell view was the 
thing to bind, but I've tried just about every combination I can think of.

Should it still work?

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Bindings in view-based tables

2015-03-05 Thread Shane Stanley
On 6 Mar 2015, at 12:06 pm, Ken Thomases k...@codeweavers.com wrote:
 
 I _think_ connections to File's Owner are restored when the cell view NIB is 
 loaded, but the File's Owner of the sub-NIB may not be the same as the File's 
 Owner of the outer NIB.  It may not even be the same class.  It may also work 
 to connect to the Application placeholder; haven't checked.
 
 However, it doesn't seem to work to connect to the Shared User Defaults 
 Controller, as you've discovered.  

So you're saying it's a bug?

 Unfortunately, the solution is clumsy.  You have to use a separate view NIB 
 for the table cell view.  That means you can't really design the view-based 
 table in the NIB that contains the table view.  The table view is in one NIB 
 and the cell views are in other NIBs.
 
snip
 
 Hopefully that works for you.

It does, thanks. It certainly makes something that was relatively simple a lot 
more complex.


On 6 Mar 2015, at 12:13 pm, Quincey Morris 
quinceymor...@rivergatesoftware.com wrote:

 However, I think there’s an easier workaround. It ought to be fairly 
 straightforward to give the object that’s being used as the cell’s 
 “objectValue” a KVO-compliant “fontSize derived property that tracks the 
 user defaults value, and to bind the text field font size to that.

Thanks, Quincey. That sounds much easier, but alas I got your email after I'd 
started implementing Ken's suggestion.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Bindings in view-based tables

2015-03-05 Thread Shane Stanley
On 6 Mar 2015, at 11:42 am, Quincey Morris 
quinceymor...@rivergatesoftware.com wrote:
 
 Are you sure that the user defaults are being maintained properly? Does 
 choosing from the radio buttons actually change the user defaults? Is the 
 text field size getting set “manually” from somewhere else (perhaps as part 
 of the standard behavior of this text field in a standard cell view)? Can you 
 bind a freestanding text field, somewhere else in the window, to the user 
 defaults font size?

Binding another text field was the first thing I tried, and yes, it behaves as 
expected. It's only for a text field within a table cell view that it doesn't 
seem to work. Table views and columns also have Font Size bindings, and I've 
tried various permutations, with no luck.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Latest Documentation for adding Applescript Support to an Objective-C Project

2015-02-24 Thread Shane Stanley
On 24 Feb 2015, at 8:40 pm, Dave d...@looktowindward.com wrote:
 
 I’m wondering why I got a warning when I downloaded the sample Apps then?

Sounds odd. I just downloaded a couple again, with no problems other than build 
settings that needed to be updated.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Latest Documentation for adding Applescript Support to an Objective-C Project

2015-02-23 Thread Shane Stanley
On 24 Feb 2015, at 12:21 am, Dave d...@looktowindward.com wrote:
 
 From searching online it looks like things have changed quite recently?

Not in terms of how it's implemented in apps.

-- 
Shane Stanley sstan...@myriad-com.com.au
___

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

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

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

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

Re: NSPredicateEditor's date picker doesn't use user's date format

2015-02-19 Thread Shane Stanley
On 20 Feb 2015, at 5:17 pm, Steve Mills sjmi...@mac.com wrote:
 
 Shouldn't setLocalizedDateFormatFromTemplate be getting the format from my 
 system prefs?

I'd expect it would get it based on the locale you've set, not the date format 
you've set.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]

2015-01-23 Thread Shane Stanley
On 24 Jan 2015, at 6:25 am, Jerry Krinock je...@ieee.org wrote:
 
 NSString* source ;
 source = [NSString stringWithFormat:
 @tell application \%@\\n
 @activate\n
 @present last logged error\n
 @end tell,
 [[NSBundle mainAppBundle] bundlePath]
 ] ;
 
 where [[NSBundle mainAppBundle] bundlePath] returns “com.mycompany.MyApp”.  

In that case, you should be using @tell application id \%@\\n. (Oh, and 
activate seems to have become asynchronous these days.)

 MyApp indeed has a 'present last logged error’ AppleScript command defined, 
 and it works.

What does it do -- does it call OSACOerceFromDesc() by any chance? Do you know 
what code was running when the errors were generated?

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Inexplicable Crash in -[NSAppleScript executeAndReturnError:]

2015-01-23 Thread Shane Stanley
On 24 Jan 2015, at 11:40 am, Shane Stanley sstan...@myriad-com.com.au wrote:
 
 where [[NSBundle mainAppBundle] bundlePath] returns “com.mycompany.MyApp”.  
 
 In that case, you should be using @tell application id \%@\\n.

Ignore that. Your code says bundlePath, but I focused on your description, 
which looks more like a UTI. 

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Yosemite-like Toolbar: Segmented Controls, Buttons, Template Images?

2014-12-17 Thread Shane Stanley
On 18 Dec 2014, at 4:40 pm, Jerry Krinock je...@ieee.org wrote:
 
 I have spent several hours looking for a combination of NSSegementedControl 
 of a given style and/or NSButton of a given style that will look like the 
 buttons and what appear to be segmented controls in the toolbars of Xcode and 
 Mail in Yosemite.  So far, I have not found the answer.  Is there any?  Or 
 are these custom controls?

You're not saying which version of Xcode. FWIW, I went through a lot of similar 
trial and error, and found that setting a segmented style of Automatic gives me 
a similar result to, say, the View menu in a Finder window. I call 
setSegmentStyle:NSSegmentStyleSeparated when it loads under 10.10, which gives 
the separated appearance. But in terms of how template images work, it's the 
same.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Yosemite-like Toolbar: Segmented Controls, Buttons, Template Images?

2014-12-17 Thread Shane Stanley
On 18 Dec 2014, at 5:24 pm, Jerry Krinock je...@ieee.org wrote:
 
 With “Select None”, the segment and its image look the same whether it is 
 selected or not.  It does not change the black lines in my image to blue, as 
 desired.

The View menu in a Finder window doesn't show any blue. It basically reverses 
the image when selected, except when the window is in the background (in which 
case the background is a lighter grey).

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

Help/Unsubscribe/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 reset another app's prefs

2014-11-20 Thread Shane Stanley
On 21 Nov 2014, at 8:21 am, Scott Ribe scott_r...@elevated-dev.com wrote:
 
 Every once in a while, Word just resets some of its prefs. Every once in a 
 while, it corrupts its prefs. Every once in a while, it wedges itself due to 
 (probably) resource leaks. And so on. So periodically (+ whenever it stops 
 responding) I quit Word, copy preferences files from cached copies I keep 
 that are set the way I want, and relaunch it.

FWIW, this is a not-uncommon problem with AppleScript formatting preferences. 
It happens even if people lock the .plist. Someone plagued with it recently 
came up with this Terminal solution on the AppleScript mailing list:

do shell script asprefs=$(defaults read com.apple.applescript) ; defaults 
write com.apple.applescript \$asprefs\

Looks odd, but it might be worth a try.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Predicate warning from text view

2014-10-24 Thread Shane Stanley
I have a subclass of a text view in my app. When I double-click on other than a 
word (ie, a space or return), I get entries like these in the Console:

_NSExtensionIsSafeExpressionForObjectWithSubquerySubstitutions: Expression 
considered unsafe: SUBQUERY(extensionItems, $extensionItem, 
$extensionItem.attachments.@count == 1 AND SUBQUERY($extensionItem.attachments, 
$attachment, (NOT ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO 
com.adobe.pdf) AND (NOT ANY $attachment.registeredTypeIdentifiers 
UTI-CONFORMS-TO public.image)).@count == 0).@count

NSExtensionIsPredicateSafeToExecuteWithObject: NSPredicate considered unsafe: 
SUBQUERY(extensionItems, $extensionItem, $extensionItem.attachments.@count == 1 
AND SUBQUERY($extensionItem.attachments, $attachment, (NOT ANY 
$attachment.registeredTypeIdentifiers UTI-CONFORMS-TO com.adobe.pdf) AND (NOT 
ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO 
public.image)).@count == 0).@count == 1

I have Graphics turned off in IB because I don't support attachments. I do 
override -selectionRangeForProposedRange:granularity:, but not in any way that 
I can see would produce this sort of thing. The only place I use predicates is 
my completion code, but nothing to do with UTIs.

This is only happening under Yosemite.

Any suggestions on where I might start looking?

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Predicate warning from text view

2014-10-24 Thread Shane Stanley
On 24 Oct 2014, at 6:37 pm, Shane Stanley sstan...@myriad-com.com.au wrote:

 I have Graphics turned off in IB because I don't support attachments. I do 
 override -selectionRangeForProposedRange:granularity:, but not in any way 
 that I can see would produce this sort of thing. The only place I use 
 predicates is my completion code, but nothing to do with UTIs.

I need to get out more. It's actually happening in lots of apps, not just mine. 
Anyone else seeing it?

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Predicate warning from text view

2014-10-24 Thread Shane Stanley
On 25 Oct 2014, at 4:16 am, Kyle Sluder k...@ksluder.com wrote:
 
 I haven’t noticed it on my machine. It’s pretty obvious that it’s coming from 
 a new Yosemite extension that has a malformed “this is when I’m relevant” 
 query. What apps do you have installed that provide extensions?

System Preferences shows no third-party extensions. There's Markup under 
Actions, Add to Reading List and Add to iPhoto plus the required ones under 
Share Menu, and Calendar, Reminders, Stocks and Weather under Today.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Predicate warning from text view

2014-10-24 Thread Shane Stanley
On 25 Oct 2014, at 10:23 am, Martin Wierschin mar...@nisus.com wrote:
 
 I observed this log statement during the Yosemite beta period, on a stock 
 system with no additional extensions/apps installed, aside from my own app 
 being tested on OS X 10.10. My app (which also uses an NSTextView subclass) 
 produced that log statement, but TextEdit also produced a very similar log:
 
 TextEdit[578]: 
 _NSExtensionIsSafeExpressionForObjectWithSubquerySubstitutions: Expression 
 considered unsafe: SUBQUERY($extensionItem.attachments, $attachment, ANY 
 $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO public.image)

Interesting. I didn't notice it until I installed the release version. TextEdit 
is one of the apps that triggers it here (I haven't tested apps exhaustively), 
but that message is slightly different.
 
 In any case, I never observed any actual ill effects in my app whenever the 
 logging was triggered.

In my case I redirect stdErr output to my log window, so it's a bit of a pain. 
Looks like I can just filter it out, though.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Problem getting import UTI recognised

2014-10-16 Thread Shane Stanley
On 16 Oct 2014, at 10:07 pm, Graham Cox graham@bigpond.com wrote:
 
 maybe somone can spot an issue with the UTI export?

Just a guess -- the docs say:

 When specifying conformance for your UTI, your items should ideally conform 
 to both a physical and functional hierarchy. That is, the conformance should 
 specify both its physical nature (a directory, a file, and so on) as well as 
 its usage (an image, a movie, and so on). 
 
   • A UTI in the physical hierarchy should conform through the 
 inheritance hierarchy to public.item.
   • A UTI in a functional hierarchy should conform through inheritance to 
 a base UTI that is not public.item. For example, public.content, 
 public.executable and public.archive are all examples of functional base 
 UTIs. 
 While conforming to the functional hierarchy is not mandatory

That last sentence could be read as implying that conforming to a physical 
hierarchy is mandatory, and you're not doing that. So maybe you also need to 
conform to something like public.item or public.data.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: NSOutlineView

2014-09-10 Thread Shane Stanley
On 10 Sep 2014, at 12:49 pm, Shane Stanley sstan...@myriad-com.com.au wrote:

 FWIW, and this is unrelated to your problem, I'm not sure you should delete 
 the empty custom views, but rather drag the outline view and text view/scroll 
 view into them.
 
 At least, I did what you outlined on a project some time ago. When I recently 
 tried to update the .xib version to adopt auto-layout, the upgraded .xib 
 would not build:
 
 ibtoold[7281:507] Exception raised while unarchiving document objects - *** 
 -[NSBigMutableString replaceCharactersInRange:withString:]: nil argument
 /* com.apple.ibtool.errors */
 /Path/to/SMSDocument.xib: error: The document SMSDocument.xib could not be 
 opened. The operation couldn’t be completed. (com.apple.InterfaceBuilder 
 error -1.)
   Recovery Suggestion: Check the console log for additional information.

Timing is everything. It looks like the problem has just been fixed.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: NSOutlineView

2014-09-09 Thread Shane Stanley
On 10 Sep 2014, at 10:45 am, Charles Jenkins cejw...@gmail.com wrote:

 Then I deleted the left side’s empty custom view object and replaced it with 
 a Source View. I deleted the right side’s empty custom view object and 
 replaced it with one of the text view objects.

FWIW, and this is unrelated to your problem, I'm not sure you should delete the 
empty custom views, but rather drag the outline view and text view/scroll view 
into them.

At least, I did what you outlined on a project some time ago. When I recently 
tried to update the .xib version to adopt auto-layout, the upgraded .xib would 
not build:

ibtoold[7281:507] Exception raised while unarchiving document objects - *** 
-[NSBigMutableString replaceCharactersInRange:withString:]: nil argument
/* com.apple.ibtool.errors */
/Path/to/SMSDocument.xib: error: The document SMSDocument.xib could not be 
opened. The operation couldn’t be completed. (com.apple.InterfaceBuilder error 
-1.)
   Recovery Suggestion: Check the console log for additional information.

I ended up rebuilding the bits where I'd deleted the custom views, this time 
not deleting them, and that fixed the problem.

I suppose I could have accidentally fixed some corruption or other, but 
deleting the custom views reintroduced the problem.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: Talking to other apps - again

2014-08-06 Thread Shane Stanley
On 7 Aug 2014, at 12:41 am, Gerriet M. Denkmann gerr...@mdenkmann.de wrote:

 Apple Script Editor can do:
 
 tell application B
   get version
 end tell

And so can your app. Add AppleScriptObjC.framework to your target, and add this 
to main.m:

[[NSBundle mainBundle] loadAppleScriptObjectiveCScripts];

Add a new file (choose Empty) to the project, call it SomeName.applescript, and 
in it add:

script SomeName
property parent : class NSObject

on appVersion()
 tell application B
  set theVers to version
 end tell
 return theVers
end appVersion

end script

Now add an informal protocol to your calling class that includes:

- (NSString *)appVersion

And you can call it something like:

NSString *version = [NSClassFromString(@SomeName) appVersion];

There are a few things to watch: you should only pass objects, and the bridge 
only converts NSStrings/text, NSNumbers/reals/integers, NSArrays/lists and 
NSDictionaries/records. And if you pass variables to the script, it needs to 
coerce them to their AppleScript equivalents.

For one or two commands, ScriptingBridge might be easier. But for more complex 
stuff, ASObjC avoids the whole hassle of building and maintaining the app 
header file, and can do some stuff more efficiently than SBApplication et al 
can.


-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: How to get the time zone of a parsed date/time string?

2014-08-02 Thread Shane Stanley
On 31 Jul 2014, at 8:27 am, Jens Alfke j...@mooseyard.com wrote:

 I want to avoid if possible a solution that involves manually scraping the 
 string.

NSDataDetector? NSTextCheckingTypeDate has a timeZone property.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Auto layout and split views

2014-07-21 Thread Shane Stanley
I'm trying to rework a window to use auto layout, and I'm stuck.

The window consists of several nested split views, roughly as shown below.  A 
is one side of the main split view, and the right side is further split into B 
and another view, which contains yet another split view holding views C and D.

 
|   |   |   |
| A | C | D |
|   |___|___|
|   |   |
|   |   B   |
|   |   |
-

D can be collapsed. So if the user drags the divider to the right, when D gets 
too small, it is collapsed. But when I try to set the window up using auto 
layout, when the divider is dragged to the minimum size for D, view C keeps 
expanding while view D remains the same size, and view A starts shrinking 
instead. Similarly, if the user changes the C split to horizontal, dragging 
down results in B shrinking.

What I'm trying to achieve is to isolate the behavior when dragging a divider 
so that only the owning split view responds. And I'm not sure how to go about 
that.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/

___

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

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

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

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

Re: having both cell based and view based outline views in one project

2014-07-12 Thread Shane Stanley
On 13 Jul 2014, at 1:32 am, Keary Suska cocoa-...@esoteritech.com wrote:

 As far as I can tell, there is no public property that tells an NSTableView 
 whether it is cell-based or view-based

Yet there's a popup in IB (the very first one), so it's presumably doing 
something.

-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: having both cell based and view based outline views in one project

2014-07-12 Thread Shane Stanley
On 13 Jul 2014, at 7:58 am, Ken Thomases k...@codeweavers.com wrote:

 It's changing the prototype objects.

Makes sense, thanks. On my first try I spent ages trying to delete the old text 
cell, until I checked the example again...


-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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

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

Re: View-based outline view problem

2014-07-11 Thread Shane Stanley
On 11 Jul 2014, at 4:34 pm, Ken Thomases k...@codeweavers.com wrote:

 Have you connected the delegate outlet of your text view (field?)?

Yes.

On 11 Jul 2014, at 4:54 pm, Quincey Morris 
quinceymor...@rivergatesoftware.com wrote:

 1. The delegate method ‘control:textShouldBeginEditing:’ seems like it’s 
 called too late. Presumably the selection change needs to be done when the 
 text field gets first responder status, not when the text is actually changed.

Right, that's what I tried and that's what I'm seeing.
 
 2. It’s not obvious to me how the text field gets first responder status. In 
 the TableViewPlayground sample code, it does, without any apparent support, 
 so I assume this is something built into NSOutlineView - NSTableViewCell - 
 textField outlet (when you press Return). I don’t know how you’d customize 
 that if you have a non-standard table cell view. In particular, I don’t see 
 how you’d know *when* this was happening.

FWIW, in my cell-based version I used 
textView:willChangeSelectionFromCharacterRange:toCharacterRange: in my outline 
view subclass. But that no longer seems to get called.

 I guess you could solve it with a NSTextField subclass that overrides 
 becoming first responder.

That's all I can think of. Just seems a lot of work for something that doesn't 
strike me as an uncommon need. 


-- 
Shane Stanley sstan...@myriad-com.com.au
www.macosxautomation.com/applescript/apps/


___

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

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

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