Re: Unusual Conditional Formatting

2016-09-07 Thread Frank D. Engel, Jr.
I am starting to think as well that I will need to create a new class for my value and type and work it out that way. I will give that a try. Thank you! On 9/7/2016 13:14, David Duncan wrote: On Sep 6, 2016, at 3:10 PM, Frank D. Engel, Jr. wrote: I am trying to set up

Re: Unusual Conditional Formatting

2016-09-07 Thread Frank D. Engel, Jr.
Tried adding the suggested KVO code - does not seem to have made a difference. Already had #2 - not sure that #1 is practical in this situation. On 9/7/2016 05:25, Jonathan Mitchell wrote: A couple of suggestions. Here is what I have so far: I used a category on NSNumber to add a

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Graham Cox
> On 8 Sep 2016, at 3:44 AM, Andreas Falkenhahn wrote: > > How can I access "IMPORTANT_DATA_PTR" from within the block above? You already did it. Variables are captured from the scope where the block is declared and “magically” get referenced within the block. So what

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Alastair Houghton
> On 7 Sep 2016, at 22:11, Jens Alfke wrote: > > >> On Sep 7, 2016, at 10:03 AM, Alastair Houghton >> wrote: >> >> All of it can. Objective-C is just C with some syntactic sugar on top. > > There’s a large amount of semantic sugar too,

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Jens Alfke
> On Sep 7, 2016, at 10:03 AM, Alastair Houghton > wrote: > > All of it can. Objective-C is just C with some syntactic sugar on top. There’s a large amount of semantic sugar too, i.e. the runtime libraries. (If you think the runtime part must be trivial, go

Re: What difference exist from where a method will be called?

2016-09-07 Thread Jens Alfke
> On Sep 7, 2016, at 1:18 PM, Raimond Hettrich wrote: > > Now when this method will be called by a button press the array will be > printed out correctly. ... > But if the method will be called from the drawRect method, the array will be > printed out without the

Re: How to silently use Proxy authentication credentials from Keychain, like Safari, Mail, etc.

2016-09-07 Thread Jens Alfke
> On Sep 6, 2016, at 5:36 AM, Motti Shneor > wrote: > > All my app does, is use KeyChain APIs to read proxy user/password. I believe > securityd agent/daemon is the one to prompt user for permission. It runs > under user ‘root’ - much like my

Re: How to silently use Proxy authentication credentials from Keychain, like Safari, Mail, etc.

2016-09-07 Thread Jens Alfke
> On Sep 6, 2016, at 5:36 AM, Motti Shneor wrote: > > All my app does, is use KeyChain APIs to read proxy user/password. I believe > securityd agent/daemon is the one to prompt user for permission. It runs > under user ‘root’ - much like my own daemon. Yes, but root

What difference exist from where a method will be called?

2016-09-07 Thread Raimond Hettrich
Dear all, there is a thing i can’t understand. In my class I have an NSMutableArray as a instance variable and a property. With the init method the array will be created with alloc / init. When my tableView has rows an information for each row will be added as object to my array. Then I have

Re: Mixing Swift and Objective-C protocols

2016-09-07 Thread Quincey Morris
On Sep 7, 2016, at 02:43 , Gerriet M. Denkmann wrote: > > But I cannot put it into my switch statement. The compiler says: Cannot > assign value of type ‘ObjC!’ to type 'BitField?' > How can I convince the compiler that the ObjC really implements the BitField > protocol?

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Andreas Falkenhahn
On 07.09.2016 at 18:09 Andreas Falkenhahn wrote: > As a C programmer I'm trying to avoid Objective C whenever and wherever > possible. I think this might be prone to misunderstanding: What I meant was that I'm trying to avoid writing classes whenever and wherever possible. I don't mind using

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Andreas Falkenhahn
On 07.09.2016 at 18:33 じょいすじょん wrote: > Have you considered Core Foundation? I absolutely love Core Foundation! As you might know I'm currently migrating a Carbon project to a Cocoa one and lots of it is of course in Core Foundation and I can just re-use those parts. It's really great that

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Andreas Falkenhahn
Hi Fritz, On 07.09.2016 at 18:35 Fritz Anderson wrote: >> On 7 Sep 2016, at 11:09 AM, Andreas Falkenhahn >> wrote: >> As a C programmer I'm trying to avoid Objective C whenever and wherever >> possible. >> The good thing is that I can do most interaction with Cocoa

Re: Unusual Conditional Formatting

2016-09-07 Thread David Duncan
> On Sep 6, 2016, at 3:10 PM, Frank D. Engel, Jr. wrote: > > I am trying to set up what is apparently a somewhat unusual behavior: > > I have a formatter which I want to behave differently depending on an > attribute of the value coming in, and on a user preference that

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Alastair Houghton
On 7 Sep 2016, at 17:09, Andreas Falkenhahn wrote: > > As a C programmer I'm trying to avoid Objective C whenever and wherever > possible. Don’t. Where there’s an Objective-C equivalent, it’ll be less error prone, shorter to write and easier to debug. > The good

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Jonathan Mitchell
> Of course, I can't use this code in a normal C function because there are > references to "self" and the selector thing doesn't look like it's compatible > to > C. So I could just subclass AVPlayerItem and voila, everything's fine. I forgot to say that as long as your c function is in a .m

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread dangerwillrobinsondanger
It's not Toll Free bridged. And Fritz, you contribute so much to folks, nobody would blink if you missed anything. Sent from my iPhone > On Sep 8, 2016, at 1:41 AM, Fritz Anderson wrote: > > “dangerwillrobinsondanger” correctly points to Core Foundation. I’m >

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Fritz Anderson
“dangerwillrobinsondanger” correctly points to Core Foundation. I’m embarrassed to have forgotten — it should be very helpful to you, assuming it mixes with AVFoundation. > On 7 Sep 2016, at 11:33 AM, じょいすじょん > wrote: > > Have you considered Core

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Fritz Anderson
> On 7 Sep 2016, at 11:09 AM, Andreas Falkenhahn wrote: > > As a C programmer I'm trying to avoid Objective C whenever and wherever > possible. > The good thing is that I can do most interaction with Cocoa from normal C > functions. > I only had to write very few

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread じょいすじょん
Have you considered Core Foundation? https://developer.apple.com/library/ios/documentation/CoreFoundation/Reference/CFNotificationCenterRef/ It is all C Another alternative is to look at the Objective-C runtime library routines. You can do a lot with the language from C... > On 2016 Sep 8, at

Re: C callbacks with NSNotificationCenter?

2016-09-07 Thread Jonathan Mitchell
> On 7 Sep 2016, at 17:09, Andreas Falkenhahn wrote: > > > Still, I'm wondering: Is it also possible to have NSNotificationCenter call > a C function for me whenever the notification triggers? Can this somehow > be achieved or am I forced to use full Objective C here? >

C callbacks with NSNotificationCenter?

2016-09-07 Thread Andreas Falkenhahn
As a C programmer I'm trying to avoid Objective C whenever and wherever possible. The good thing is that I can do most interaction with Cocoa from normal C functions. I only had to write very few classes. Most of the Cocoa stuff can be done from normal C functions just fine. Now I'd like to

Re: Drawing issue with translucent borderless NSWindow, initial content half stays

2016-09-07 Thread Sean McBride
On Tue, 30 Aug 2016 21:03:20 -0500, Ken Thomases said: >On Aug 30, 2016, at 10:10 AM, Sean McBride wrote: >> >> I have a drawing bug in my app, and reduced it to a toy app. >Basically, I create an NSBorderlessWindowMask type window who's content >view draws a

Re: How to set up my NSViews?

2016-09-07 Thread Andreas Falkenhahn
On 06.09.2016 at 21:30 Ken Thomases wrote: > On Sep 6, 2016, at 1:38 PM, Andreas Falkenhahn wrote: >> On 06.09.2016 at 18:51 Ken Thomases wrote: >>> On Sep 6, 2016, at 11:41 AM, Andreas Falkenhahn >>> wrote: My NSWindow contains an NSView

Re: How to set up my NSViews?

2016-09-07 Thread Andreas Falkenhahn
On 06.09.2016 at 21:22 Kyle Sluder wrote: > On Tue, Sep 6, 2016, at 01:38 PM, Andreas Falkenhahn wrote: >> On 06.09.2016 at 18:51 Ken Thomases wrote: >> > On Sep 6, 2016, at 11:41 AM, Andreas Falkenhahn >> > wrote: >> >> My NSWindow contains an NSView which I use to

Re: How to set up my NSViews?

2016-09-07 Thread Andreas Falkenhahn
On 06.09.2016 at 20:12 Richard Charles wrote: > Use AVPlayerLayer which is a subclass of CALayer. Set your parent > NSView as a layer backed view or as a layer hosting view. This > process can be a little confusing. > Refer to Setting Up Layer Objects. >

Re: Odd File Truncation

2016-09-07 Thread Roland King
> On 7 Sep 2016, at 19:19, Peter Hudson wrote: > > > ___ The file truncation seems to have spread to mail messages !!! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: Odd File Truncation

2016-09-07 Thread Peter Hudson
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription:

Re: Odd File Truncation

2016-09-07 Thread Charles Jenkins
I have a Time Capsule and find it very unreliable. It simply won’t stay mounted as a Time Machine volume. I would never save a file directly to it. Can you not save the original locally and then sync with the Time Capsule? On Wed, Sep 7, 2016 at 3:56 AM, Peter Hudson wrote:

Mixing Swift and Objective-C protocols

2016-09-07 Thread Gerriet M. Denkmann
I have several Swift classes CclassA, ClassB), all implementing the BitField protocol: protocol BitField { init?(limit: UInt64, verbose: Int) } My AppDelegate Swift class has: var a: BitField? switch mm { case .A:a = ClassA(limit: maxp, verbose: verbose )

Re: Window Opened Notification?

2016-09-07 Thread dangerwillrobinsondanger
> On Sep 7, 2016, at 6:09 PM, Dave wrote: > > I’m already using Accessibility but the notification I get when a window is > created is posted to too late for it to help in this case. > > I’m also using Event Taps, I want to be able to stop events being fired to > the

Re: Unusual Conditional Formatting

2016-09-07 Thread Jonathan Mitchell
A couple of suggestions. > Here is what I have so far: I used a category on NSNumber to add a > "valueType" attribute as described at > http://nshipster.com/associated-objects/. > > The formatter checks this and the user preference when formatting an incoming > value. It sets some instance

Re: Window Opened Notification?

2016-09-07 Thread Dave
Hi, I’m already using Accessibility but the notification I get when a window is created is posted to too late for it to help in this case. I’m also using Event Taps, I want to be able to stop events being fired to the window until I have received and procesed the Window Created Accessibility

Odd File Truncation

2016-09-07 Thread Peter Hudson
Hi All One of my apps saves its’ files to an Airport Time Capsule. Bog standard doc based app - using the usual framework methods to save its data. This works extremely well. And then, one day, the file that was saved was 20 bytes long instead of the usual 5 MBytes. I’m sure there are a host of

Re: Multiple Inheritance via protocol extensions in Swift

2016-09-07 Thread Quincey Morris
On Sep 6, 2016, at 23:26 , Gerriet M. Denkmann wrote: > > Anything to be done here? Or should I just forget about protocol extensions? There’s nothing really wrong here, it’s just that it doesn’t work like you think. There is no *inheritance* of protocol default

Multiple Inheritance via protocol extensions in Swift

2016-09-07 Thread Gerriet M. Denkmann
Trying to eliminate code duplication I tried to use protocol extensions. But I ran into a rather grave problem. This probably is “working as documented”. But it surely it is not working like I hoped it would. Here is a Playground example: protocol Number { func aFunction() -> Int }

Re: Security-scoped bookmarks, what's going on?

2016-09-07 Thread Quincey Morris
On Sep 6, 2016, at 22:44 , Graham Cox wrote: > > I still get the console messages: > > 2016-09-07 15:34:53.684 MyApp[9226:1630740] CFStringRef > __CFPasteboardIssueSandboxExtensionForPath(CFStringRef) : sandbox extension > creation failed: client lacks entitlements?