Re: Get file argument

2016-09-04 Thread Jean-Daniel Dupas
> Le 4 sept. 2016 à 20:48, Jens Alfke a écrit : > > >> On Sep 4, 2016, at 4:56 AM, Andreas Falkenhahn >> wrote: >> >> Is there also a way to get the file argument without having an NSApp, >> i.e. can my program somehow obtain the file argument *before* creating >> the NSApp object or is that

Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?

2016-08-24 Thread Jean-Daniel Dupas
> Le 24 août 2016 à 19:33, Jean-Daniel Dupas a écrit : > >> >> Le 24 août 2016 à 18:50, David Duncan a écrit : >> >> >>> On Aug 24, 2016, at 1:23 AM, Jeff Szuhay wrote: >>> >>> I’m using a bunch of layers to draw images to,

Re: Core Graphics: Is it better to up-sample or down-sample images when drawing into a rect?

2016-08-24 Thread Jean-Daniel Dupas
> Le 24 août 2016 à 18:50, David Duncan a écrit : > > >> On Aug 24, 2016, at 1:23 AM, Jeff Szuhay wrote: >> >> I’m using a bunch of layers to draw images to, compose them, and then draw >> into a viewRect >> with >> >> CGContextDrawLayerInRect( viewContext, viewRect, myLayer); >> >>

Re: Class is implemented in both

2016-08-15 Thread Jean-Daniel Dupas
> Le 15 août 2016 à 18:02, Jens Alfke a écrit : > > >> On Aug 15, 2016, at 11:34 AM, Jean-Daniel Dupas > <mailto:mail...@xenonium.com>> wrote: >> >> No, You can have only one PCH per project. That said, you can define a >> second one that include

Re: Class is implemented in both

2016-08-15 Thread Jean-Daniel Dupas
> Le 15 août 2016 à 15:27, Trygve Inda a écrit : > >> >>> On Aug 15, 2016, at 3:41 AM, Stephane Sudre wrote: >>> >>> . you could redefine the class name in the .pch of one project. >> >> +1 — I’ve had to do this before, and it works fine. Just add >> #define MyDisplayManager MyDisplayManager

Re: undomanger performance

2016-05-01 Thread Jean-Daniel Dupas
> Le 1 mai 2016 à 01:42, Quincey Morris a > écrit : > > On Apr 30, 2016, at 12:49 , Jean-Daniel Dupas <mailto:mail...@xenonium.com>> wrote: >> >> Maybe registering the changes is not executed immediately but deferred until >> the end of the current

Re: undomanger performance

2016-04-30 Thread Jean-Daniel Dupas
Just my 2 cents. Maybe registering the changes is not executed immediately but deferred until the end of the current event loop cycle, so the undo manager can group them into a single operation. In such case, it would mean that what you think is the undo registration is just a call to schedul

Re: Value of the MAC_OS_X_VERSION_MIN_REQUIRED macro

2016-02-20 Thread Jean-Daniel Dupas
It is unsafe to use availability conditional in headers. You can’t guarantee that the framework client will has the same settings that what was used to compile the framework. That said, if you want to use weak when compiling for ARC and assign otherwise, you can just use #if __has_feature(objc_a

Re: Can an NSArray ever have a count of -1?

2016-02-20 Thread Jean-Daniel Dupas
> Le 20 févr. 2016 à 07:28, Quincey Morris > a écrit : > > On Feb 19, 2016, at 22:14 , Gerriet M. Denkmann wrote: >> >> Is there (yet) a Swift version of ‘[NSString stringWithFormat: “%08lx”, >> (someCast) someValue]’ ? > > No, and yes, and no, and yes. > > There is currently AFAIK no such

Re: Can an NSArray ever have a count of -1?

2016-02-19 Thread Jean-Daniel Dupas
> Le 19 févr. 2016 à 22:29, Jens Alfke a écrit : > > >> On Feb 19, 2016, at 1:17 PM, Jim Adams wrote: >> >> SLogInfo(@"Starting csi %ld count %d", csi, sortedEvents.count); >> >> In the console I see: >> INFO: Starting csi -1 count -1 >> The very next line crashes when the sortedEv

Re: PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-11 Thread Jean-Daniel Dupas
> Le 11 févr. 2016 à 02:16, Ben Kennedy a écrit : > >> On 10 Feb 2016, at 5:00 pm, Gary L. Wade >> wrote: >> >> You've made my point. None of my friends would even bother with looking at >> the certificate for his site (assuming that's his site from his email >> address) and move on. At wor

Re: PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-10 Thread Jean-Daniel Dupas
> Le 10 févr. 2016 à 05:48, Trygve Inda a écrit : > >> If your hosting provider still charges an arm and a leg for SSL, switch. > > I need SSL for multiple subdomains. My host (Pair Networks) charges $449/yr > for such a certificate. That seems really expensive. What are others paying > for thi

