Re: why isn't idMyCellDelegate an id?

2013-10-04 Thread Tom Davie
with the fact that ids come up all the time, and show some support for wanting a language where the compiler can make more proofs for us. Thanks Tom Davie * prove is a loaded term when it comes to objective-c, as the runtime can mess up your compile time proof by dynamically switching things about

Re: Analyser reports memory leak… where?

2013-09-12 Thread Tom Davie
, and in fact collection access does not do this, so it’s entirely possible to do things like: id a = x[5]; [x removeObjectAtIndex:5]; [a crashMyProgram]; Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: 64-bit iOS

2013-09-10 Thread Tom Davie
due to the increase of instruction and pointer size. Note, this was actually more significant on x86, where most of the mess caused by CISC (like having bugger all registers) got sorted out. Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev

Re: 64-bit iOS

2013-09-10 Thread Tom Davie
? Maybe, maybe not. The flip side is that pointers are twice as large, so half as many fit in cache. And off when you do need to hit RAM you need to fetch more data. Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: Unicode chars in string

2013-09-09 Thread Tom Davie
stringByReplacingOccurancesOfString:@“→” withString:@“⤜”]. Tom Davie ___ 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

Re: ARC vs Manual Reference Counting

2013-09-09 Thread Tom Davie
seen performance improve when using ARC. Tom Davie ___ 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

Re: ARC vs Manual Reference Counting

2013-09-09 Thread Tom Davie
On 9 Sep 2013, at 10:18, Jean-Daniel Dupas devli...@shadowlab.org wrote: Le 9 sept. 2013 à 09:58, Tom Davie tom.da...@gmail.com a écrit : On 9 Sep 2013, at 09:44, Kyle Sluder k...@ksluder.com wrote: Thirded. I thought I wouldn't like it. As soon as I didn't have to manage retains

Re: ARC vs Manual Reference Counting

2013-09-09 Thread Tom Davie
On 9 Sep 2013, at 11:49, Jean-Daniel Dupas devli...@shadowlab.org wrote: Le 9 sept. 2013 à 11:33, Tom Davie tom.da...@gmail.com a écrit : On 9 Sep 2013, at 10:18, Jean-Daniel Dupas devli...@shadowlab.org wrote: Le 9 sept. 2013 à 09:58, Tom Davie tom.da...@gmail.com a écrit

Re: 30x faster JSON date parsing

2013-09-09 Thread Tom Davie
to parse. Yes. It's ridiculous that a lot of JSON APIs send ISO 8601-formatted (or other human-readable format) dates. Yes, it absolutely is, when no human is going to read them. Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: Threadsafe copy of objective c object

2013-09-03 Thread Tom Davie
What I’m surprised no on has mentioned here is the trivial… Remove the mutation methods. Make your object immutable, the referential transparency will give you “free” parallelism. If you want a mutated version of the object, create a new object. Tom Davie

Re: Introducing ioscomponents.com

2013-08-28 Thread Tom Davie
to select the export type, and a UIPicker to select the export format. That said, don’t get disheartened – a good, high quality data table is something that would be very useful on iOS – just try to polish it up more! Tom Davie On 27 Aug 2013, at 04:56, Jason Gibbs iosmaniac...@gmail.com

Re: How to fix warning?

2013-08-28 Thread Tom Davie
either explicitly (by adding the casts in this expression), or implicitly, by assigning the littorals to a variable of the desired type. Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: IB autolayout is impossible

2013-08-20 Thread Tom Davie
extra view. Tom Davie On 20 Aug 2013, at 01:48, dangerwillrobinsondan...@gmail.com wrote: In general in 4.x add your constraints that will make a satisfiable layout, then remove the ones you don't want. The next one does less trying without asking but this one is not that bad if people

Re: IB autolayout is impossible

2013-08-20 Thread Tom Davie
is doing very wrong here :D Tom Davie On 20 Aug 2013, at 09:55, Rick Mann rm...@latencyzero.com wrote: I have filed literally hundreds of bug reports. I get the spirit of what you're saying, but I'm so stressed from this project (and IB's hand in it), and so demoralized from having my bugs

Re: NSLog object = nil?

2013-08-20 Thread Tom Davie
references. Tom Davie ___ 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: How to detect a Retina Mac

2013-08-18 Thread Tom Davie
suggested, it’s just unnecessary here. Tom Davie ___ 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

Re: How to detect a Retina Mac

2013-08-18 Thread Tom Davie
On 18 Aug 2013, at 15:56, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: On 18 Aug 2013, at 20:09, Tom Davie tom.da...@gmail.com wrote: On 18 Aug 2013, at 15:03, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I just noticed that the program I use to create Png files creates files

Re: How to detect a Retina Mac

2013-08-18 Thread Tom Davie
, kCGBitmapAlphaInfoMask kCGAlphaLast); CFRelease(rgbColorSpace); … do some drawing … CGImageRef img = CGBitmapContextCreateImage(ctx); CGContextRelease(ctx); return [[[NSImage alloc] initWithCGImage:img size:size] autorelease]; Thanks Tom Davie ___ Cocoa-dev mailing

