Re: Window updates stall on headless Mac mini

2016-03-19 Thread Carl Hoefs

> On Mar 19, 2016, at 1:02 AM, Steve Mills  wrote:
> 
> On Mar 18, 2016, at 17:14:25, Carl Hoefs  
> wrote:
>> 
>> 
>> We ran into similar issues running headless. Adding a 'headless display 
>> emulator' seemed to be the cure for us:
>> 
>> http://www.amazon.com/CompuLab-fit-Headless-Display-Emulator/dp/B00FLZXGJ6
> 
> Interesting. Didn't know they had such a thing. This mini is in another 
> state, so we'll need to go through channels to get it done, if it comes to 
> that.

You may have other issues going on, so a video emulator might not be the "cure" 
you're looking for. But my understanding is that when there's no monitor 
attached to the Mini, the GPU doesn't get activated. The result is that the 
graphical elements of OS X such as OpenGL revert to being emulated in software. 
Also, there's a big difference in accessing such a machine via ARD because 
without the GPU, the CPU is doing all the screen rendering, causing a lot of 
lag.
-Carl


___

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

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

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

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

Another AS-ObjC Question

2016-03-19 Thread Dave
Sorry the example below is wrong, the classes are setup from Strings when using 
ASObjC and as I say it worked ok for Word. The original problem was that the 
init wasn’t working when I alloc/init’ed LTWAppleScriptHandlerExcel, I added 
the code to try to troubleshoot the problem. In the end, I did a Clean and 
Clean Build Folder and a Restart for good measure and it now compiles and links 
ok!

All the Best
Dave


___

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

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

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

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

Re: UIDocument with NSFileWrapper

2016-03-19 Thread davelist

> On Mar 19, 2016, at 8:01 PM, Quincey Morris 
>  wrote:
> 
> On Mar 19, 2016, at 14:23 , davel...@mac.com wrote:
>> 
>> My thought is to have a dictionary mapping each image filename to a 
>> NSFileWrapper
> 
> You already have one, basically. The top level wrapper for a package is a 
> directory wrapper, which lists the wrappers of contained files, indexed by 
> file name.

Yes, right now I have that wrapper saving a JSON file that I read/write back 
into my model.

The documentation I found for NSFileWrapper handles the case where there are a 
fixed number of files with names known at compile time so I’m struggling to 
understand what to do when the number of files can vary and the names aren’t 
known at compile time. 

What I’m having trouble understanding is how I store the images (whose 
filenames will vary from document to document) with NSFileWrapper. In my top 
level directory do I have my main model file as a JSON file along with a file 
(JSON or plist) that lists all the images and then have an Image directory that 
another NSFileWrapper is used to read/write the images (that are stored in the 
Image subdirectory)?

Or can I simply store all the files without a subdirectory? I still suspect I 
need to have a file with a fixed name (such as image.plist) that tells me what 
all the other filenames are to put in the NSFileWrapper (vs. using 
NSFileManager to ask for the name of all the files).

Thanks for all your input.

Dave Reed





___

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

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

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

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

Re: UIDocument with NSFileWrapper

2016-03-19 Thread Quincey Morris
On Mar 19, 2016, at 14:23 , davel...@mac.com wrote:
> 
> My thought is to have a dictionary mapping each image filename to a 
> NSFileWrapper

You already have one, basically. The top level wrapper for a package is a 
directory wrapper, which lists the wrappers of contained files, indexed by file 
name.
___

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

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

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

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

Re: NSTableView edit line, prevent dialog close with return key

2016-03-19 Thread Trygve Inda
> Ahh, the case of ambiguous ui
> 
> Perhaps Disable OK while editing a cell; enable when edit ends, so
> Return Return accepts then closes?
> 
> Gary

So how do I tell when editing begins since the control delegate is not
called when editing actually begins, but rather when the first key is
pressed once it is already in edit mode??

Trygve



___

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

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

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

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

NSTableView edit line, prevent dialog close with return key