Re: PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-09 Thread Jean-Daniel Dupas
OK. I did watch the POC and it appears this is not in the update process, but in the check for update that the attack occurs. > Le 9 févr. 2016 à 23:27, Jean-Daniel Dupas a écrit : > > I agree. I can’t see how that can work with a properly configured Sparkle, > that is an App

Re: PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-09 Thread Jean-Daniel Dupas
I agree. I can’t see how that can work with a properly configured Sparkle, that is an App that accepts only properly signed update. > Le 9 févr. 2016 à 23:22, Graham Cox a écrit : > > Thanks for the heads-up Jens. > > Is it enough to change the SUFeedURL to https (if your server supports it,

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Jean-Daniel Dupas
Maybe an issue cause you use __weak reference which zeroed for some reason. Can you try to use __unsafe_unretained instead and see what happen ? > Le 5 févr. 2016 à 14:46, Dave a écrit : > > >> On 5 Feb 2016, at 13:34, Jean-Daniel Dupas wrote: >> >>

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Jean-Daniel Dupas
And obviously, you also add - encodeWithCoder: and -initWithCoder: methods in your custom classes. > Le 5 févr. 2016 à 14:33, Jean-Daniel Dupas a écrit : > > That is your need, not your problem. > > To archive an object graph (cyclic or not), you just do [

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Jean-Daniel Dupas
- > "Archive/Unarchive Problem/Question?”. > > Basically I need to save/restore a Network of Custom Objects….. > > All the Best > Dave > >> On 5 Feb 2016, at 13:18, Jean-Daniel Dupas wrote: >> >> You don’t tell use what is your problem. You can pe

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Jean-Daniel Dupas
You don’t tell use what is your problem. You can perfectly encode any structure using Keyed archivers (whether there is cycles and backlinks). > Le 5 févr. 2016 à 14:13, Dave a écrit : > > Hi, > > I’m having problems with Back Links when Archiving/Unarchiving an Object. I > found the text bel

Re: View-based NSTableView and ending editing with "return"

2016-02-03 Thread Jean-Daniel Dupas
> Le 24 janv. 2016 à 09:51, Arved von Brasch a écrit : > > Hello list, > > After putting it off for too long, I’m migrating to view-based NSTableViews. > I’ve worked through most of the conversion problems I’ve had, and am > generally pretty happy. There is, however, one problem I haven’t b

Re: The joys of people using valueForKey to get objects out of a dictionary.

2015-11-10 Thread Jean-Daniel Dupas
> Le 10 nov. 2015 à 19:52, Alex Zavatone a écrit : > > > On Nov 10, 2015, at 12:35 PM, Greg Weston wrote: > >> >> >>> It's been about 4 or 5 years since I made this mistake but I've just seen a >>> massive swath of code where every access of a dictionary object is using >>> valueForKey ins

Re: Identifying a specific Mac model

2015-09-14 Thread Jean-Daniel Dupas
> Le 14 sept. 2015 à 15:53, John Daniel a > écrit : > > Thanks for the responses. Unfortunately, Apple is way ahead of all of us. > > The “Model Identifier” (MacBook8,1 et al.) is not sufficient to identify a > particular model. It only identifies general families of models. All you have > t

Re: Identifying a specific Mac model

2015-09-14 Thread Jean-Daniel Dupas
> Le 14 sept. 2015 à 12:16, sqwarqDev a écrit : > > > On 14 Sep 2015, at 01:09, John Daniel wrote: > >> >> MacBook8,1 covers all colours of the new MacBook. >> I am trying to differentiate the silver, from the space grey, from the gold. > > Since the machines are physically identical save t

Re: API to determine status of System Integrity Protection?

2015-09-14 Thread Jean-Daniel Dupas
> Le 14 sept. 2015 à 01:33, Ed Wynne a écrit : > > > On Sep 13, 2015, at 5:47 PM, Stephane Sudre wrote: > That document doesn't mention an API… Hence, since that is the current documentation, my conclusion : “Don’t think so”. >>> There is an API. Much like with sandboxing it jus

Re: NSManagedObject, NSString property retain vs copy

2015-07-31 Thread Jean-Daniel Dupas
> Le 30 juil. 2015 à 18:26, Fritz Anderson a écrit : > > On 30 Jul 2015, at 11:03 AM, Trygve Inda wrote: > >> It seems Apple is using retain rather than copy for NSString properties in >> an NSManagedObject subclass. >> >> I was always under the impression that copy should be used for NSStrin

Re: Unique ID for a Window?

2015-07-29 Thread Jean-Daniel Dupas
> Le 29 juil. 2015 à 12:25, Dave a écrit : > > Hi, > > For reasons that are too complex to go in to, I need to somehow create a > Unique ID that is valid for the life of a Window. The Window I am trying to > identify is not owned by my App (think Screen Dump, like “Grab”). > > I ran this co

Re: Obj-c to Swift conversion question

2015-07-28 Thread Jean-Daniel Dupas
> Le 28 juil. 2015 à 16:03, Eric E. Dolecki a écrit : > > The more I stretch to Swift goals, the more I learn. However I've come upon > a little thing where I am translating code into Swift and quickly stumbled. > > *Obj-C:* > NSValue *keyboardEndFrameValue = [[notification userInfo] > objectFo

Re: Swift and parameter names

2015-07-01 Thread Jean-Daniel Dupas
> Le 30 juin 2015 à 23:46, Quincey Morris > a écrit : > > On Jun 29, 2015, at 15:42 , Rick Mann wrote: >> >> Here's an example (and this is what I frequently encounter) where requiring >> parameter names adds nothing but clutter: >> >> let config = WKWebViewConfiguration() >> self.webVi

Re: Subclassing a Subclass of SBApplication

2015-06-30 Thread Jean-Daniel Dupas
Using class extension is probably a safe way to extends such classes. @interface SXPhotoshopApplication (MyExtension) - (void)myWrapper; @end > Le 29 juin 2015 à 13:54, Dave a écrit : > > Hi, > > I’m using the Scripting Bridge, and I was wondering if it ok to subclass > SBXXX classes. Basi

Re: Scripting Bridge Questions

2015-06-25 Thread Jean-Daniel Dupas
> Le 25 juin 2015 à 15:57, Dave a écrit : > > >> On 25 Jun 2015, at 14:48, Bill Cheeseman wrote: >> >> >>> On Jun 25, 2015, at 9:13 AM, Dave wrote: >>> >>> I get this error: >>> >>> sdp: enumerator of enumeration "e183": missing required "name" attribute. >> >> >> Can you generate the s

Re: Scripting Bridge Questions

2015-06-25 Thread Jean-Daniel Dupas
> Le 25 juin 2015 à 15:13, Dave a écrit : > > >> On 25 Jun 2015, at 13:33, Bill Cheeseman wrote: >> >> >>> On Jun 25, 2015, at 8:09 AM, Dave wrote: >>> >>> That’s the problem, “sdef" and/or “sdp" barf when I try to generate the >>> header file and without the header file you are pretty mu

Re: Using CFSTR() with const char * variable

2015-06-07 Thread Jean-Daniel Dupas
That’s not going to work. __builtin___CFStringMakeConstantString is a special compiler function that requires a constant string to work in the first place, as it tells the compiler to generate CFString literal. I doubt the compiler will accept anything else as parameter. > Le 7 juin 2015 à 03

Re: Looking at self = [super init].

2015-05-29 Thread Jean-Daniel Dupas
> Le 29 mai 2015 à 19:22, Alex Zavatone a écrit : > > Was just looking at good old object initialization and came across a stupid > idea. > > For most object initialization, we do this: > > - (id)init { >if (self = [super init]) { >// Set up stuff here. >// this could get

Re: Looking at self = [super init].

2015-05-29 Thread Jean-Daniel Dupas
> Le 29 mai 2015 à 19:22, Alex Zavatone a écrit : > > Was just looking at good old object initialization and came across a stupid > idea. > > For most object initialization, we do this: > > - (id)init { >if (self = [super init]) { >// Set up stuff here. >// this could get

Re: WTF is happening?

2014-12-15 Thread Jean-Daniel Dupas
> Le 15 déc. 2014 à 21:36, Greg Parker a écrit : > > >> On Dec 15, 2014, at 11:02 AM, Jean-Daniel Dupas wrote: >> >>> Le 15 déc. 2014 à 19:45, Fritz Anderson a écrit : >>> >>> - As is typical of ObjC plugins, the classes are packaged i

Re: WTF is happening?

2014-12-15 Thread Jean-Daniel Dupas
> Le 15 déc. 2014 à 19:45, Fritz Anderson a écrit : > > I can be dense. Do I understand correctly that > > - You have an application that ideally should run continually. > > - It accepts plugins that provide one or more classes. > > - Those classes must at least observe a protocol; otherwise

Re: WTF is happening?

2014-12-15 Thread Jean-Daniel Dupas
bool isSubclass(Class cls, Class superclass) { if (class_respondsToSelector(object_getClass(cls), @selector(isSubclassOfClass:))) { return [cls isSubclassOfClass:superclass]; } } > Le 15 déc. 2014 à 16:49, Maxthon Chan a écrit : > > But I still need some way to t

Re: WTF is happening?

2014-12-15 Thread Jean-Daniel Dupas
> Le 15 déc. 2014 à 13:31, Uli Kusterer a écrit : > > On 15 Dec 2014, at 12:42, Jean-Daniel Dupas wrote: >> I found only 5 classes that does not responds to isProxy and they are all >> internal classes, so real code will never have to deal with instances of >> su

Re: WTF is happening?

2014-12-15 Thread Jean-Daniel Dupas
I found only 5 classes that does not responds to isProxy and they are all internal classes, so real code will never have to deal with instances of such classes. And all classes prefixed by « OS_ » inherits NSObject and responds to isProxy. I run the experiment for myself and do not doubt the r

Re: WTF is happening?

2014-12-13 Thread Jean-Daniel Dupas
The Object class is not used anywhere is OS X. It is deprecated and should have been removed from the runtime long time ago. The OS X kernel does not even include obj runtime, so it can’t possibly use the Object class. Mach port are integer that represent kernel object and not classes. The ro

Re: How does the Swift Darwin module work?

2014-10-18 Thread Jean-Daniel Dupas
AFAIK, variadic C functions are not (yet) callable from swift code. > Le 18 oct. 2014 à 20:37, Rick Mann a écrit : > > I need access to fcntl, so I thought I'd do what Apple does with Darwin. But > I don't actually see how to do that. They create Darwin.stdio.fopen(), for > example. But then

Re: Why not use path-based API? (was: Loading image resources)

2014-09-14 Thread Jean-Daniel Dupas
Le 14 sept. 2014 à 10:23, Quincey Morris a écrit : > On Sep 14, 2014, at 00:57 , Aandi Inston wrote: > >> Why? Really, why? Certainly there are APIs where we have to use URL's and >> we have to convert the path into a URL, but where a non-deprecated >> path-based URL exists, what current or f

Re: What is the modern Cocoa way to send an Apple Event to yourself?

2014-08-22 Thread Jean-Daniel Dupas
Le 22 août 2014 à 07:24, Daryle Walker a écrit : > I changed my app from implementing -application:openFile: to > -application:openFiles: in my application delegate. Then, I noticed that my > Open File menu command directly calls my window creation function, and I > decided to change the acti

Re: Translating to Swift

2014-08-14 Thread Jean-Daniel Dupas
the pointer to be changed after initialization. I don't remember if static class variable are supported yet, but if they are, you can also use one instead of a global. Le 14 août 2014 à 20:44, Gerriet M. Denkmann a écrit : > > > On 13 Aug 2014, at 17:35, Jean-Daniel Dupas

Re: Translating to Swift

2014-08-13 Thread Jean-Daniel Dupas
At global scope var sharedThing : Thing = Thing(); Le 13 août 2014 à 12:30, Gerriet M. Denkmann a écrit : > > How could I translate this to Swift? > > + (Thing *)sharedThing > { > static Thing *commonThing; > static dispatch_once_t justOnce; > dispatch_once( &justOnce, ^voi

Re: Common Date between Swift and ObjC

2014-08-12 Thread Jean-Daniel Dupas
You can use an enum. The compiler treats them as constant and they are available both in Obj-C and Swift. Le 12 août 2014 à 20:04, Paul Scott a écrit : > Except the compiler cannot treat them as constants for optimization. > > Paul > >> On Aug 12, 2014, at 10:57 AM, Gerriet M. Denkmann >> w

Re: app icon for Launchpad

2014-06-17 Thread Jean-Daniel Dupas
That's probably a Launchpad icon caching issue. I don't know where it used to cache icons though. Le 17 juin 2014 à 05:35, Roland King a écrit : > My OSX app has an icon. It shows in the dock when active, it shows on > Alt-Tab, it shows in the Applications folder, however in Launchpad I get th

Re: Xcode 5 & Obj-C++

2014-01-30 Thread Jean-Daniel Dupas
Le 30 janv. 2014 à 12:49, jonat...@mugginsoft.com a écrit : > > On 30 Jan 2014, at 00:42, Jens Alfke wrote: > >> >> Anyone exposing a C++ API in a dynamic library is nuts, IMHO. > > What is it that makes C++ so unsuited to code sharing? We're not talking about code sharing, we are talking

Re: Can CFUUIDCreateString() return lowercase characters?

2014-01-21 Thread Jean-Daniel Dupas
According to the current CF sources, CFUUIDCreateString() returns an uppercase string. But if I really want to know what I get, I would rather use the libuuid functions provided by the system: uuid_unparse_lower() and uuid_unparse_upper(). See man uuid for details. Le 21 janv. 2014 à 11:21,

Re: RSA and libcrypto

2014-01-14 Thread Jean-Daniel Dupas
Le 14 janv. 2014 à 18:20, Jens Alfke a écrit : > > On Jan 14, 2014, at 1:19 AM, jonat...@mugginsoft.com wrote: > >> As Jens comments the security APIs are ridiculously opaque. >> Perhaps this is seen as a necessity in the serious world of crypto - perhaps >> it is just hard to avoid. However

Re: libcrypto linking problem in Leopard

2014-01-03 Thread Jean-Daniel Dupas
Le 3 janv. 2014 à 08:15, Appa Rao Mulpuri a écrit : > Hi List, > > I am using Mac OS X 10.8 SDK for the development and deployment target set to > Mac OS 10.5. I am using libcrypto dylib in my code base, application is > working fine in all the OS, except in Leopard. Application is failing to

Re: Preferences caching?

2013-11-28 Thread Jean-Daniel Dupas
Le 28 nov. 2013 à 12:05, Bill Cheeseman a écrit : > > On Nov 27, 2013, at 7:14 PM, Shane Stanley wrote: > >> On 28 Nov 2013, at 7:53 AM, Graham Cox wrote: >> >>> I guess if/when it crops up again we’ll just have to navigate the >>> unfortunate user through the command line. >> >> Or write

Re: Sending a message to a Toll free bridge

2013-11-25 Thread Jean-Daniel Dupas
Le 25 nov. 2013 à 10:23, Gerriet M. Denkmann a écrit : > The documentation states: "CFArray is “toll-free bridged” with its Cocoa > Foundation counterpart, NSArray. This means that the Core Foundation type is > interchangeable in function or method calls with the bridged Foundation > object.

Re: waitUntilDone: parameter when performing selector on main thread

2013-11-12 Thread Jean-Daniel Dupas
Le 12 nov. 2013 à 17:45, Graham Cox a écrit : > > On 12 Nov 2013, at 4:12 pm, Jean-Daniel Dupas wrote: > >> My rule is simply to never pass NO > > > Did you mean YES? (i.e. always pass NO). Others seem to be saying the > opposite. > My bad, Of course,

Re: MP4 video playback on Mavericks - Where's a good place to start?

2013-11-12 Thread Jean-Daniel Dupas
Le 12 nov. 2013 à 17:01, Bryan Vines a écrit : > Good morning all, > > I'm toying with a project to play short video, stored in my app's bundle. I > had thought to use QTKit and a QTMovieView, but I can't locate the > QTMovieView in Interface Builder. > > Apple has a QTKit tutorial, "Creatin

Re: waitUntilDone: parameter when performing selector on main thread

2013-11-12 Thread Jean-Daniel Dupas
Le 12 nov. 2013 à 15:26, Graham Cox a écrit : > I’m just thinking about the use of > -performSelectorOnMainThread:withObject:waitUntilDone:, and what is the best > way to think about the waitUntilDone parameter. The situation is updating a > UI from another thread, using this to punt the upda

Re: Speed of Arc on iPhone

2013-11-01 Thread Jean-Daniel Dupas
Le 1 nov. 2013 à 08:38, Gerriet M. Denkmann a écrit : > Messing with an iPhone app (iOS 7.0.3) Release build on Xcode Version 5.0.1 > (5A2053) I noticed that by switching Arc off in two crucial files the speed > of some operation almost doubled. > > So: are there any rules of thumb what to do

Re: C functions

2013-10-19 Thread Jean-Daniel Dupas
Le 19 oct. 2013 à 15:01, Uli Kusterer a écrit : > On 19 Oct 2013, at 01:17, Shane Stanley wrote: >> On 19 Oct 2013, at 3:15 AM, Uli Kusterer >> wrote: >> >>> this is what you'd do if you wanted to make e.g. CoreFoundation APIs >>> accessible to a scripting language >> >> That's along the l

Re: How test whether Mac app is running in Xcode?

2013-10-15 Thread Jean-Daniel Dupas
Le 15 oct. 2013 à 18:50, Jens Alfke a écrit : > > On Oct 15, 2013, at 9:10 AM, Bill Cheeseman wrote: > >> I can't talk about the "why?" part of my question in public because it's an >> issue unique to Mavericks. Let me just say that a certain common category of >> applications is going to w

Re: RunLoop in Helper Tool

2013-09-15 Thread Jean-Daniel Dupas
Le 15 sept. 2013 à 16:23, Gerriet M. Denkmann a écrit : > > On 15 Sep 2013, at 16:42, Jean-Daniel Dupas wrote: > >> XPC is based on GCD. There is chance that your request handling occurs in a >> GCD thread and not on the main thread. > > Correct. NSTh

Re: RunLoop in Helper Tool

2013-09-15 Thread Jean-Daniel Dupas
XPC is based on GCD. There is chance that your request handling occurs in a GCD thread and not on the main thread. [NSRunLoop currentRunLoop] returns the current thread run loop. If you are not on the main thread, it will not work. Try that instead: CFRunLoopStop(CFRunLoopGetMain()); Le 15 se

Re: 64-bit iOS

2013-09-14 Thread Jean-Daniel Dupas
You should never be using int in the first place except for API that are already using int, like many libc functions return type. Use the types that fit the API you are using, and if you have to write some API, use types from stdint.h that fit your need. Le 14 sept. 2013 à 16:37, vipgs99 a écr

Re: ARC vs Manual Reference Counting

2013-09-11 Thread Jean-Daniel Dupas
sept. 2013 à 17:15, Sean Roehnelt a écrit : > ARC is compile time, not runtime, so I don't see how it could… > >> On Sep 9, 2013, at 1:18 AM, Jean-Daniel Dupas wrote: >> >> And does the profiler explicitly shows that ARC runtime code is

Re: 64-bit iOS

2013-09-11 Thread Jean-Daniel Dupas
Le 11 sept. 2013 à 11:31, Vincent Habchi a écrit : > Mostly, this is not going to change anything. You will see your code size > increase, because unless you use PIC, you’ll have to store 64-bit addresses > instead of 32. There will be more cache misses as your memory space becomes > sparse.

Re: ARC vs Manual Reference Counting

2013-09-11 Thread Jean-Daniel Dupas
Le 11 sept. 2013 à 09:03, Marcel Weiher a écrit : > Hi John! > > On Sep 10, 2013, at 19:26 , John McCall wrote: > >> On Sep 9, 2013, at 4:15 AM, Marcel Weiher wrote: >>> [Optimizations in ARC are there to mitigate pessimizations] >> >> For what it’s worth, the autorelease optimization was p

Re: 64-bit iOS

2013-09-10 Thread Jean-Daniel Dupas
; > On Sep 10, 2013, at 5:47 PM, Tom Davie wrote: > >> >> On 10 Sep 2013, at 23:30, Jean-Daniel Dupas wrote: >> >>> >>> For ARM, 64 bit matters because the instruction set has been updated to >>> provider better performances. >>> &

Re: 64-bit iOS

2013-09-10 Thread Jean-Daniel Dupas
For ARM, 64 bit matters because the instruction set has been updated to provider better performances. I just hope the performance boost provided by this architecture change will be enough to balance the slow-down due to the increase of instruction and pointer size. Le 10 sept. 2013 à 22:01, A

Re: 30x faster JSON date parsing

2013-09-09 Thread Jean-Daniel Dupas
Le 9 sept. 2013 à 18:11, Jens Alfke a écrit : > Parsing dates from strings can be surprisingly expensive — more than once > I’ve seen it show up as the primary hot-spot in code that reads files or > parses network data. NSDateFormatter is very flexible, but you pay for that > in speed. If you

Re: ARC vs Manual Reference Counting

2013-09-09 Thread Jean-Daniel Dupas
Le 9 sept. 2013 à 11:54, Tom Davie a écrit : > > On 9 Sep 2013, at 11:49, Jean-Daniel Dupas wrote: > >> >> Le 9 sept. 2013 à 11:33, Tom Davie a écrit : >> >>> >>> On 9 Sep 2013, at 10:18, Jean-Daniel Dupas wrote: >>>

Re: ARC vs Manual Reference Counting

2013-09-09 Thread Jean-Daniel Dupas
Le 9 sept. 2013 à 11:33, Tom Davie a écrit : > > On 9 Sep 2013, at 10:18, Jean-Daniel Dupas wrote: > >> >> Le 9 sept. 2013 à 09:58, Tom Davie a écrit : >> >>> >>> On 9 Sep 2013, at 09:44, Kyle Sluder wrote: >>> >>>>

Re: ARC vs Manual Reference Counting

2013-09-09 Thread Jean-Daniel Dupas
Le 9 sept. 2013 à 09:58, Tom Davie a écrit : > > On 9 Sep 2013, at 09:44, Kyle Sluder wrote: > >> Thirded. I thought I wouldn't like it. As soon as I didn't have to manage >> retains and releases of temporary objects, the discipline completely left my >> mind. Now whenever I go back to non-

Re: Unicode chars in string

2013-09-09 Thread Jean-Daniel Dupas
Le 9 sept. 2013 à 09:54, Tom Davie a écrit : > > On 9 Sep 2013, at 09:13, Damien Cooke wrote: > >> Hi all, >> I am pulling my hair out here trying to replace the unicode (r) symbol with >> \\00ea in a string. Is there a way of doing this as the NSString is a >> unicode String so it is inte

Re: NSValue valueWithBytes:objCType:

2013-08-24 Thread Jean-Daniel Dupas
Le 24 août 2013 à 22:09, Andreas Grosam a écrit : > What's the purpose of NSValue's class method > > + (NSValue *)valueWithBytes:(const void *)value objCType:(const char *)type; ? > > It seems, NSValue will simply memcpy the content of value, and "somehow" > determine the size in bytes from

Re: repeating timer with "run now"

2013-08-22 Thread Jean-Daniel Dupas
Le 22 août 2013 à 16:08, Torsten Curdt a écrit : >> Why not just keeping a reference on your scheduled block and simply call >> dispatch_async when you want to execute it immediately ? > > It would not re-schedule the timer. So the block could potentially be > run twice without much of the des

Re: repeating timer with "run now"

2013-08-22 Thread Jean-Daniel Dupas
Le 22 août 2013 à 15:36, Torsten Curdt a écrit : > I have some piece of code that I want to run every x seconds but I > also want to be able to trigger a "run now" that will reset the > upcoming cycle. > > I think I would know plenty of ways to implement this (ranging from > simple NSTimer

Re: predefined macro iOS vs OS X

2013-08-17 Thread Jean-Daniel Dupas
Le 17 août 2013 à 17:55, Marcel Weiher a écrit : > > On Aug 16, 2013, at 19:04 , Kyle Sluder wrote: > >> On Aug 16, 2013, at 12:41 PM, "Gerriet M. Denkmann" >> wrote: >>> On 16 Aug 2013, at 22:59, Kyle Sluder wrote: Xcode does know this. But if you're building for 32-bit OS X, it will

Re: Major Xcode irritation

2013-08-12 Thread Jean-Daniel Dupas
Le 12 août 2013 à 22:22, Kyle Sluder a écrit : > On Mon, Aug 12, 2013, at 01:11 PM, Jens Alfke wrote: >> >> On Aug 12, 2013, at 12:31 PM, Graham Cox wrote: >> >>> XCode then refuses to build because the header file mod date no longer >>> matches what was used when the precompiled headers wer

Re: Mixing Obj-C and C "methods"

2013-08-07 Thread Jean-Daniel Dupas
Le 7 août 2013 à 18:34, Andy Lee a écrit : > On Aug 7, 2013, at 12:04 PM, Jean-Daniel Dupas wrote: >> If you intend to use it from multiple threads, so use a tls. >> >> __thread id myCallbackHandler; > > I did not know about __thread, thanks for this. By usin

Re: Mixing Obj-C and C "methods"

2013-08-07 Thread Jean-Daniel Dupas
Le 7 août 2013 à 17:32, Andy Lee a écrit : > On Aug 7, 2013, at 3:47 AM, Jean-Daniel Dupas wrote: >> Instead of trying to use complex approach to hide the fact you need a >> global, just use one, and don't try to reuse the existing one for things >> th

Re: Mixing Obj-C and C "methods"

2013-08-07 Thread Jean-Daniel Dupas
While all theses methods may look valid, what not simply use a static variable declared in your file ? Instead of trying to use complex approach to hide the fact you need a global, just use one, and don't try to reuse the existing one for things there are not designed to do. static id myCallb

Re: Search options

2013-07-31 Thread Jean-Daniel Dupas
Le 31 juil. 2013 à 18:52, Jerry Krinock a écrit : > > On 2013 Jul 31, at 08:45, dangerwillrobinsondan...@gmail.com wrote: > >> what are the recommended search facilities for searching for things not >> indexed by Spotlight? Or am I limited to task wrappers or NSFileManager >> directory enum

Re: Mixing Obj-C and C "methods"

2013-07-30 Thread Jean-Daniel Dupas
Le 30 juil. 2013 à 17:25, Scott Ribe a écrit : > On Jul 30, 2013, at 9:08 AM, Andy Lee wrote: > >> I think it's subject to the same criticisms as *any* direct access to ivars, >> although I agree it feels sketchier when done in plain C for some reason. > > Yes. Because what is the point of p

Re: Mixing Obj-C and C "methods"

2013-07-30 Thread Jean-Daniel Dupas
Le 30 juil. 2013 à 10:27, Vincent Habchi a écrit : > Rick, > > thanks for answering, because what I found on the Internet seems > contradictory. Some say that if the C function is placed inside the > implementation block, then it can access attributes as if it were a true > Obj-C method; som

Re: The cost of using objects rather than plain C variables

2013-07-12 Thread Jean-Daniel Dupas
Le 12 juil. 2013 à 08:41, Vincent Habchi a écrit : > Hi! > > Sorry for this late answer, I was a bit swamped lately. > >> NSData wouldn't let you, but NSMutableData would, with methods like >> appendBytes:length:, appendData:, increaseLengthBy:, etc. The underlying >> buffer might have to m

Re: NSNotFound signed???

2013-06-12 Thread Jean-Daniel Dupas
Le 12 juin 2013 à 10:14, Oleg Krupnov a écrit : >> there isn't enough address space to create a NSArray containing even >> NSIntegerMax pointers. > > I knew someone will say this. Who needs more than 640 KB RAM after > all? :) © Bill Gates > This has nothing to do with the amount of availabl

Re: NSURLConnection and 404

2013-06-09 Thread Jean-Daniel Dupas
Le 9 juin 2013 à 11:35, Gerriet M. Denkmann a écrit : > This works fine, but blocks my for 1 sec on a good day - who know how long if > the net is slow: > > url = something/which/might/exist/or/not.gif > data = [ NSData dataWithContentsOfURL: url options: mask error: &outError ]; > > So I am

Re: NSMapTable with C strings as keys

2013-05-30 Thread Jean-Daniel Dupas
Le 30 mai 2013 à 08:35, Eric Wing a écrit : > On 5/29/13, Jens Alfke wrote: >> >> On May 29, 2013, at 8:29 PM, Eric Wing wrote: >> >>> CFDictionary I did not formally do in the benchmark, but I did run on >>> the side for curiosity. I found that the C-string to CFString >>> conversion ended

Re: NSMapTable with C strings as keys

2013-05-29 Thread Jean-Daniel Dupas
Le 29 mai 2013 à 06:14, Oleg Krupnov a écrit : >> Why not just create NSString wrappers? By using the >> -initWithBytesNoCopy:length:encoding:freeWhenDone: method you can avoid it >> copying the actual C string characters, it literally just becomes a thin >> wrapper. > > In my case it's more

Re: NSMapTable with C strings as keys

2013-05-29 Thread Jean-Daniel Dupas
Le 29 mai 2013 à 00:46, Graham Cox a écrit : > > On 28/05/2013, at 3:46 PM, Oleg Krupnov wrote: > >> I'd like to have a dictionary using C strings as keys (because I >> already have const char* strings and would like to spare on creating >> NSString wrappers) > > > For the sake of avoiding

Re: NSMapTable with C strings as keys

2013-05-28 Thread Jean-Daniel Dupas
Le 28 mai 2013 à 08:25, Oleg Krupnov a écrit : > Hi Jens, > > I guess you may be right. But… two questions in this regard: > > 1. I thought that "isEqual" method is alternative to "hash" method, > because searching by key and searching by hash are two mutually > exclusive methods of looking up

Re: NSCAssert in OS X and iOS

2013-04-18 Thread Jean-Daniel Dupas
Le 18 avr. 2013 à 18:31, Jens Alfke a écrit : > > On Apr 18, 2013, at 12:14 AM, Rick Mann wrote: > >> I had an NSAssert with varargs in a C routing in a .mm file. It compiled >> fine in a Mac OS X app, but the same code in an iOS app bitches about too >> many arguments. Is that right? > >

Re: Number of chars

2013-03-21 Thread Jean-Daniel Dupas
Le 21 mars 2013 à 09:27, Luca Ciciriello a écrit : > Hi all. > I'm using in my iOS project some Objective-C++ modules. Here I have some > conversion from NSString to C++11 std::string. After this conversion I found > (correctly) in my std::string some 2-byte characters. > My question is: How

Re: Objective-C Question

2013-03-14 Thread Jean-Daniel Dupas
Le 14 mars 2013 à 11:12, Richard Heard a écrit : > Your logic is clearly flawed. This only seems to replace occurrences of $ > with the word DOLLAR. > > Also, if you are dealing with large strings, you could always use one of the > below idioms to reduce memory pressure. > > > @autoreleasep

Re: Another Gnarly Objective-C Question!

2013-03-13 Thread Jean-Daniel Dupas
Le 13 mars 2013 à 18:13, John McCall a écrit : > On Mar 13, 2013, at 2:13 AM, Jean-Daniel Dupas wrote: >> Le 13 mars 2013 à 01:55, Wim Lewis a écrit : >>> On 12 Mar 2013, at 2:08 AM, Graham Cox wrote: >>>> in a + method, [self class] === self. Once

Re: Another Gnarly Objective-C Question!

2013-03-13 Thread Jean-Daniel Dupas
Le 13 mars 2013 à 01:55, Wim Lewis a écrit : > > On 12 Mar 2013, at 2:08 AM, Graham Cox wrote: >> in a + method, [self class] === self. Once you've got that, you've got it. >> >> >> >> You're overthinking this. >> >> A class method is just an instance method of the class object. No magic at

Re: Objective-C Question

2013-03-12 Thread Jean-Daniel Dupas
Le 12 mars 2013 à 20:15, Dave a écrit : > > On 12 Mar 2013, at 18:50, Jens Alfke wrote: > >> >> On Mar 12, 2013, at 9:44 AM, John McCall wrote: >> >>> However, that wouldn't be an idiomatic implementation. The usual >>> expectation is that allocating methods, like +new methods, construct

Re: Fast user switching notifications

2013-03-12 Thread Jean-Daniel Dupas
Le 11 mars 2013 à 23:25, Jean Suisse a écrit : > Dear All, > > There may be several approaches to solve the issue I am about to describe, > either on the userland side or on the kernel side... or in-between, using a > daemon. > > Current situation > A bsd kernel extension communicates with a

Re: What is the meaning of id?

2013-02-18 Thread Jean-Daniel Dupas
http://www.catb.org/esr/faqs/smart-questions.html Le 18 févr. 2013 à 10:20, Christ Levesque a écrit : > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact

Re: LSOpenURLsWithRole failure

2012-12-11 Thread Jean-Daniel Dupas
Le 11 déc. 2012 à 18:12, Vojtěch Meluzín a écrit : > Hi, > > one of the customers reported that on his 10.8.2 our installer failed to > even run and in the terminal there was this message: > > LSOpenURLsWithRole() failed with error -10810 for the file > /Users/visa/Downloads/mxxx_7_05_setupmac/

Re: How to implement readonly property

2012-12-09 Thread Jean-Daniel Dupas
Le 9 déc. 2012 à 02:27, Richard Heard a écrit : > Greg, > > So, from what you are saying, either of these snippets should be valid, right? > >> +(id)sharedInstance{ >>static id _sharedInstance = nil; >> >> … >>OSMemoryBarrier(); >>return _sharedInstance; >> } OSMemoryBarrier

Re: Notification for if User changes Finder Label on File

2012-11-20 Thread Jean-Daniel Dupas
You can use the libdispatch to monitor file changes (using DISPATCH_SOURCE_TYPE_VNODE). You can also use a kqueue to look for change on a specific file. If you want a Cocoa wrapper, there is the well known UKKQueue class available on the net. Both solutions are far more efficient if you have t

  1   2   3   4   5   6   7   8   9   10   >