Message from iOS to watchOS

2016-12-02 Thread Gerriet M. Denkmann
I have a pair of apps: iOS + watchOS.

The iOS app would like (e.g. when the user taps a button) to send some (short) 
info to the watchOS app.
The watchOS app probably should show something like a Notification Controller 
Scene:
Message from iOS (title)
Something was done  (body)
Accept / Refuse (buttons)

I looked at UNUserNotificationCenter, but did not see any way to specify the 
recipient of the notification.

And I am not interested in Push Notifications.  

Gerriet.

P.S. This is my first watch app, so I am more than usual clueless.


___

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

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

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

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


Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Pascal Bourguignon

> On 3 Dec 2016, at 00:40, Jens Alfke  wrote:
> 
> 
>> On Dec 2, 2016, at 2:17 PM, Andreas Falkenhahn > > wrote:
>> 
>> Well, just because apps that use undocumented features aren't rejected from 
>> the
>> app store doesn't make it official for me.
> 
> dlopen is hardly undocumented; it’s part of the core BSD Unix library. It’s 
> got a man page and everything.
> 
> Prior to iOS 8, the sandbox that 3rd party iOS apps ran in blocked calls to 
> dlopen, as well as other attempts to load dynamic libraries from within the 
> app bundle. That is now no longer the case, so you can use dlopen, dynamic 
> frameworks, etc.
> 
>> Also, there is no "Library" template for iOS in Xcode. Only a Cocoa Touch
>> Framework template. This also doesn't look like dlopen() is officially
>> supported on iOS.
> 
> That’s sort of weird; however, a framework is just a dynamic library packaged 
> with its headers in a specific bundle format. You can always use a framework 
> target and then add a script build step to copy the library out of the 
> framework.
> 
> I think the lack of a dylib target may just reflect that plug-ins of the kind 
> you’re implementing aren’t really very useful on iOS. Since there’s no way to 
> install extra plugins (downloading executable code is explicitly forbidden), 
> the set of plugins is effectively fixed, meaning it would be more efficient 
> to just statically link them all into the app.

The reason is rather you need to provide a code signature along with the dylib, 
hence the use of a framework bundle instead of a standalone .dylib.

-- 
__Pascal J. Bourguignon__



___

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

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

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

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

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Pascal Bourguignon

> On 2 Dec 2016, at 23:17, Andreas Falkenhahn  wrote:
> 
> On 02.12.2016 at 22:55 Pascal Bourguignon wrote:
> 
>> You would just embed the framework, without linking it.
> 
> I'm not very familiar with the latest Xcode so does this mean I should add
> my framework to "Embedded binaries" but not to "Linked Frameworks and 
> Libraries”?

Yes.


-- 
__Pascal J. Bourguignon__



___

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

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

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

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

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Jens Alfke

> On Dec 2, 2016, at 2:17 PM, Andreas Falkenhahn  wrote:
> 
> Well, just because apps that use undocumented features aren't rejected from 
> the
> app store doesn't make it official for me.

dlopen is hardly undocumented; it’s part of the core BSD Unix library. It’s got 
a man page and everything.

Prior to iOS 8, the sandbox that 3rd party iOS apps ran in blocked calls to 
dlopen, as well as other attempts to load dynamic libraries from within the app 
bundle. That is now no longer the case, so you can use dlopen, dynamic 
frameworks, etc.

> Also, there is no "Library" template for iOS in Xcode. Only a Cocoa Touch
> Framework template. This also doesn't look like dlopen() is officially
> supported on iOS.

That’s sort of weird; however, a framework is just a dynamic library packaged 
with its headers in a specific bundle format. You can always use a framework 
target and then add a script build step to copy the library out of the 
framework.

I think the lack of a dylib target may just reflect that plug-ins of the kind 
you’re implementing aren’t really very useful on iOS. Since there’s no way to 
install extra plugins (downloading executable code is explicitly forbidden), 
the set of plugins is effectively fixed, meaning it would be more efficient to 
just statically link them all into the app.