Re: reverse scanner

2013-08-10 Thread Tom Davie
and a turing complete program. About the only use for regular expressions I can think of is asking NSScanner to scan something that it doesn’t by default know about. Tom Davie On 10 Aug 2013, at 19:53, Jerry Krinock je...@ieee.org wrote: On 2013 Aug 10, at 10:07, Boyd Collier bcolli...@cox.net wrote

Re: reverse scanner

2013-08-10 Thread Tom Davie
On 10 Aug 2013, at 22:44, Keary Suska cocoa-...@esoteritech.com wrote: On Aug 10, 2013, at 12:17 PM, Tom Davie wrote: Heh, I’d actually argue that NSScanner is a much much better API to use here (and in fact nearly everywhere). Regular expressions constrain you only to regular grammars

Re: Mixing Obj-C and C methods

2013-08-07 Thread Tom Davie
is just terrible design. Tom Davie ___ 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

Re: Synchronous Serial Port Protocol messaging With NSOperationQueue/GCD

2013-08-07 Thread Tom Davie
. Tom Davie ___ 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

Re: How to convert an NSString to

2013-08-07 Thread Tom Davie
for representing the 0x20th Unicode character – that is “space”. It is not for representing other whitespace characters like tab (%09) etc. Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: when __bridge isn't required

2013-07-27 Thread Tom Davie
The first gives me the following error: Implicit conversion of Objective-C pointer type 'NSString *' to C pointer type 'CFStringRef' (aka 'const struct __CFString *') requires a bridged cast Tom Davie On Jul 27, 2013, at 8:31 PM, Matt Neuburg m...@tidbits.com wrote: I feel like I've asked

Re: LATIN SMALL LETTER U WITH DIAERESIS

2013-07-18 Thread Tom Davie
A workaround would be to use +[NSFileHandle fileHandleForWritingAtURL: error:] and -[NSFileHandle fileDescriptor] to get you a FD to use in C land. Tom Davie On Jul 17, 2013, at 11:26 PM, koko k...@highrolls.net wrote: With this character: LATIN SMALL LETTER U WITH DIAERESIS Unicode: U

Re: NSViewController subclass return type

2013-07-11 Thread Tom Davie
implementation. Except that view is a read/write property, and this is a type error, because of this situation: UIVCSubclass *s = [[UIVCSubclass alloc] init...]; UIViewController *vc = s; [vc setView:[[[UIView alloc] init] autorelease]; Tom Davie ___ Cocoa-dev

Re: Isolated process for each NSDocument of my app

2013-06-13 Thread Tom Davie
The best way is to write an application that's stable. The only reason browsers started doing this was because they had to deal with 3rd party code (e.g. flash) that was giving them a terrible reputation for instability. If you're controlling the entire app, you have no reasonable reason to do

Re: Isolated process for each NSDocument of my app

2013-06-13 Thread Tom Davie
On 13 Jun 2013, at 20:29, Daniele Margutti m...@danielemargutti.com wrote: On 13 Jun 2013, at 20:05, Tom Davie tom.da...@gmail.com wrote: The best way is to write an application that's stable. The only reason browsers started doing this was because they had to deal with 3rd party code

Re: ^Block statement considered harmful for callbacks?

2013-04-25 Thread Tom Davie
. And we know that the issues are there – we just choose to have them because the issues with the less leaky solutions are even more severe (especially in C like languages). Thanks Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: ^Block statement considered harmful for callbacks?

2013-04-25 Thread Tom Davie
of cycles with a static analyser. Obviously you couldn't detect all of them, but this would probably get a good way to stomping on the you used an ivar here, and self retains the block, that's bad m'kay bugs. Thanks Tom Davie ___ Cocoa-dev mailing list

Re: ^Block statement considered harmful for callbacks?

2013-04-25 Thread Tom Davie
cases, as I suggested! Note – this does not make throwing blocks around without paying attention to retain cycles inherently safe though, the compiler can not statically infer all potential cycles. Thanks Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev

Re: ^Block statement considered harmful for callbacks?

2013-04-25 Thread Tom Davie
as it might be. Luckily, if you grab Landon Fuller's PLWeakCompatibility (and possibly Mike Ash's MAZeroingWeakRef too), you'll be able to use __weak in your non-arc code too. Thanks Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: ^Block statement considered harmful for callbacks?