2016-03-19 Thread Trygve Inda
I have an NSTableView in a sheet. The sheet has an OK button which closes
the sheet (and is the default blue button).

If I am editing a line of text in the NSTableView and press return, I want
the editing to stop and be accepted, but I don't want the sheet to close due
to the OK button accepting the return key as well.

How can I do this?



___

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

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

Help/Unsubscribe/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 - how to make documents visible in iTunes

2016-03-19 Thread Dave Fernandes
I have a related question -
If you share documents between apps in an app group, is there a way to download 
the shared folder from Xcode? It only gets the app’s local documents.

> On Mar 19, 2016, at 3:21 PM, Quincey Morris 
>  wrote:
> 
> On Mar 19, 2016, at 11:24 , Gerriet M. Denkmann  wrote:
>> 
>> I have an iOS app (9.2.1) (not document based) which contains stuff in:
>> /private/var/mobile/Containers/Data/Application/55…F0/Documents, which is 
>> the NSDocumentDirectory in NSUserDomainMask. 
>> 
>> I want to see these files in iTunes → my iOS Device → Apps → File Sharing
>> But my app does not even make it to this list of Apps.
>> 
>> Is there any magic needed in Info.plist (or where else)?
> 
> If you want to see those files that way, then you’re going to have to declare 
> the document types in your info.plist like any UIDocument-based app.
> 
> If you want to examine the container for debugging purposes, you can go to 
> the Xcode Devices window, select your app and choose (e.g.) Download 
> Container from the utility popup menu.
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/dave.fernandes%40utoronto.ca
> 
> This email sent to dave.fernan...@utoronto.ca


___

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

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

Help/Unsubscribe/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 - how to make documents visible in iTunes

2016-03-19 Thread Gerriet M. Denkmann

> On 20 Mar 2016, at 02:21, Quincey Morris 
>  wrote:
> 
> On Mar 19, 2016, at 11:24 , Gerriet M. Denkmann  wrote:
>> 
>> I have an iOS app (9.2.1) (not document based) which contains stuff in:
>> /private/var/mobile/Containers/Data/Application/55…F0/Documents, which is 
>> the NSDocumentDirectory in NSUserDomainMask. 
>> 
>> I want to see these files in iTunes → my iOS Device → Apps → File Sharing
>> But my app does not even make it to this list of Apps.
>> 
>> Is there any magic needed in Info.plist (or where else)?
> 
> If you want to see those files that way, then you’re going to have to declare 
> the document types in your info.plist like any UIDocument-based app.

Turns out this is not necessary.
But what is needed is: UIFileSharingEnabled = Application supports iTunes file 
sharing = YES
> 
> If you want to examine the container for debugging purposes, you can go to 
> the Xcode Devices window, select your app and choose (e.g.) Download 
> Container from the utility popup menu.

A very helpful hint. I did not know this before.

Thanks for your help!

Gerriet.


___

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

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

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

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

Re: UIDocument with NSFileWrapper

2016-03-19 Thread davelist

> On Mar 19, 2016, at 1:48 PM, Quincey Morris 
>  wrote:
> 
> On Mar 19, 2016, at 10:18 , davel...@mac.com wrote:
>> 
>> The downside I see for my app is that UIDocument writes out the data to a 
>> temporary location and then moves it to the new location so I think my app 
>> will constantly be writing out these image/PDF files that never change. Is 
>> there a better way to do this so that the image/PDF files only get written 
>> out when they’re first added (or changed if they do get changed).
> 
> a. It’s not obvious that the unchanged files *are* written to a temporary 
> location and then moved. The trick is to keep the original directory wrapper 
> that you got when opening the file, and to preserve the individual file 
> wrappers for unchanged components. (You can, for example, just delete the 
> file wrappers for things that *are* changed, when they’re changed, then add 
> the missing wrappers at save time.) The save mechanism then knows what has 
> and has not been changed, and can optimize the save appropriately.
> 
> b. Even if the files are copied, it’s not obvious that you need “a better 
> way”. It may be fine to copy the files at every save.
> 
> I’d recommend you don’t try to solve this problem until it forces itself on 
> you as an actual problem.
> 