—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: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Gary L. Wade
Documentation on Apple’s site is sometimes difficult to peruse (a whole other 
thread and, arguably, always difficult nowadays), but I can guarantee you that 
it has been documented somewhere and is supported.  I’ve been involved in the 
process of using this process to load one version of a library for a number of 
airlines’ apps that differ when running during a flight vs when the user is on 
the ground.

In case you’re not aware of this, iOS and Cocoa Touch are effectively 
synonymous, and many people use the term library and framework to be 
synonymous, so, yes, this does exist and is supported.
--
Gary L. Wade
http://www.garywade.com/ 
> On Dec 2, 2016, at 2:17 PM, Andreas Falkenhahn  wrote:
> 
> On 02.12.2016 at 22:55 Pascal Bourguignon wrote:
> 
>> Yes, it’s “official”.
>> I’ve read the document about what is allowed and rejected for the
>> AppStore, and this is not rejected.
> 
> Well, just because apps that use undocumented features aren't rejected from 
> the
> app store doesn't make it official for me. To me "official" means that there
> is some word about it on https://developer.apple.com but apparently that
> isn't the case so it's an undocumented feature and nobody can predict for how
> long this is going to continue to work like it is now. It could be ditched
> any time if it's not documented. That makes me rather uneasy...
> 
> Also, there is no "Library" template for iOS in Xcode. Only a Cocoa Touch
> Framework template. This also doesn't look like dlopen() is officially
> supported on iOS.
> 
>> You would just embed the framework, without linking it.
> 
> I'm not very familiar with the latest Xcode so does this mean I should add
> my framework to "Embedded binaries" but not to "Linked Frameworks and 
> Libraries"?
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.com

___

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

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

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

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

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Andreas Falkenhahn
On 02.12.2016 at 22:55 Pascal Bourguignon wrote:

> Yes, it’s “official”.
> I’ve read the document about what is allowed and rejected for the
> AppStore, and this is not rejected.

Well, just because apps that use undocumented features aren't rejected from the
app store doesn't make it official for me. To me "official" means that there
is some word about it on https://developer.apple.com but apparently that
isn't the case so it's an undocumented feature and nobody can predict for how
long this is going to continue to work like it is now. It could be ditched
any time if it's not documented. That makes me rather uneasy...

Also, there is no "Library" template for iOS in Xcode. Only a Cocoa Touch
Framework template. This also doesn't look like dlopen() is officially
supported on iOS.

> You would just embed the framework, without linking it.

I'm not very familiar with the latest Xcode so does this mean I should add
my framework to "Embedded binaries" but not to "Linked Frameworks and 
Libraries"?

-- 
Best regards,
 Andreas Falkenhahnmailto:andr...@falkenhahn.com


___

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

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

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

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

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Pascal Bourguignon

> On 2 Dec 2016, at 15:37, Andreas Falkenhahn  wrote:
> 
> On 02.12.2016 at 07:57 Pascal Bourguignon wrote:
> 
>> Yes, dlopen is supported in iOS 8 and following.
> 
> Is this support official or does it just work by chance and might stop 
> working in the
> future? I've tried to find an official word from Apple concerning dlopen() on 
> iOS
> but I haven't been successful so far. Is there one? 

Yes, it’s “official”.
I’ve read the document about what is allowed and rejected for the AppStore, and 
this is not rejected.


> 
>> But of course, you can only open and link with libraries that have been code 
>> signed properly.
>> We use dlopen to load at run-time frameworks properly code signed
>> and included in the application bundle
> 
> So how does that work in practice? Should I create a Cocoa Touch Framework, 
> code sign
> it, include it in the "Embedded binaries" section in Xcode in my project and 
> select
> "Optional" for that framework in the "Linked frameworks and Libraries" 
> section in
> Xcode and then just use dlopen() on the framework's executable as listed in 
> the
> frameworks Info.plist? 

http://framemywork.blogspot.fr/2015/01/ios-8-app-extensions-dlopen-loading.html 


You would just embed the framework, without linking it.


> I can imagine that this works but once again the question is whether or not
> Apple officially supports directly dlopen()ing a framework executable? If they
> do, that would be great but if this is something that just happens to work 
> right
> now but might not do so in future versions I'd rather do it in a more 
> conventional
> way.


