Re: Thoughts on Cocoa

2019-10-02 Thread John McCall via Cocoa-dev
On 2 Oct 2019, at 15:03, Jeff Evans via Cocoa-dev wrote: Here’s another small developer’s perspective: Practica Musica has been around since 1987 in one form or another (originally in 68000 assembler!). We’ve sold a lot of Macs for Apple. The upcoming version 7 is still C++ with Objective-C

Re: Questions regarding release

2019-09-26 Thread John McCall via Cocoa-dev
On 26 Sep 2019, at 12:47, Gabriel Zachmann via Cocoa-dev wrote: I don’t believe that’s entirely true. “make” methods return a +0 value. The issue in the below code to my eye is that you allocate a path with CGPathCreateWithRect (+1) but then don't release it. In that case, I am wondering:

Re: xCode troubles

2019-05-15 Thread John McCall
On 15 May 2019, at 11:40, Peter Hudson wrote: Hi John As things are now working ok again - the relevant files have been refreshed - there is probably little point in my sending you the project. If the problem occurs again, I’ll send the project over for you to have a look at. Okay, thanks.

Re: xCode troubles

2019-05-14 Thread John McCall
On 15 May 2019, at 0:35, Richard Charles wrote: On May 14, 2019, at 10:19 PM, John McCall wrote: It's unfixed because it's apparently very hard to reliably reproduce. If you have reliable steps for reproduction, we'd be very interested. Perhaps Peter Hudson could send you his

Re: xCode troubles

2019-05-14 Thread John McCall
On 15 May 2019, at 0:03, Ben Kennedy wrote: The phenomenon you're describing is a long-standing bug in Xcode that Apple does not seem interested in fixing. I finally filed it last November as rdar://46203599. It was closed as a duplicate of rdar://9706748 (!). (That's actually rather

Re: Is "-init" really needed?

2017-08-10 Thread John McCall
> On Aug 10, 2017, at 11:13 AM, Charles Srstka wrote: >> On Aug 10, 2017, at 9:44 AM, Alastair Houghton >> wrote: >> >> On 10 Aug 2017, at 15:24, Jeremy Hughes > > wrote:

Re: Who owns a child view controller?

2017-07-14 Thread John McCall
> On Jul 14, 2017, at 12:22 PM, Charles Srstka wrote: >> On Jul 14, 2017, at 10:09 AM, Jeremy Hughes >> wrote: >> >>> On 14 Jul 2017, at 14:40, Steve Christensen >> > wrote: >>> >>> On Jul 14,

Re: NSMutableData +dataWithLength: sets errno?

2017-03-14 Thread John McCall
> On Mar 14, 2017, at 7:00 PM, Carl Hoefs > wrote: > macOS 10.12.3, Xcode 8.2.1, ObjC > > I'm finding the following line to be problematic: > >NSMutableData *myData = [NSMutableData dataWithLength:80]; > > I assume this ends up calling calloc(3) to allocate

Re: didPrint selector not called

2016-12-16 Thread John McCall
> On Dec 16, 2016, at 11:33 AM, Jeremy Hughes <moon.rab...@virginmedia.com> > wrote: >> On 16 Dec 2016, at 19:29, John McCall <rjmcc...@apple.com> wrote: >> >>> On Dec 16, 2016, at 11:24 AM, Jeremy Hughes <moon.rab...@virginmedia.com> >>>

Re: didPrint selector not called

2016-12-16 Thread John McCall
> On Dec 16, 2016, at 11:24 AM, Jeremy Hughes > wrote: > Thanks for the link. > > I’ve looked at it, and I don’t think it applies in this case, because I’m not > actually overriding the document(_:didPrint:contextInfo:) method, just > providing it as a callback.

Re: didPrint selector not called

2016-12-16 Thread John McCall
> On Dec 16, 2016, at 8:45 AM, Jeremy Hughes > wrote: > Hi, > > I’m overriding printDocumentWithSettings in order to get a notification for > when printing has finished, but the didPrint selector is never called. > > This is the code: > > class func

Re: function signature specialization crashlog