Ok, I'll give it a try and see if it slows down too much or seems to be 
constantly overwriting these files before worrying any more about it. I just 
wondered if there was a "better way" to do it so I figured I'd ask before I 
delved to far into it. I'm not certain I fully understand what to do with 
NSFileWrapper in this case but I'll give it a try. My thought is to have a 
dictionary mapping each image filename to a NSFileWrapper. I may also need a 
plist of all image filenames so I can read that first and then read each of 
those image and store them in the dictionary of NSFileWrapper objects. I need 
to re-read the documentation again although it seemed the documentation for 
NSFileWrapper was pretty limited and didn't apply to this case where there's 
not a fixed number of files each with specific names.

If anyone has links to better documentation for my other question about 
exporting the document type using Xcode 7, I'm still in need of help there. 

Thanks,
Dave


___

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

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

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

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

Re: Window updates stall on headless Mac mini

2016-03-19 Thread Steve Mills

Here's the stalled thread's backtrace:

* thread #1: tid = 0xf3b18, 0x7fff89524136 
libsystem_kernel.dylib`__psynch_cvwait + 10, queue = 'com.apple.main-thread', 
stop reason = signal SIGSTOP
* frame #0: 0x7fff89524136 libsystem_kernel.dylib`__psynch_cvwait + 10
frame #1: 0x7fff8fa8b560 libsystem_pthread.dylib`_pthread_cond_wait + 693
frame #2: 0x7fff8dea323e AppKit`-[NSViewHierarchyLock 
_lockForWriting:handler:] + 323
frame #3: 0x7fff8df14d97 AppKit`-[NSView 
_displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:] + 469
frame #4: 0x7fff8decd1ae AppKit`-[NSView displayIfNeeded] + 1876
frame #5: 0x7fff8decca09 AppKit`-[NSWindow displayIfNeeded] + 236
frame #6: 0x7fff8decc672 
AppKit`_handleWindowNeedsDisplayOrLayoutOrUpdateConstraints + 936
frame #7: 0x7fff8e602171 AppKit`__83-[NSWindow 
_postWindowNeedsDisplayOrLayoutOrUpdateConstraintsUnlessPostingDisabled]_block_invoke1540
 + 46
frame #8: 0x7fff8a7db127 
CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 
23
frame #9: 0x7fff8a7db080 CoreFoundation`__CFRunLoopDoObservers + 368
frame #10: 0x7fff8a7cd188 CoreFoundation`__CFRunLoopRun + 872
frame #11: 0x7fff8a7ccbd8 CoreFoundation`CFRunLoopRunSpecific + 296
frame #12: 0x7fff91894b29 Foundation`-[NSRunLoop(NSRunLoop) 
runMode:beforeDate:] + 278
frame #13: 0x7fff918b2d9e Foundation`-[NSRunLoop(NSRunLoop) runUntilDate:] 
+ 108
frame #14: 0x00010024b74e RRD`-[MultiProgressMaster(PrivateMethods) 
_resetProgressTaskName:mainText:mainProgressValue:mainProgressMaxValue:mainProgressIndeterminate:subText:subProgressValue:subProgressMaxValue:subProgressIndeterminate:forTaskID:]
 + 3518