2013-04-25 Thread Tom Davie
the request in the first place. I would consider that a much much much higher penalty than having to a bit careful about retain cycles. Thanks Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: Followup - Re: Is there a pattern for creating an object with global scope?

2013-04-15 Thread Tom Davie
delegate as a store for things that aren't singletons, but only one of them is pointed at by your app delegate is also horrific – you're just substituting one singleton for another. Thanks Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: Is there a pattern for creating an object with global scope?

2013-04-13 Thread Tom Davie
a chunk of global state lying around, but that's a whole different story. Thanks Tom Davie ___ 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

Re: Accessing members from NSDictionary

2013-04-05 Thread Tom Davie
; with someObject.someProperty = 56.9f; and { float someIvar; } with @property (assign, nonatomic) float someProperty; So neither is really true. Thanks Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Accessing members from NSDictionary

2013-04-05 Thread Tom Davie
1) yes you could use the code you outlined to access the property 2) @property (assign, nonatomic) IBOutlet NSWindow *iWindow; Note though to be careful about the assign tag there – you may well want that to be a retain. Thanks Tom Davie On 5 Apr 2013, at 15:06, Pax 45rpmli...@googlemail.com

Re: Accessing members from NSDictionary

2013-04-05 Thread Tom Davie
a subview of another view that's retained. The issue isn't quite as simple as never retain IBOutlets. Thanks Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list

Re: cocoa bindings performance

2013-02-17 Thread Tom Davie
with a couple of other techs that supposedly make life easier, like CoreData and Storyboards). Thanks Tom Davie On 15 Feb 2013, at 19:42, Maximilian Marcoll m...@dis.playce.info wrote: Hi everyone! I have a problem with bindings, or so it seems. In my application, I need to programmatically

Re: faster deep copies?

2013-02-14 Thread Tom Davie
approach to this (though not one that's going to be as fast as a custom deepCopy method), would be to implement your own NSCoder subclass. I have in the past made keyed archivers which are substantially quicker than apple's, and encode into substantially smaller byte formats. Thanks Tom Davie

Re: How to avoid warning?

2013-01-21 Thread Tom Davie
On 21 Jan 2013, at 18:14, Dave d...@looktowindward.com wrote: Hi All, I have the following code: if (class_RespondsToSelector(myClass,@selector(initWithManager:) == NO) myObj = [[myClass alloc] init]; else myObj = [[myClass alloc] initWithManager:sel]]; I get a warning

Re: NSOpenPanel runModal on a dispatch

2012-12-17 Thread Tom Davie
interact the app while an open panel displaying. But why? What's the issue with the user pausing a video while an open panel happens to be open? Thanks Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: NSOpenPanel runModal on a dispatch

2012-12-17 Thread Tom Davie
to start that fade, and start it, with the open panel for the next video open? Thanks Tom Davie ___ 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

Re: NSOpenPanel runModal on a dispatch

2012-12-17 Thread Tom Davie
panel is opened. Wouldn't the correct thing in this state be to create a new project window associated with the project document, and then fire of an open sheet for that window so that it's only modal for the window? Thanks Tom Davie ___ Cocoa

Re: NSOpenPanel runModal on a dispatch

2012-12-17 Thread Tom Davie
sat there, doing nothing, with no significant windows open, yet in an inconsistent state, and requiring modal interaction to sort it out? If that's your assertion, then I'd suggest you have a deeper seated design bug. Thanks Tom Davie ___ Cocoa-dev

Re: NSOpenPanel runModal on a dispatch

2012-12-16 Thread Tom Davie
addObject: 3) Why use a mutable array at all? You could just use a constant array – NSArray *filetype = [NSArray arrayWithObject:@txt]; 4) The above can then be further condensed with the new syntactic sugar for arrays: NSArray *filetype = @[ @txt ]; Thanks Tom Davie

Re: NSOpenPanel runModal on a dispatch

2012-12-16 Thread Tom Davie
executing until the open dialog is closed. If the openDialog methods dispatch to the main queue, their dispatches will not occur until the main queue is able to run another block, which won't happen until your block finishes. You are very much blocking the main queue. Thanks Tom Davie On 16