dlopen wasn’t available before iOS 7. It wasn’t officially supported in iOS 7, 
only from iOS 8 (when Xcode started to provide a iOS framework  template).

There are applications published in the AppStore that use dlopen.


Now, the framework must be code signed and packaged with your application, so 
this doesn’t concern third-party plug-ins, or anything you’d download from the 
internet.

On the other hand, in iOS 9 they started to allow modular downloading of 
applications in the AppStore: you can install eg. a game with the first levels, 
and only download and install further levels modularly once the previous ones 
are completed; 

http://ddeville.me/2014/04/dynamic-linking 



-- 
__Pascal J. Bourguignon__



___

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

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

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

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

Re: Documentation Workflow

2016-12-02 Thread Richard Charles

> On Dec 2, 2016, at 11:34 AM, Slipp Douglas Thompson 
>  wrote:
> 
> Alternatively, there's always archive.org's Wayback Machine.

Very helpful. I did not know this existed. Thanks so much for the example and 
instructions.

--Richard Charles


___

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

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

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

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


Re: Drag and drop on table view

2016-12-02 Thread João Varela

> 
> I am still not sure if I am doing this the right way (extending NSTableView) 
> because Xcode says "Subclassing NSTableView is usually not necessary”.
> 
> Jan E.

Yes, it is usually not necessary and I would go so far as saying that you 
shouldn’t. I normally create a new delegate class and override the recommended 
NSTableView delegate methods. Subclassing has too many caveats that the normal 
mortal has the tendency to get it wrong. And I’m assuming you are a “normal 
mortal”. ;)

João
> 

___

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

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

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

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

Re: Documentation Workflow

2016-12-02 Thread Gary L. Wade
I bet the documentation has gotten leaner since Apple's developers have been 
dog-fooding the Xcode feature, Add Documentation, available under the 
Editor:Structure men path, and only using what’s in there.

Just kidding…but maybe not!
--
Gary L. Wade
http://www.garywade.com/ 
___

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

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

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

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

Re: Documentation Workflow

2016-12-02 Thread Slipp Douglas Thompson
Alternatively, there's always archive.org's Wayback Machine.

For example, the Core Data Programming Guide from 2014-07-03 is available right 
here: 
https://web.archive.org/web/20140703032131/https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html#//apple_ref/doc/uid/TP40001075
 .  Both the HTML & PDFs are archived, so the PDF is downloadable from the 
“PDF” link (which gives you 
https://web.archive.org/web/20140702154734/https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/CoreData.pdf
 ).

Since developer.apple.com's URL paths have changed quite a bit with the recent 
narrow-body-giant-text-ification, I plugged 
https://developer.apple.com/library/ios/navigation/ into the Wayback Machine ( 
https://developer.apple.com/library/mac/navigation/ also works), chose a 
capture date a couple years ago, and then used the “Documents [ ] 
4293 of 4293” search input to find the doc I was looking for.

— Slipp


> On Dec 2, 2016, at 10:36 AM, 2551phil <2551p...@gmail.com> wrote:
> 
> 
>> On 2 Dec 2016, at 23:25, Richard Charles  wrote:
>> 
>> Somebody needs to start an online repository of older Apple developer 
>> documentation in pdf format.
> 
> I did do exactly that for the legacy AppleScript stuff[1] when it started 
> disappearing, but it’d be a bit of a mammoth task to do the same for the 
> whole of the Cocoa APIs. The best alternative I found once Apple removed the 
> PDFs was to use Dash[2]. 
> 
> [1]. https://applescriptlibrary.wordpress.com
> [2]. https://kapeli.com/dash
> 
> 
> 
> Best
> 
> 
> Phil
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/apple%2Bcocoa-dev%40slippyd.com
> 
> This email sent to apple+cocoa-...@slippyd.com


___

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

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

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

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

Re: Drag and drop on table view

2016-12-02 Thread J.E. Schotsman