frame #15: 0x00010024b9b0 RRD`-[MultiProgressMaster(PrivateMethods) 
_resetProgressTaskWithInfoDict:] + 576
frame #16: 0x7fff91896dd0 Foundation`__NSThreadPerformPerform + 293
frame #17: 0x7fff8a7dba01 
CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
frame #18: 0x7fff8a7cdb8d CoreFoundation`__CFRunLoopDoSources0 + 269
frame #19: 0x7fff8a7cd1bf CoreFoundation`__CFRunLoopRun + 927
frame #20: 0x7fff8a7ccbd8 CoreFoundation`CFRunLoopRunSpecific + 296
frame #21: 0x7fff8ca6856f HIToolbox`RunCurrentEventLoopInMode + 235
frame #22: 0x7fff8ca682ea HIToolbox`ReceiveNextEventCommon + 431
frame #23: 0x7fff8ca6812b 
HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 71
frame #24: 0x7fff8dec98ab AppKit`_DPSNextEvent + 978
frame #25: 0x7fff8dec8e58 AppKit`-[NSApplication 
nextEventMatchingMask:untilDate:inMode:dequeue:] + 346
frame #26: 0x7fff8debeaf3 AppKit`-[NSApplication run] + 594
frame #27: 0x7fff8de3b244 AppKit`NSApplicationMain + 1832
frame #28: 0x000119f2 MM Automation`main(argc=1, 
argv=0x7fff5fbffce8) + 34 at main.m:13
frame #29: 0x000119c4 MM Automation`start + 52

Sent from iCloud's ridiculous UI, so, sorry about the formatting

 
___

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

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

Help/Unsubscribe/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 - how to make documents visible in iTunes

2016-03-19 Thread Quincey Morris
On Mar 19, 2016, at 11:24 , Gerriet M. Denkmann  wrote:
> 
> I have an iOS app (9.2.1) (not document based) which contains stuff in:
> /private/var/mobile/Containers/Data/Application/55…F0/Documents, which is the 
> NSDocumentDirectory in NSUserDomainMask. 
> 
> I want to see these files in iTunes → my iOS Device → Apps → File Sharing
> But my app does not even make it to this list of Apps.
> 
> Is there any magic needed in Info.plist (or where else)?

If you want to see those files that way, then you’re going to have to declare 
the document types in your info.plist like any UIDocument-based app.

If you want to examine the container for debugging purposes, you can go to the 
Xcode Devices window, select your app and choose (e.g.) Download Container from 
the utility popup menu.

___

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

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

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

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

iOS - how to make documents visible in iTunes

2016-03-19 Thread Gerriet M. Denkmann
I have an iOS app (9.2.1) (not document based) which contains stuff in:
/private/var/mobile/Containers/Data/Application/55…F0/Documents, which is the 
NSDocumentDirectory in NSUserDomainMask. 

I want to see these files in iTunes → my iOS Device → Apps → File Sharing
But my app does not even make it to this list of Apps.

Is there any magic needed in Info.plist (or where else)?

Gerriet.


___

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

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

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

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

Re: Window updates stall on headless Mac mini

2016-03-19 Thread Steve Mills
On Mar 18, 2016, at 17:14:25, Carl Hoefs  wrote:
> 
> 
> We ran into similar issues running headless. Adding a 'headless display 
> emulator' seemed to be the cure for us:
> 
> http://www.amazon.com/CompuLab-fit-Headless-Display-Emulator/dp/B00FLZXGJ6

Interesting. Didn't know they had such a thing. This mini is in another state, 
so we'll need to go through channels to get it done, if it comes to that.

--
Steve Mills
Drummer, Mac geek


___

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

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

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

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

Re: Window updates stall on headless Mac mini

2016-03-19 Thread Steve Mills
On Mar 19, 2016, at 00:12:39, Ken Thomases  wrote:
> 
> 
> Why are you running the main run loop?  For how long are you running it?  Why 
> aren't you running it in a private mode if it's for private purposes?  Are 
> you generally letting the main event loop run normally?

This is old code that I didn't write. I believe it is being run just to give 
the window time to update. It's being run for 0.1 second. Yes, otherwise the 
main event loop just runs normally. There may have been some need for this in 
older OS's - I don't know, as I've only been at this job for almost a year. I 
think last week we had experimented with removing the runUntilData: call and 
still experienced the lockup until we connected to that machine. I could be 
wrong - we tried tons of things.