2016-10-31 Thread John McCall
> On Oct 31, 2016, at 3:49 PM, Torsten Curdt wrote: > > > I have a real hard time understanding this iOS/Swift3 crashlog. > > This is an odd list to be posting this to. Crash logs are there for the > developers > of the crashing software. If you're interested in helping fix

Re: function signature specialization crashlog

2016-10-31 Thread John McCall
> On Oct 31, 2016, at 6:12 AM, Torsten Curdt wrote: > > I have a real hard time understanding this iOS/Swift3 crashlog. This is an odd list to be posting this to. Crash logs are there for the developers of the crashing software. If you're interested in helping fix the

Re: Problem about math library and the standard namespace of Apple Clang

2016-05-12 Thread John McCall
> On May 12, 2016, at 7:00 AM, 军其 胡 wrote: > Hi, all. > > My question is about the convention of the standard namespace in C++. > firstly, let's read the following classic example in C/C++: > > ,- > | #include > | #include > | > | double

Re: How to keep things alive in Arc?

2016-05-10 Thread John McCall
> On May 9, 2016, at 6:38 AM, gerti-cocoa...@bitart.com wrote: > This was recommended to me by folks "in the know": > > Thing *aThing = [ Thing new ]; > > ... > > (void)aThing; This is not guaranteed to keep aThing alive for its full scope. You should use the

Re: Receiver type for instance message is a forward declaration

2016-05-06 Thread John McCall
> On May 6, 2016, at 1:32 PM, Carl Hoefs wrote: > I'm building for iOS 9.3, and am using NSOperationQueue throughout. Once in a > while, NSOperationQueue -addOperation: throws an exception. I guess this is a > well-known bug going all the way back to 2008. I

Re: Converting to ARC and blocks

2016-05-02 Thread John McCall
> On May 2, 2016, at 11:30 AM, Steve Mills <sjmi...@mac.com> wrote: > > On May 02, 2016, at 12:58 PM, John McCall <rjmcc...@apple.com> wrote: > > > You don't have to declare something with __block just to use it in a block. > > __block specifically mean

Re: Converting to ARC and blocks

2016-05-02 Thread John McCall
> On May 2, 2016, at 10:38 AM, Steve Mills wrote: > I'm working on a project that's had to support older hardware/software until > now, so we can *finally* convert to ARC. Since it's been almost a year since > I've worked on anything that used ARC, I'm a little rusty on some of

Re: BOOL parameter passed as nil object

2016-04-19 Thread John McCall
> On Apr 19, 2016, at 1:20 PM, Alex Zavatone wrote: > On Apr 19, 2016, at 3:23 PM, Greg Parker wrote: > >> >>> On Apr 19, 2016, at 12:07 PM, Jens Alfke wrote: >>> On Apr 19, 2016, at 10:22 AM, Alex Zavatone wrote: I believe that

Re: Returning a string value from a c function to a Objective-C class method. Is there an approved approach?

2016-03-04 Thread John McCall
> On Mar 4, 2016, at 4:03 PM, Greg Parker wrote: > > >> On Mar 4, 2016, at 2:24 PM, Jonathan Mitchell wrote: >> >> Hi Alex >> >> Not sure if this will help at all as I am not 100% sure what you are doing. >> In my case, using Mono, I needed to track

Re: 32-bit / 64-bit roadmap

2016-01-21 Thread John McCall
> On Jan 21, 2016, at 1:57 PM, SevenBits wrote: >> On Jan 21, 2016, at 1:32 PM, Fritz Anderson wrote: >> >> On 21 Jan 2016, at 10:45 AM, Aandi Inston wrote: >>> >>> So far as I can see, all recent Mac OS systems are 64-bit on

Re: Assigning an element of a swift array to a userdata parameter triggers didSet