Re: How To Safely Invoke a Block

2012-11-21 Thread Tom Davie
handler = [self progressHandler]; handler(…); }); … } Tom Davie ___ 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

NSSearchField selecting after sending its action

2012-11-17 Thread Tom Davie
). Does anyone know what weird property I've ended up accidentally selecting (or not selecting) here? Thanks Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: How to implement readonly property

2012-11-12 Thread Tom Davie
(assuming it's the same instance it's called on), and it will be allocated only once. Tom Davie ___ 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

Re: How to implement readonly property

2012-11-12 Thread Tom Davie
On 12 Nov 2012, at 13:39, Marco Tabini mtab...@me.com wrote: This is completely the wrong way to implement a property. The static variable will be shared between all instances. Here's how you should be doing a lazy loaded var: @implementation MyClass { NSDictionary *_someDictionary

Re: How to implement readonly property

2012-11-12 Thread Tom Davie
token is an ivar, unlike I did. Tom Davie ___ 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

Re: Is ARC any smarter than Xcode's 'Analyze'?

2012-11-12 Thread Tom Davie
smarter than analyse. ARC is guaranteed to get memory management right (modulo retain cycles and weak refs that shouldn't be weak). Meanwhile the analyser is trying to understand what *you* did to try and make memory management right, which is a much much harder task. Tom Davie

Re: a way to clear inactive RAM

2012-11-06 Thread Tom Davie
for applications. Tom Davie ___ 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

Re: Cocoa equivalent for 'InstallApplicationEventHandler'

2010-02-20 Thread Tom Davie
You want NSEvent's + (id)addGlobalMonitorForEventsMatchingMask:(NSEventMask)*mask* handler:(void (^)(NSEvent*))*block* *and* * + (id)addLocalMonitorForEventsMatchingMask:(NSEventMask)mask handler:(NSEvent* (^)(NSEvent*))block Bob * On Sat, Feb 20, 2010 at 11:45 AM, Vikram Sethi

Open panel is permanently dead?

2010-02-19 Thread Tom Davie
:) contextInfo:nil]; [compressingProgress startAnimation:self]; } }];} Thanks Tom Davie ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Overriding NSMenuItem's drawing

2010-02-17 Thread Tom Davie
I need an NSMenuItem that rather than drawing an NSImage in it's cell draws *part* of an NSImage, is it possible to override NSMenuItem's drawing in any way to achieve this? I don't see the relevant methods. Thanks Tom Davie ___ Cocoa-dev mailing

Bizarre locking issue

2010-01-24 Thread Tom Davie
== self.library) // { // return @Library; // } } Note that commenting out both lines that requests self.library cause the error to go away. Any help would be much appreciated. Thanks Tom Davie p.s. Here's a stack trace when the lock error is logged (breaking on _NSLockError doesn't work) #0

Re: UIImageView display as multiply?

2010-01-22 Thread Tom Davie
An image doesn't carry a blend mode, merely the image data. You *draw* the image in a given blend mode. Bob On Fri, Jan 22, 2010 at 3:52 PM, Eric E. Dolecki edole...@gmail.com wrote: I'm not combining two or more images, I merely would like a single uiimage in a uiimageview to have a blend

Re: [iphone] Release Navigation View Controller Question

2010-01-17 Thread Tom Davie
Yes, that code is 100% fine. Here's the logic from purely your point of view. You allocate browserviewController and in doing so take ownership. You do some stuff with browserviewController. You are finished with browserviewController, and don't want to do anything else with it, so you resign

Re: Encrypting Binary Strings

2009-12-30 Thread Tom Davie
Simple answer: no. If your application can still read the strings, so can a clever person, if by nothing else than sitting and patiently emulating a CPU with a piece of paper and a pencil. In order to actually secure something *you, or your recipient* have to be involved in decrypting it, by

Removing the dragging image

2009-12-27 Thread Tom Davie
of it? Thanks Tom Davie ___ 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

Scanning

2009-11-17 Thread Tom Davie
I'm trying desperately to find where the API for scanning images is, I've found the Image Capture API on developer.apple.com, but I can't find a more recent version than one for 10.4, and none of the sample code compiles any more, worse the sample apps crash on launch. What should I be searching

Changing the edit behaviour of a cell

2009-10-09 Thread Tom Davie
I've been busy reading the documentation all day, and can't for the life of me figure out how to change the editing behavior of an NSCell. I have a cell, which I'd like to pop up a window over when the user attempts to edit it (much like many websites do to present a date picker for example). I