> The main thread is blocked waiting on some other thread.  So, what are the 
> other threads doing?

There's one thread that's doing the bulk of our work, which is what caused the 
main thread to need to update the window.

--
Steve Mills
Drummer, Mac geek


___

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

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

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

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

Re: UIDocument with NSFileWrapper

2016-03-19 Thread Quincey Morris
On Mar 19, 2016, at 10:18 , davel...@mac.com wrote:
> 
> The downside I see for my app is that UIDocument writes out the data to a 
> temporary location and then moves it to the new location so I think my app 
> will constantly be writing out these image/PDF files that never change. Is 
> there a better way to do this so that the image/PDF files only get written 
> out when they’re first added (or changed if they do get changed).


a. It’s not obvious that the unchanged files *are* written to a temporary 
location and then moved. The trick is to keep the original directory wrapper 
that you got when opening the file, and to preserve the individual file 
wrappers for unchanged components. (You can, for example, just delete the file 
wrappers for things that *are* changed, when they’re changed, then add the 
missing wrappers at save time.) The save mechanism then knows what has and has 
not been changed, and can optimize the save appropriately.

b. Even if the files are copied, it’s not obvious that you need “a better way”. 
It may be fine to copy the files at every save.

I’d recommend you don’t try to solve this problem until it forces itself on you 
as an actual problem.

___

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

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

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

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

UIDocument with NSFileWrapper

2016-03-19 Thread davelist
I’m creating a document-based iPad app that I will want to persist the data 
(either using NSCoding or JSON or XML) along with auxiliary files that may be 
added, but won’t be modified much, if at all (i.e., image or PDF files the app 
displays but doesn’t modify). I have prior iOS experience writing apps using 
SQLite and Core Data in Objective-C although I’m using Swift for this app.

I’ve read through this:

https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/DocumentBasedAppPGiOS/CreateCustomDocument/CreateCustomDocument.html

and I think I see how NSFileWrapper works and how to use the
 - (id)contentsForType:(NSString *)typeName error:(NSError **)outError 
method. 

The downside I see for my app is that UIDocument writes out the data to a 
temporary location and then moves it to the new location so I think my app will 
constantly be writing out these image/PDF files that never change. Is there a 
better way to do this so that the image/PDF files only get written out when 
they’re first added (or changed if they do get changed). The other data that is 
written out using NSCoding or JSON or XML will obviously change much more 
frequently.


I’ve also had trouble finding up to date/accurate information about how to 
export the document type. I’ve found these two but neither match the UI in 
Xcode 7.2/7.3 for doing this and it appears some of the plist keys are now 
different.

https://developer.apple.com/library/ios/documentation/DataManagement/Conceptual/DocumentBasedAppPGiOS/DocumentImplPreflight/DocumentImplPreflight.html

https://developer.apple.com/library/ios/qa/qa1587/_index.html

Is there something else I should be reading for how to do this in Xcode 7?

Thanks,
Dave Reed


___

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

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

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

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

Another AS-ObjC Question

2016-03-19 Thread Dave
Hi,

I have a weird problem, I have two AppleScript-ObjC Classes/Script Files, setup 
like this:

LTWAppleScriptHandlerWord.h and .applescript
LTWAppleScriptHandlerExcel.h and .applescript

LTWAppleScriptHandlerWord works ok, but when I do this for Excel:

myAppleScriptHandler = [[LTWAppleScriptHandlerExcel alloc] init];

I get a link error:

  "_OBJC_CLASS_$_ LTWAppleScriptHandlerExcel", referenced from:

All the above files are in the XCode Project and it complies ok. I’ve checked 
that the @interface and the script x statement match between the .h and 
.applescript files and all seems fine and as I say its ok for Word.

Any what this could be wrong or how to track it down?

All the Best
Dave


___

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

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

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

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

Trying to understand weird NSOutlineVew behaviour

2016-03-19 Thread Graham Cox
Hi all,