2015-11-18 Thread John McCall
> On Nov 18, 2015, at 11:12 AM, Quincey Morris > wrote: > On Nov 18, 2015, at 10:57 , Jens Alfke wrote: >> >> Doesn’t the pointer become invalid as soon as myElement goes out of scope? >> (There’s a reason that type is called

Re: New warning in Xcode 7

2015-10-13 Thread John McCall
> On Oct 13, 2015, at 3:24 PM, Graham Cox wrote: > In a piece of code I haven’t worked on in a while, I’m suddenly getting a new > warning which I’ve never seen before: > > “Multiple unsequenced modifications to ‘ix’” > > Code is: > > > ix = ++ix % guess.count; > >

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-21 Thread John McCall
On May 21, 2015, at 4:44 PM, Graham Cox graham@bigpond.com wrote: On 22 May 2015, at 3:02 am, Jens Alfke j...@mooseyard.com wrote: Now that I have a path forward and understand why things are what they are, this brings up the wonderful speed issue of how much slower is property access

Re: static analyzers says I'm leaking, I _think_ I'm not

2015-05-06 Thread John McCall
On May 6, 2015, at 1:57 PM, Michael David Crawford mdcrawf...@gmail.com wrote: I've had problems in the past where I failed to understand the Cocoa ownership conventions, I'm willing to grant that could be the case. I know for sure that the analyzer enforces the naming conventions, that

Re: copy and mutableCopy

2014-04-27 Thread John McCall
On Apr 27, 2014, at 2:00 AM, Dave d...@looktowindward.com wrote: A long time back, I remember reading something about the way in which copy and mutableCopy are implemented. I think basically it said that: someObject = [someOtherObject copy]; or someObject = [someOtherObject

Re: Good idea/bad idea?

2014-04-24 Thread John McCall
On Apr 24, 2014, at 9:53 AM, Alex Zavatone z...@mac.com wrote: What worried me was that I've never seen this used in Objective-C in this manner. I've always used the ? operator to color the backgrounds of cells with alternating row colors. It seemed like a stretch to actually use it to

Re: Good idea/bad idea?

2014-04-24 Thread John McCall
On Apr 24, 2014, at 8:48 AM, Scott Ribe scott_r...@elevated-dev.com wrote: On Apr 24, 2014, at 9:21 AM, Roland King r...@rols.org wrote: well not if it's actually x = (x) ?: @yo; Actually, that will work just fine. Personally, I'd leave off the extraneous (): x = x ?: @yo;

Re: Retain count in non ARC

2014-04-04 Thread John McCall
On Apr 3, 2014, at 8:22 PM, Varun Chandramohan varun.chandramo...@wontok.com wrote: Interestingly, the static code analysis find the call of retain as a leak. How do I address this issue? What is correct way to rewrite this code to make static analyser understand that I will be releasing the

Re: Multiple methods named 'compare:' found

2014-03-27 Thread John McCall
On Mar 27, 2014, at 10:40 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I have: id a,b; if (something) { a = @(43); b = some other NSNumber; } else { a = [ NSDate date]; b = some other NSDate; } if ( [ a compare: b] == NSOrderedDescending ) then ...

Re: ARC and autorelease pools

2014-02-16 Thread John McCall
On Feb 16, 2014, at 1:03 PM, Jens Alfke j...@mooseyard.com wrote: On Feb 16, 2014, at 10:22 AM, Kevin Meaney k...@yvs.eu.com wrote: I didn't say take them out. I said why do they need to return an autoreleased object. Why can't they just return an object like alloc init... does. Because

Re: Threaded drawing

2013-12-06 Thread John McCall
On Dec 6, 2013, at 9:24 AM, Seth Willits sli...@araelium.com wrote: On Dec 6, 2013, at 8:05 AM, dangerwillrobinsondan...@gmail.com wrote: On 6 Dec 2013, at 11:26 am, Graham Cox graham@bigpond.com wrote: NSBlockOperation* op = [NSBlockOperation blockOperationWithBlock:^

Re: ARC vs Manual Reference Counting

2013-09-13 Thread John McCall
On Sep 13, 2013, at 3:04 AM, Marcel Weiher marcel.wei...@gmail.com wrote: On Sep 11, 2013, at 10:38 , John McCall rjmcc...@apple.com wrote: [inline reference counts] Right. ARC doesn’t replace the benefit of having an inline reference count. I think if we could magically bless all

Re: ARC vs Manual Reference Counting

2013-09-13 Thread John McCall
On Sep 13, 2013, at 11:51 AM, Paul Scott psc...@skycoast.us wrote: The joys of a nice skewed profile. Ahhh…. :-) Of course, the ones you don’t notice, the flat profiles, are in some ways more insidious, as they drag everything down just a bit. Along with all the other things that drag

Re: ARC vs Manual Reference Counting

2013-09-11 Thread John McCall
On Sep 11, 2013, at 12:03 AM, Marcel Weiher marcel.wei...@gmail.com wrote: On Sep 10, 2013, at 19:26 , John McCall rjmcc...@apple.com wrote: On Sep 9, 2013, at 4:15 AM, Marcel Weiher marcel.wei...@gmail.com wrote: [Optimizations in ARC are there to mitigate pessimizations] For what it’s

Re: ARC vs Manual Reference Counting

2013-09-10 Thread John McCall
On Sep 9, 2013, at 4:15 AM, Marcel Weiher marcel.wei...@gmail.com wrote: On Sep 9, 2013, at 11:33 , Tom Davie tom.da...@gmail.com wrote: On 9 Sep 2013, at 10:18, Jean-Daniel Dupas devli...@shadowlab.org wrote: And does the profiler explicitly shows that ARC runtime code is the culprit ?

Re: IOS floating point performance

2013-08-08 Thread John McCall
On Aug 8, 2013, at 6:37 AM, Scott Ribe scott_r...@elevated-dev.com wrote: On Aug 8, 2013, at 6:37 AM, Roland King r...@rols.org wrote: shouldn't do that as long as one uses the correct functions, ie sinf() and cosf(). But */+- promote… If all the operands to an operator are floats, the

Re: IOS floating point performance

2013-08-08 Thread John McCall
numeric types; same for the other built-in operators. On Aug 8, 2013, at 11:19 AM, John McCall rjmcc...@apple.com wrote: If all the operands to an operator are floats, the operation occurs in float, and the type of the result will be float. Good god, I am old, and you two are making me feel

Re: Mixing Obj-C and C methods

2013-07-30 Thread John McCall
On Jul 30, 2013, at 8:54 AM, Vincent Habchi vi...@macports.org wrote: Apple's recommended alternative to having a struct contain an object is to use a class instead of a struct. You could create a MyCallbackInfo class with two properties: the query id and the pointer to self. You'd still

Re: static acting like __block in GCD singleton pattern

2013-07-01 Thread John McCall
On Jun 30, 2013, at 9:47 AM, Alex Zavatone z...@mac.com wrote: On Jun 29, 2013, at 12:20 PM, Matt Neuburg wrote: Yes, I looked at the spec and searched on the word static but I can't really understand what the spec is telling me. Am I the only one who thinks that this document has gotten

Re: error in using NSNumber's numberWithInt: method not flagged

2013-06-09 Thread John McCall
On Jun 9, 2013, at 1:32 PM, Kyle Sluder k...@ksluder.com wrote: On Jun 9, 2013, at 1:26 PM, Boyd Collier bcolli...@cox.net wrote: Quite by chance, I stumbled on to what seems to be an error that ought to be caught by the compiler but wasn't. Here's an example: NSNumber *testNumber =

Re: exc bad access when change the contentSize of popover

2013-03-22 Thread John McCall
On Mar 22, 2013, at 10:32 AM, Jens Alfke j...@mooseyard.com wrote: On Mar 21, 2013, at 8:47 AM, Peng Gu pan...@gmail.com wrote: 4. I click the button again, then the app hangs for about 10 seconds and the xcode throws EXC_BAD_ACCESS(code=2, address=0x7fff5f38), the caller is

Re: Another Gnarly Objective-C Question!

2013-03-13 Thread John McCall
On Mar 13, 2013, at 2:13 AM, Jean-Daniel Dupas devli...@shadowlab.org wrote: Le 13 mars 2013 à 01:55, Wim Lewis w...@omnigroup.com 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.

Re: Objective-C Question

2013-03-12 Thread John McCall
On Mar 12, 2013, at 12:31 AM, Dave d...@looktowindward.com wrote: On 11 Mar 2013, at 21:45, John McCall wrote: On Mar 11, 2013, at 2:02 PM, Dave d...@looktowindward.com wrote: On 11 Mar 2013, at 20:53, John McCall wrote: On Mar 11, 2013, at 1:33 PM, Dave d...@looktowindward.com wrote: On 11

Re: Objective-C Question

2013-03-11 Thread John McCall
On Mar 11, 2013, at 1:33 PM, Dave d...@looktowindward.com wrote: On 11 Mar 2013, at 20:26, Mike Abdullah wrote: I had assumed (and I thought I'd done something like this before) that the: myDict = [[super class] newDict]; statement would call newDict in BaseClass Instead it calls the

Re: Objective-C Question

2013-03-11 Thread John McCall
On Mar 11, 2013, at 1:45 PM, Dave d...@looktowindward.com wrote: On 11 Mar 2013, at 20:30, Seth Willits wrote: On Mar 11, 2013, at 1:21 PM, Dave wrote: +(NSMutableDictionary*) newDict { return [[NSMutableDictionary alloc] init]; } (I hope you're using ARC otherwise this is a memory

Re: Objective-C Question

2013-03-11 Thread John McCall
On Mar 11, 2013, at 2:02 PM, Dave d...@looktowindward.com wrote: On 11 Mar 2013, at 20:53, John McCall wrote: On Mar 11, 2013, at 1:33 PM, Dave d...@looktowindward.com wrote: On 11 Mar 2013, at 20:26, Mike Abdullah wrote: I had assumed (and I thought I'd done something like this before

Re: Convention for init with error

2013-02-27 Thread John McCall
On Feb 27, 2013, at 1:12 PM, Brad O'Hearne br...@bighillsoftware.com wrote: I have a need to construct an object with the possibility of an error taking place and needing to return that error. While it would be nice to have a clean init method that returned no errors, in this particular case,

Re: How to avoid warning?

2013-01-22 Thread John McCall
On Jan 22, 2013, at 9:23 AM, Dave d...@looktowindward.com wrote: That's wont help because myClass is a variable created from a String. But it will help, because Quincey's suggestion is not contingent on the type of the object that you send the message to. The compiler is merely asking that

Re: object.struct.element as lvalue

2013-01-22 Thread John McCall
On Jan 22, 2013, at 11:03 AM, Matt Neuburg m...@tidbits.com wrote: We have dot-syntax for accessors, and we have dot-syntax for struct elements, and we can chain them, but not as an lvalue. It is legal to say x = object.struct.element and object.struct = f and struct.element = x

Re: object.struct.element as lvalue

2013-01-22 Thread John McCall
On Jan 22, 2013, at 11:59 AM, Matt Neuburg m...@tidbits.com wrote: On Jan 22, 2013, at 11:25 AM, John McCall rjmcc...@apple.com wrote: On Jan 22, 2013, at 11:03 AM, Matt Neuburg m...@tidbits.com wrote: We have dot-syntax for accessors, and we have dot-syntax for struct elements, and we can

Re: constructor for 'E' must explicitly initialize the base class 'C' which does not have a default constructor

2013-01-18 Thread John McCall
On Jan 18, 2013, at 1:28 AM, Rick Mann rm...@latencyzero.com wrote: Can anyone explain this error? It sure looks to me like all the base class constructors are being explicitly called. http://pastebin.com/cVMmgqCZ This is off-topic for this list, but since I'm here anyway, I'll

Re: Could somebody please fix NSTimer?

2013-01-14 Thread John McCall
On Jan 14, 2013, at 10:07 AM, David Duncan david.dun...@apple.com wrote: On Jan 12, 2013, at 10:49 AM, Gordon Apple g...@ed4u.com wrote: When compiled under ARC, NSTimer should have a weak, not strong, reference to its target. If you want this, file a bug. Posting on the mailing list

Re: Core Foundation Objects and Properties when using ARC

2013-01-11 Thread John McCall
On Jan 10, 2013, at 4:35 PM, Dave d...@looktowindward.com wrote: I've looked all over and just can't seem to find the recommended approach to handling CF objects in properties when using ARC. I have an init method that needs to create a CF object and store it as a property for use while

Re: making the most of a symbolic breakpoint

2013-01-09 Thread John McCall
On Jan 9, 2013, at 9:29 AM, Kyle Sluder k...@ksluder.com wrote: On Jan 9, 2013, at 9:17 AM, Joel Reymont joe...@gmail.com wrote: Tech Note 2239 refers to 64-bit register details in Listing 10, Objective-C runtime 'secrets'. These details can be found here

Re: Dumb ARC question

2013-01-01 Thread John McCall
On Dec 28, 2012, at 12:59 AM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: On Dec 27, 2012, at 22:37, Rick Mann rm...@latencyzero.com wrote: So, the usual bit about references being weak by default in C structs (and C++ classes) doesn't hold here. Huh? References aren't weak

Re: Arc and **

2012-12-05 Thread John McCall
On Dec 4, 2012, at 10:44 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: On 5 Dec 2012, at 12:59, Greg Parker gpar...@apple.com wrote: On Dec 4, 2012, at 8:56 PM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I have (using Arc) a method which works fine: NSString *explanation; [ self

Re: ARC conversion help - CFErrorRef* and NSError**

2012-10-29 Thread John McCall
On Oct 29, 2012, at 11:15 AM, Alex Kac wrote: ARC conversion is something we're having some issues with, but I won't bore you with the details. I'm trying to convert parts of our project to ARC and so of course there is a learning curve. Primarily between CF code and Cocoa. This one I'm

Re: lambda in C++

2012-10-17 Thread John McCall
On Oct 17, 2012, at 1:19 AM, Luca Ciciriello wrote: Is there some WWDC2012 video section talking about lambda in C++ 0x11? It's not focused entirely on lambdas, or even entirely on C++11, but yes, we did talk about the feature in the What's New in LLVM session.

Re: static void declaration in apple example code

2012-10-12 Thread John McCall
On Oct 12, 2012, at 12:46 AM, Dave Keck wrote: staticvoid *AVSPPlayerItemStatusContext = AVSPPlayerItemStatusContext; This declares a unique pointer, whose value is defined as the address in memory where the pointer lives. This technique can be useful when you need a value that's

Re: fragile ABI and PPC64

2012-08-20 Thread John McCall
On Aug 19, 2012, at 10:14 PM, Dale Miller wrote: PPC64's being included in this list surprised me, so I went to my docs (I'm on 10.5.8 until they pry my G5 from my dead,cold hands). All the mentions I can find of the fragile ABI explicitly describe it as inherent in a 32-bit environment,

Re: __weak pointer collection firing prematurely???

2012-08-16 Thread John McCall
On Aug 15, 2012, at 6:00 PM, Britt Durbrow wrote: On Aug 15, 2012, at 4:46 PM, John McCall rjmcc...@apple.com wrote: On Aug 13, 2012, at 11:38 PM, Britt Durbrow wrote: OK, I think I've isolated the issue... basically, __weak, @public, and -fno-objc-arc don't like to play nice together. If you

Re: __weak pointer collection firing prematurely???

2012-08-15 Thread John McCall
On Aug 13, 2012, at 11:38 PM, Britt Durbrow wrote: OK, I think I've isolated the issue... basically, __weak, @public, and -fno-objc-arc don't like to play nice together. If you set a @public __weak instance variable (may also apply to stack variables, I haven't tested that yet) in a file

Re: Classes incompatible with weak references

2012-08-13 Thread John McCall
On Aug 13, 2012, at 9:29 AM, Jean-Daniel Dupas wrote: Le 13 août 2012 à 17:56, Kyle Sluder k...@ksluder.com a écrit : On Aug 13, 2012, at 8:42 AM, Ben ben_cocoa_dev_l...@yahoo.co.uk wrote: I see in the documentation - and from a compiler error - that some classes are not compatible with

Re: ARC and reinterpret_cast

2012-07-17 Thread John McCall
From: Rick Mann rm...@latencyzero.com Subject: ARC and reinterpret_cast? Date: July 7, 2012 9:13:29 PM PDT To: Cocoa-Dev List cocoa-dev@lists.apple.com Hi. I'd like to write code like this: MyObject* foo = reinterpret_cast__bridge MyObject* (someVoidPointer); But the compiler