> On 02 Dec 2016, at 18:19, Jens Alfke  wrote:
> 
> NSTableView has a whole set of delegate calls for implementing drag & drop; 
> you should use those instead. For example
> 
> - (NSDragOperation)tableView:(NSTableView*)tv 
> validateDrop:(id )info 
>  proposedRow:(NSInteger)row
>proposedDropOperation:(NSTableViewDropOperation)op

Ah! Stupid me, of course I only looked at the delegate, not at the data source.
Thanks, I could copy my code almost verbatim and I get a highlite line too now 
as a bonus.

Jan E.


___

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

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

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

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

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Andreas Falkenhahn
On 02.12.2016 at 18:21 Jens Alfke wrote:

> Don’t build a framework and don’t link the app with it. Just build
> a dynamic library and export the symbols for the entry points.
> (Exactly the same way as you do for macOS.)

And what about code signing the dynamic library?

-- 
Best regards,
 Andreas Falkenhahnmailto:andr...@falkenhahn.com


___

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

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

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

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

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Jens Alfke

> On Dec 2, 2016, at 6:37 AM, Andreas Falkenhahn  wrote:
> 
> So how does that work in practice? Should I create a Cocoa Touch Framework, 
> code sign
> it, include it in the "Embedded binaries" section in Xcode in my project and 
> select
> "Optional" for that framework in the "Linked frameworks and Libraries" 
> section in
> Xcode and then just use dlopen() on the framework's executable as listed in 
> the
> frameworks Info.plist? 

Don’t build a framework and don’t link the app with it. Just build a dynamic 
library and export the symbols for the entry points. (Exactly the same way as 
you do for macOS.)

—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: Drag and drop on table view

2016-12-02 Thread Jens Alfke

> On Dec 2, 2016, at 5:36 AM, J.E. Schotsman  wrote:
> 
> I am still not sure if I am doing this the right way (extending NSTableView) 
> because Xcode says "Subclassing NSTableView is usually not necessary”.

NSTableView has a whole set of delegate calls for implementing drag & drop; you 
should use those instead. For example

- (NSDragOperation)tableView:(NSTableView*)tv 
validateDrop:(id )info 
 proposedRow:(NSInteger)row
   proposedDropOperation:(NSTableViewDropOperation)op

—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: Accessing the bundle of the call-site

2016-12-02 Thread Jens Alfke

> On Dec 1, 2016, at 10:21 PM, Rick Aurbach  wrote:
> 
> Thank you for confirming my suspicions. I know that Bundle won’t help. What I 
> was hoping for was a Swift runtime call that returned the current module name.

Something equivalent to [NSBundle bundleForClass: [self class]]? I don’t think 
there’s anything like that. But this isn’t really the best mailing list to ask; 
try the swift-users list at swift.org , for questions about 
the Swift language and core libraries.

—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: Documentation Workflow

2016-12-02 Thread 2551phil

> On 2 Dec 2016, at 23:25, Richard Charles  wrote:
> 
> Somebody needs to start an online repository of older Apple developer 
> documentation in pdf format.

I did do exactly that for the legacy AppleScript stuff[1] when it started 
disappearing, but it’d be a bit of a mammoth task to do the same for the whole 
of the Cocoa APIs. The best alternative I found once Apple removed the PDFs was 
to use Dash[2]. 

[1]. https://applescriptlibrary.wordpress.com
[2]. https://kapeli.com/dash



Best


Phil
___

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

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

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

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

Re: Documentation Workflow

2016-12-02 Thread Richard Charles

> On Nov 12, 2016, at 10:41 AM, Richard Charles  wrote:
> 
> Why is the documentation team going down this bizarre path? Do they really 
> think we will be programming on iPads some day?

I hate to beat a dead horse here but there really does seem to be an effort 
underway to dumb down the developer documentation.

Here is a fustrating example I just encountered.

The current online documentation for NSManagedObject refers three times to a 
"Managed Object Accessor Methods" section in the Core Data Programming Guide. 
However it appears this section has now been entirely removed from the guide. 
Reaching this conclusion is a difficult task because there is no longer a pdf 
of the guide to search through. Apple only provides searching through all 
guides or manually drilling and dragging through a single guide searching for 
the revelant information.