I have a NSOutlineView (view based), and I have a fairly complex drag and drop 
situation. In implementing the dataSource method 
-outlineView:validateDrop:proposedItem:proposedChildIndex:, I need to find out 
exactly which row the mouse is over. This is because in some cases I need to 
drop between rows, even thought the row the mouse is over is a parent row. 
Depending on this, I need to drop above or below according to whether the mouse 
is above or below the half-way point of the row.

This is slightly different from the standard drag/drop stuff built-in to the 
table, which appears to divide each row approximately into thirds (not halves) 
when deciding which row the drag is over. Depending on exactly which item the 
row represents, I need to look at halves or thirds.

Here’s where it’s weird. In my validator method, I need to figure out for 
myself what true row I’m over, rather than take as read the value in  
passed by the table. Should be easy - get the dragging point, convert to table 
coordinates, and call -rowAtPoint:

BUT the value I get back from -rowtPoint: isn’t always the row the mouse is 
over. If the mouse is in the top or bottom third(ish) of the row, it returns 
row 0, being the top-level parent item. This matches the item I am already 
passed in my validator method, BUT IT’S NOT WHAT I WANT. This suggests to me 
that the implementation of -rowAtPoint: is being kludged during a drag and this 
is where the dragging code decides if it’s dragging between rows or on top of 
one. That’s not the right place for this determination - if, as I do, I need to 
know the real, true row the mouse is over in a drag, the apparently simple 
method -rowAtPoint: doesn’t give me a straight answer, but a bent one! When not 
in a dragging loop, -rowAtPoint: does give you the true row index.

This is bloody annoying. I means that I have to figure out another way to find 
the row the mouse is over without using -rowAtPoint: Given that this is now the 
sum of possibly varying row heights, this is not necessarily easy.

Has anyone else run into this problem? Can you confirm my suspicion that 
-rowAtPoint: is broken during row drags? Assuming I’m right, what’s the best 
way to figure out the true row containing a given point?

—Graham



___

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

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

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

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

Window updates stall on headless Mac mini

2016-03-19 Thread Steve Mills

We've been running into a situation where our app that's running on a headless 
mini will seem to stall in the same particular piece of code where there are no 
users currently screen sharing to it. As soon as we connect, it continues on. 
The code loads a view from a nib, moves it into a window that might or might 
not be already visible, resizes the window, and shows the window.

We thought we'd fixed it by rearranging some code that deals with 
setNeedsDisplay:YES, NSRunLoop runUntilDate, and setting a bunch of properties 
that are bounds to views in the window. And it did fix it for a week or so, but 
now it suddenly started doing it again, and the app hasn't been changed or quit 
or anything.

Any wild theories? We did stuff like check to see if any NSScreens are 
available (there is one, even when not connected via screen sharing, but we're 
pretty sure it's not an actual monitor). The app doesn't allow app sleep.

Sent from iCloud's ridiculous UI, so, sorry about the formatting

___

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

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

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

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

Re: Window updates stall on headless Mac mini

2016-03-19 Thread Ken Thomases
On Mar 19, 2016, at 3:01 AM, Steve Mills  wrote:
> 
> On Mar 19, 2016, at 00:12:39, Ken Thomases  wrote:
>> 
>> 
>> Why are you running the main run loop?  For how long are you running it?  
>> Why aren't you running it in a private mode if it's for private purposes?  
>> Are you generally letting the main event loop run normally?
> 
> This is old code that I didn't write. I believe it is being run just to give 
> the window time to update. It's being run for 0.1 second. Yes, otherwise the 
> main event loop just runs normally. There may have been some need for this in 
> older OS's - I don't know, as I've only been at this job for almost a year. I 
> think last week we had experimented with removing the runUntilData: call and 
> still experienced the lockup until we connected to that machine. I could be 
> wrong - we tried tons of things.
> 
>> The main thread is blocked waiting on some other thread.  So, what are the 
>> other threads doing?
> 
> There's one thread that's doing the bulk of our work, which is what caused 
> the main thread to need to update the window.

No.  The main thread is blocked waiting for another Cocoa thread.  It's waiting 
on an internal pthread condition variable.

> * frame #0: 0x7fff89524136 libsystem_kernel.dylib`__psynch_cvwait + 10
> frame #1: 0x7fff8fa8b560 libsystem_pthread.dylib`_pthread_cond_wait + 693
> frame #2: 0x7fff8dea323e AppKit`-[NSViewHierarchyLock 
> _lockForWriting:handler:] + 323

There must be some other thread which is going to signal that condition 
variable under some circumstances.  In all likelihood, that other thread is 
blocked on something else, so you have a pseudo-deadlock.

Show the backtrace of all threads.  Or a sample report, which has similar 
information.

Regards,
Ken


___

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

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

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

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

Re: question about last used date

2016-03-19 Thread Rick C.
Great thanks again for all the help much appreciated!


> On 15 Mar 2016, at 9:21 AM, Jens Alfke  wrote:
> 
> 
>> On Mar 14, 2016, at 6:11 PM, Rick C. > > wrote:
>> 
>> 2.  NSURLContentAccessDateKey returns the current date like mentioned here - 
>> http://stackoverflow.com/questions/13914600/get-the-real-last-opened-date 
>> 
>> 3.  The same problem with st_atimespec it returns the current date
> 
> The thread you linked to doesn’t say the _current_ date, it says "very 
> strange dates, usually near 3:00-3:30 AM, today or yesterday”. That’s 
> probably the last time the file was scanned by some system daemon like the 
> Spotlight indexer or Time Machine, as I said in my previous reply.
> 
>> So from what I see there is no real alternative to kMDItemLastUsedDate if 
>> that value is missing.  Additional thoughts?
> 
> 
> It sounds like what you want is a high level “last time this file was opened 
> in a GUI application by a user command” property, which isn’t something the 
> filesystem knows anything about. Higher-level frameworks seem to update 
> kMDItemLastUsedDate to implement this. If that data is lost, I don’t think 
> you have an alternative.
> 
> —Jens

___

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

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

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

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

Re: Reading XML 1.1

2016-03-19 Thread John Brownie

On 14/03/2016 19:14, John Brownie wrote:
Is it possible to read an XML 1.1 file using NSXMLDocument? The 
crucial thing for my purposes is that the character set allowed in XML 
1.1 is larger. XML 1.0 defines characters as:


Char   ::=   #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] 
| [#x1-#x10]


XML 1.1 defines:

#2   Char  ::=   [#x1-#xD7FF] | [#xE000-#xFFFD] | 
[#x1-#x10]/* any Unicode character, excluding the 
surrogate blocks, FFFE, and . */
#2a   RestrictedChar  ::=   [#x1-#x8] | [#xB-#xC] | 
[#xE-#x1F] | [#x7F-#x84] | [#x86-#x9F]


I need to be able to handle the RestrictedChar characters, but 
NSXMLDocument apparently only handles the XML 1.0 character set.


Is there a way to make NSXMLDocument handle the fuller character set? 
If not, is there an alternative that will enable me to parse an XML 
1.1 file with a minimum of effort?


No actual answers, but the best I've found is to use the expat XML 
parser with the expatobjc wrapper, and go in and change the ASCII tables 
to handle the extra characters (change from BT_NONXML to BT_OTHER). Of 
course, it is not as simple as NSXMLDocument in that I have to do the 
parsing myself rather than having it give me a nice tree structure which 
I can walk to create my internal data structure. It would be even nicer 
to have it in Swift, but I guess I can live with ObjC for now.


John
--
John Brownie, john_brow...@sil.org or j.brow...@sil.org.pg
Summer Institute of Linguistics, Ukarumpa, Eastern Highlands Province, 
Papua New Guinea

Mussau-Emira language, Mussau Island, New Ireland Province, Papua New Guinea
___

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

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

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

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