So I guess the lesson here is if you have pdfs of the documentation you may 
want to consider saving it rather than tossing it. Somebody needs to start an 
online repository of older Apple developer documentation in pdf format. Now 
that would be helpful.

--Richard Charles


___

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

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

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

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


Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Andreas Falkenhahn
On 02.12.2016 at 07:57 Pascal Bourguignon wrote:

> Yes, dlopen is supported in iOS 8 and following.

Is this support official or does it just work by chance and might stop working 
in the
future? I've tried to find an official word from Apple concerning dlopen() on 
iOS
but I haven't been successful so far. Is there one? 

> But of course, you can only open and link with libraries that have been code 
> signed properly.
> We use dlopen to load at run-time frameworks properly code signed
> and included in the application bundle

So how does that work in practice? Should I create a Cocoa Touch Framework, 
code sign
it, include it in the "Embedded binaries" section in Xcode in my project and 
select
"Optional" for that framework in the "Linked frameworks and Libraries" section 
in
Xcode and then just use dlopen() on the framework's executable as listed in the
frameworks Info.plist? 

I can imagine that this works but once again the question is whether or not
Apple officially supports directly dlopen()ing a framework executable? If they
do, that would be great but if this is something that just happens to work right
now but might not do so in future versions I'd rather do it in a more 
conventional
way.

-- 
Best regards,
 Andreas Falkenhahnmailto:andr...@falkenhahn.com

___

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

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

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

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


Re: Drag and drop on table view

2016-12-02 Thread J.E. Schotsman
Posted too soon.
After implementing draggingUpdated it works  :-)

I am still not sure if I am doing this the right way (extending NSTableView) 
because Xcode says "Subclassing NSTableView is usually not necessary”.

Jan E.
___

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

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

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

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

Drag and drop on table view

2016-12-02 Thread J.E. Schotsman


Hello,

Asking the pundits for help again...

So far I am unsuccesful trying to implement drag & drop .
I want to be able to drag a file or folder on a table view and process the file 
after that.

On startup I do

jobList.registerForDraggedTypes( [kUTTypeFileURL as String] )
jobList.setDropRow( -1, dropOperation:.On ) // don’t drop on a cell

Handling the drag:

extension NSTableView //MARK: extension dragging
 {
 override public func draggingEntered( sender:NSDraggingInfo ) -> 
NSDragOperation
  {
  Swift.print("draggingEntered called")

  Swift.print("dragged types = \(sender.draggingPasteboard().types!)")
  if sender.draggingPasteboard().types!.contains( kUTTypeFileURL as String )
   {
   Swift.print("contains kUTTypeFileURL")
   let draggingSourceOperationMask  = sender.draggingSourceOperationMask()
   Swift.print("dragging source operation mask = 
\(draggingSourceOperationMask)")
   if draggingSourceOperationMask.contains(.Link) { return .Link }
   else if draggingSourceOperationMask.contains(.Generic) { return .Generic }
   }

  Swift.print("should not get here")

  return .None
  }

 override public func performDragOperation( sender:NSDraggingInfo) -> Bool
  {
  Swift.print("performDragOperation called")
  let pasteboard = sender.draggingPasteboard()

  if pasteboard.types!.contains( kUTTypeFileURL as String )
   {
   if let fileURL = NSURL( fromPasteboard:pasteboard )
{
// process file
return true
}
   }
   return false
  }
 }

When testing this the printout is

draggingEntered called
dragged types = ["public.file-url", "CorePasteboardFlavorType 0x6675726C", 
"dyn.ah62d4rv4gu8y6y4grf0gn5xbrzw1gydcr7u1e3cytf2gn", "NSFilenamesPboardType", 
"dyn.ah62d4rv4gu8yc6durvwwaznwmuuha2pxsvw0e55bsmwca7d3sbwu", "Apple URL 
pasteboard type", "com.apple.finder.node"]
contains kUTTypeFileURL
dragging source operation mask = NSDragOperation(rawValue: 55)

So the performDragOperation method is not called.
I have a feeling that the code belongs in the delegate but I cannot find any 
info on this.

Any help appreciated

Jan E.
___

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

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

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

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