Re: Running apps compiled for newer OS X versions on older versions (rant)

2016-08-22 Thread Alastair Houghton
> On 22 Aug 2016, at 12:15, Andreas Falkenhahn wrote: > > Out of curiosity, I've just run a little test and compiled my app on the > 10.11 system for the 10.11 target and tried to run it on the 10.6 system, > just to see what happens. All I got is a message "Illegal

Re: Launch, connect, communicate

2016-08-19 Thread Alastair Houghton
On 16 Aug 2016, at 00:26, Andrew Keller wrote: > > 1. If the main Plot app is _not_ running in the current Aqua session, then > launch a new copy in the current Aqua session. > 2. Open some sort of a socket to the main Plot app in the current Aqua > session. > 3. Accept

Re: kCFStreamPropertySSLSettings

2016-07-25 Thread Alastair Houghton
> On 23 Jul 2016, at 00:41, Jens Alfke wrote: > > >> On Jul 22, 2016, at 2:46 AM, Gerriet M. Denkmann >> wrote: >> >> When it gets some streams it will show a panel: >> “MyApp wants to sign using key “something” in your keychain” / “Allow” “Deny” >

Re: Keyboard/Mouse Event Interaction

2016-07-17 Thread Alastair Houghton
On 17 Jul 2016, at 14:06, Dave wrote: > > My question is, do the keyboard and Mouse Down Events come in pairs, so that > the following would/should not occur: No. KeyDown happens when the key goes down, KeyUp happens when they key comes back up. Likewise with

Re: Best way to model something that's drawable (i.e. has a visual representation in the UI)

2016-07-12 Thread Alastair Houghton
On 12 Jul 2016, at 19:11, William Squires wrote: > > Normally, of course, models shouldn't know anything about UI, and vice versa, > but what about when the models themselves represent something visual that the > UI needs to draw... [snip] > In this case, it makes sense

Re: Hello. Is there a way to stop Apple CrashReporter from collecting crashes of my process?

2016-07-11 Thread Alastair Houghton
On 11 Jul 2016, at 15:04, Motti Shneor wrote: > > I develop a global daemon, maintained by launchd. Obviously It cannot be > distributed in the Mac App Store. To collect crash-reports from customers, I > integrated a mainstream 3rd party crash reporter library

Re: Threads

2016-07-11 Thread Alastair Houghton
On 11 Jul 2016, at 06:35, Gerriet M. Denkmann wrote: > > I have a subclass of NSThread (called MyThread), which runs a RunLoop in main. > When it gets cancelled, it leaves the RunLoop and main will exit. One further thought on this: it looks like you might be duplicating

Re: Threads

2016-07-11 Thread Alastair Houghton
On 11 Jul 2016, at 06:35, Gerriet M. Denkmann wrote: > > I have a subclass of NSThread (called MyThread), which runs a RunLoop in main. > When it gets cancelled, it leaves the RunLoop and main will exit. > > Some other thread does: > > if ( myThread.isCancelled ) > { >

Re: Emailing from a daemon process

2016-07-08 Thread Alastair Houghton
On 8 Jul 2016, at 16:13, Sal Conigliaro wrote: > > You can send mail using sendmail without having to configure Postfix or > Sendmail. > > Out of the box OS X can use sendmail to send messages. You can test it by > doing: > > echo “Subject: Email from OX“ |

Re: Prioritize my own app's disk access

2016-07-06 Thread Alastair Houghton
On 6 Jul 2016, at 11:06, Jonathan Taylor wrote: > > Hopefully my detail above explains why I really do not want to drop frames > and/or use a ring buffer. Effectively I have a buffer pool, but if I exhaust > the buffer pool then (a) something is going badly

Re: Prioritize my own app's disk access

2016-07-06 Thread Alastair Houghton
On 5 Jul 2016, at 13:36, Jonathan Taylor wrote: > > This is a long shot, but I thought I would ask in case an API exists to do > what I want. One of the roles of my code is to record video to disk as it is > received from a camera. A magnetic hard disk can

Re: Prioritize my own app's disk access

2016-07-05 Thread Alastair Houghton
On 5 Jul 2016, at 13:36, Jonathan Taylor wrote: > > This is a long shot, but I thought I would ask in case an API exists to do > what I want. One of the roles of my code is to record video to disk as it is > received from a camera. A magnetic hard disk can

Re: How to Handle Array of Dictionaries when Archiving/Unarchiving?

2016-06-23 Thread Alastair Houghton
On 23 Jun 2016, at 12:21, Dave wrote: > > I have an Object that I Archive and Unarchive, e.g it conforms to the > NSCopying and NSCoding Protocols. The Object in question contains NSArray and > NSDictionary Object and I handle them like this: > > initWithCoder: > >

Re: OK - I must be missing something simple here.

2016-06-22 Thread Alastair Houghton
On 22 Jun 2016, at 16:38, Alex Zavatone wrote: >> >> Is the thing that you’re missing that IBOutlets are nothing special; they’re >> just a property (the syntax “IBOutlet” is there just to tell Xcode which >> things to show in the GUI editor). So you can set the property, just

Re: OK - I must be missing something simple here.

2016-06-22 Thread Alastair Houghton
On 21 Jun 2016, at 18:54, Alex Zavatone wrote: > So, I thought, "well, since I build these UIBarButtonItems from the UIButtons > in the first place, I'll just keep an additional dictionary of buttons around > that then just swap them in and out of an iBOutlet slot in the

Re: KERN_INVALID_ADDRESS

2016-06-14 Thread Alastair Houghton
On 14 Jun 2016, at 16:36, Raglan T. Tiger <r...@crusaderrabbit.net> wrote: > >> On Jun 14, 2016, at 2:51 AM, Alastair Houghton >> <alast...@alastairs-place.net> wrote: >> >> Run your program in the debugger; it will stop when it tries to access the >

Re: DNS resolution for apps vs Terminal?

2016-06-14 Thread Alastair Houghton
On 14 Jun 2016, at 15:13, Michael Nickerson wrote: > >> On Jun 14, 2016, at 5:11 AM, Rick Mann wrote: >> >> Just now Safari stopped being able to load facbook.com. So did Chrome. Both >> reported DNS failures. >> >> But dig on the command line, and

Re: TableView crash with Delegate

2016-06-14 Thread Alastair Houghton
On 14 Jun 2016, at 05:33, Gerriet M. Denkmann wrote: > > But I had: > - (void)awakeFromNib > { > self.someUniqueObject = [ [ UniqueObject alloc ] init ]; > } > > The problem: awakeFromNib gets called twice: once before > applicationDidFinishLaunching:, once after.

Re: KERN_INVALID_ADDRESS

2016-06-14 Thread Alastair Houghton
On 13 Jun 2016, at 20:14, Raglan T. Tiger wrote: > > Or , how can an address held in a variable be checked for validity? Run your program in the debugger; it will stop when it tries to access the invalid address and you can investigate its state to see why it went

Re: TableView crash with Delegate

2016-06-13 Thread Alastair Houghton
On 12 Jun 2016, at 10:10, Gerriet M. Denkmann wrote: > > OS X 10.11.5, Xcode Version 7.3.1 (7D1014). > > App with TableView (View based). Works fine. > But when I give the TableView a delegate (even without implementing any > NSTableViewDelegate methods) it crashes (see

Code signatures and automator actions

2016-06-07 Thread Alastair Houghton
Hi all, Been a while since I last posted here; seems I’m re-joining the cocoa-dev firehose. Anyway, the current version of iDefrag, 5.1.2, is compatible with OS X 10.10 and OS X 10.11, *but* currently it won’t run on OS X 10.10 without fiddling around because OS X 10.10 doesn’t like the code

Re: LOCATING MEDIA FILES IN MACINTOSH

2011-01-07 Thread Alastair Houghton
On 6 Jan 2011, at 20:54, Abhinav Tyagi wrote: 1) I need an efficient approach to solve this problem using Cocoa or C++. (very Important) 2) How will check a file if its a valid media file or data file. Like we can have .dat files that are video files but data files can also have .dat

Re: how do I put a subview in a superview with color

2010-12-30 Thread Alastair Houghton
On 30 Dec 2010, at 22:22, colo wrote: I was following the Chapter 17 Cocoa programming for osx 3rd ed The code is below. All I want to do for a working example is draw an NSView subview in the superview. And give it have a color and width height. I was trying all sorts of things. I can

Re: Text rendering/editing on OSX iOS

2010-12-27 Thread Alastair Houghton
On 21 Dec 2010, at 14:29, Ricky Sharp wrote: I'm not sure what you mean by it's the same. Do you mean pixel for pixel accuracy between Mac OS X and iOS? I don't thing that may be possible (at least at a high level) as there may be different rendering techniques. Indeed, my understanding

Re: Moderator - Re: iPad 4.2 (deploy to 3.2.2) error

2010-11-11 Thread Alastair Houghton
On 10 Nov 2010, at 17:54, Shawn Bakhtiar wrote: Only those who have actually signed an NDA with Apple are subject to this, and they are certainly free to refrain from comment. Everyone else is free to talk, blog, and post about it how they please. Perhaps you could refrain from giving

Re: Moderator - Re: iPad 4.2 (deploy to 3.2.2) error

2010-11-11 Thread Alastair Houghton
On 10 Nov 2010, at 19:00, Laurent Daudelin wrote: Note: I am not an Apple's employee and have agreed/signed all NDAs. Now, although I agree with the above comment from Scott, if you haven't signed an NDA specifically with Apple, how do you know when you're talking about something that

Re: [iPhone] HTTPS / client Certificate / configuration profile

2010-11-03 Thread Alastair Houghton
On 3 Nov 2010, at 13:58, Sandro Noël wrote: Our application accesses the content of a secure web server, the server is configured to ask the client for a certificate. Historically, client certificates haven't really worked properly in Secure Transport, and therefore also not from Safari or

Re: fork/exec vs NSTask

2010-10-24 Thread Alastair Houghton
On 24 Oct 2010, at 18:48, Thomas Clement wrote: On 24 oct. 2010, at 19:03, eveningnick eveningnick wrote: Hello! I am wondering, if NSTask can be replaced with low-level fork/exec calls. Looking through forums, i often met statements that launching a process with fork/exec is not an OS X

Re: NSUTF8StringEncoding and umlauts

2010-09-01 Thread Alastair Houghton
On 1 Sep 2010, at 10:21, sebi wrote: I load an utf-8 textfile from a server with [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:err] and non ascii characters are still not right, e.g. ü becomes ÃŒ. is that a problem on my end or on the server side? You're

Re: Command line tool using NSImage?

2010-08-21 Thread Alastair Houghton
On 21 Aug 2010, at 14:35, Jaime Magiera wrote: On Aug 21, 2010, at 5:33 AM, Ken Thomases wrote: In short, you can't reliably use AppKit (including NSImage) from a daemon or remote shell. Thanks for the link. Interesting read. In short, that's really a bummer. It totally negates a

Re: Using Apple icons

2010-08-17 Thread Alastair Houghton
On 16 Aug 2010, at 23:00, Gideon King wrote: I was at a WWDC session several years ago (maybe about 5 years?) where exactly this question was asked of John Geleynse at one of the sessions. He said definitively that you could use the icons of applications that come with the system so long

Re: Custom zones...

2010-08-10 Thread Alastair Houghton
On 10 Aug 2010, at 05:18, charlie wrote: As you can see, the c string is successfully allocated from space in the custom zone. But the NSString object is allocated from the default zone, despite having called +[NSObject allocWithZone:]. Anyone know the trick to this? Sounds like a bug

Re: Math.h functions with CGFloat

2010-08-10 Thread Alastair Houghton
On 10 Aug 2010, at 13:42, steven Hooley wrote: Is there a preferred way to use the Math.h functions with CGFloats that is 32 and 64 bit safe? Why would they be unsafe? (They aren't.) It's possible that using the double versions (the ones without the f suffix) is inefficient in 32-bit mode,

Re: Custom zones...

2010-08-10 Thread Alastair Houghton
On 10 Aug 2010, at 14:55, Bill Bumgarner wrote: On Aug 10, 2010, at 1:31 AM, Alastair Houghton wrote: Sounds like a bug to me. While zones are *discouraged* (they're very definitely an advanced topic and easily misused), I don't think they're actually deprecated. Their use

Re: Math.h functions with CGFloat

2010-08-10 Thread Alastair Houghton
On 10 Aug 2010, at 16:28, Graham Cox wrote: If your code is working with CGFloat, then the warning isn't very helpful, because by using CGFloat you've elected to use 32-bit precision. Only on 32-bit. On the 64-bit runtime, CGFloat is a double, not a float, and therein lies the problem. If

Re: cocoa app is cancelling shutdown

2010-07-22 Thread Alastair Houghton
On 22 Jul 2010, at 05:30, Kyle Sluder wrote: On Wed, Jul 21, 2010 at 3:27 AM, Elizabeth Kellner ekell...@gmail.com wrote: Second is that this app is being launched programmatically from another app, using [NSTask launchedTaskWithLaunchPath:arguments:]. If I launch the app directly, it does

Re: Command-line parsing

2010-07-21 Thread Alastair Houghton
On 21 Jul 2010, at 15:54, Fritz Anderson wrote: I'm writing a Foundation tool that will take both options and pathname arguments. If you use NSUserDefaults, you can handle key-value options (-threshold 17) pretty easily, but this has limitations. I don't see how it can be graceful for

Re: Initializing unichar variable with a human readable letter

2010-07-18 Thread Alastair Houghton
On 18 Jul 2010, at 09:38, vincent habchi wrote: Since I use the unichar to make comparisons, I could also have initialized a custom NSCharacterSet with é, but, as we say here in France: it's like using a bulldozer to break a nut shell. It's worth perhaps pointing out that comparing with the

Re: Run application before Login starts?

2010-07-06 Thread Alastair Houghton
On 6 Jul 2010, at 06:14, kirankumar wrote: Thanks to all for spending time on my issue, No,my app doesn't require any authentication and authorization. That isn't what John said. He said (rightly) that the *installer* will need to use authentication/authorization in order to install your

Re: Best way to compare CGFloats

2010-06-30 Thread Alastair Houghton
On 30 Jun 2010, at 09:35, Rimas M. wrote: So question is, what is the most efficient (performance side) and simplest (coding side) way to compare those bastards? At the moment I am thinking about: a) BOOL _floatsOrDoublesAreEqual = ( (float)C.x == (float)D.x); b) BOOL

Re: Best way to compare CGFloats

2010-06-30 Thread Alastair Houghton
On 30 Jun 2010, at 10:46, Rimas M. wrote: In my case I am interested in x's and y's comparison. Not points as themselves. But your suggestion gave me another question, which I have never thought about before - how NSEqualPoints, ...Rects etc works? I guess they *must* be safe to use, because

Re: Best way to compare CGFloats (Rick B.)

2010-06-30 Thread Alastair Houghton
On 30 Jun 2010, at 15:56, Frederick Bartram wrote: Hope that I am not being too pedantic but imo you should never test for 'equality' ('==') when using machine real data types. Sometimes you really do want binary equivalence, and in that case == may be the right thing to use. Normally,

Re: Best way to compare CGFloats (Rick B.)

2010-06-30 Thread Alastair Houghton
On 30 Jun 2010, at 17:37, Michael Ash wrote: While we're being pedantic, note that == is not always the same as binary equivalence. For example, 0.0 == -0.0, and x != x when x = NAN. That's a good point. I spoke inaccurately. Using == can make sense when you know that your values are exact

Re: Using Field Editor correctly in custom NSCell

2010-06-23 Thread Alastair Houghton
On 23 Jun 2010, at 02:56, Graham Cox wrote: For example, it seems that the cell should override -setUpFieldEditorAttributes: but what should this method actually do? In the cell code I have, this method has been commented out, and the field editor set up is being done in

Re: File descriptors not freed up without a -closeFile call

2010-06-23 Thread Alastair Houghton
On 23 Jun 2010, at 11:14, Ben Haller wrote: 3. I added [[pipe fileHandleForWriting] closeFile] and [[pipe fileHandleForReading] closeFile] calls to close the files associated with the pipes when my tasks completed. This change fixed the problem; I no longer run out of file descriptors.

Re: Question about scaling text within a subView

2010-06-10 Thread Alastair Houghton
On 9 Jun 2010, at 21:11, Eric E. Dolecki wrote: I have a view that contains text in it. I am scaling it up and down... When at 100% the text is nice and crisp. When scaled, it's blurry (the default state for the view). How can I fix that? Would I need to set the text again at a specific

Re: Creating a NSTableView cell the iPhone way

2010-06-10 Thread Alastair Houghton
On 10 Jun 2010, at 08:37, Gustavo Pizano wrote: Well I have created custom table view cells in the way that I create my subclass of NSCell, and then in the -(void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView method I make the drawing. now i wonder if I can do it the

Re: Creating a NSTableView cell the iPhone way

2010-06-10 Thread Alastair Houghton
On 10 Jun 2010, at 10:49, Gustavo Pizano wrote: Yes, sorry I didn't think properly when typing, NSCell is not a view, and unfortunately Cocoa doesn't offer the option as UIKit to drag in IB a (NSTableCell), and just put all the controls there, then set the Identifier to reuse, configure

Re: Erasing drawn content

2010-06-09 Thread Alastair Houghton
On 9 Jun 2010, at 10:02, vincent habchi wrote: Oops, wrong email address, I try again: Pity, I like the idea of more bee-based metaphors in APIs (or Apis). It could be known as Bee-OS. That was a pun in latin? http://en.wikipedia.org/wiki/BeOS (which was once a candidate for the base

Re: Erasing drawn content

2010-06-09 Thread Alastair Houghton
On 9 Jun 2010, at 12:38, vincent habchi wrote: Le 9 juin 2010 à 13:33, Alastair Houghton a écrit : On 9 Jun 2010, at 10:02, vincent habchi wrote: Pity, I like the idea of more bee-based metaphors in APIs (or Apis). It could be known as Bee-OS. That was a pun in latin? http

Re: Erasing drawn content

2010-06-09 Thread Alastair Houghton
On 9 Jun 2010, at 19:06, Matej Bukovinski wrote: The layer approach din't work out as well. I get the same black color problem as with the view. Overriding drawRect: is problematic for WebViews, as Jens pointed out WebViews do all sorts of drawing voodoo. Believe me, I've tried. It

Re: Erasing drawn content

2010-06-09 Thread Alastair Houghton
On 9 Jun 2010, at 20:15, Paul Kim wrote: I might as well take a stab at this: - Draw into an NSImage, filling the shapes as fully opaque. A transparency layer would be better. However, this doesn't really deal with the underlying problem that WebKit rendering is hairy and so you're taking

Re: OK, break it down for me... (question about gzip)

2010-06-08 Thread Alastair Houghton
On 8 Jun 2010, at 07:25, Graham Cox wrote: On 08/06/2010, at 4:16 PM, Stephen J. Butler wrote: b) In a working OS X system, the unix executables will always be where they're supposed to be (ie: /bin, /sbin, /usr/bin, /usr/sbin, etc). Thanks Stephen, so given the four choices I looked at

Re: Notification of window visible?

2010-06-07 Thread Alastair Houghton
On 7 Jun 2010, at 02:16, Chris Idou wrote: Is it? Can't a window become visible without becoming key? Indeed. NSWindowDidBecomeKeyNotification won't do it for you. You might be able to use NSWindowDidUpdateNotification for this, since you'll get one of these before the window is displayed on

Re: dynamic resolution

2010-06-01 Thread Alastair Houghton
On 31 May 2010, at 22:23, Jean-Daniel Dupas wrote: Le 31 mai 2010 à 20:50, Rafael Cerioli a écrit : Well, that's curious. I'm surely missing a particular setting because when I don't manually link that lib (and it's the same with libstdc++), I get link errors. Do you know if there is a

Re: font glyphs on different hardware

2010-06-01 Thread Alastair Houghton
On 1 Jun 2010, at 02:42, James Maxwell wrote: Okay, so the simple solution isn't simple. this: NSFont* artFont_2 = [NSFont fontWithName:@Sonara size:30.0]; NSLog(@what's up? %i, [artFont_1 glyphWithName:@FULL STOP]); prints the glyph as 0 (which is NOT the glyph ID) So what gives?

Re: Stealing settings from Mail.app

2010-06-01 Thread Alastair Houghton
On 1 Jun 2010, at 10:07, Chris Idou wrote: BTW, what exactly are the downsides of sending the mail to local machine sendmail? This is pretty off topic, but: 1. You can't rely on the mail system being properly configured on a normal client machine. IIRC on older versions of (non-Server) Mac

Re: Stealing settings from Mail.app

2010-06-01 Thread Alastair Houghton
On 1 Jun 2010, at 00:33, Jn wrote: That's a good point that I hadn't given much thought to what happens when the net is down. I wasn't too worried about only supporting Mail.app because I was going to give them a way to also enter their smtp settings manually. But using your framework that

Re: POST request on iPhone

2010-06-01 Thread Alastair Houghton
On 1 Jun 2010, at 11:03, Joshua Tucker wrote: has anyone got any sample code for a POST request for interfacing with an API such as the DirectAdmin API? Ideally, something that works like this in Obj-C (example is in PHP) would be great: http://www.directadmin.com/sample_api.txt. The API

Re: Uncheck property list checkbox option for pre-upgrade

2010-06-01 Thread Alastair Houghton
On 1 Jun 2010, at 12:45, Banupriya K wrote: We are using package maker for our application. During upgrade the installer should retain the previous property list. Therefore i want to uncheck the property list checkbox for upgrade by default. please suggest is there any way to do it. Hi

Re: POST request on iPhone

2010-06-01 Thread Alastair Houghton
On 1 Jun 2010, at 12:59, Joshua Tucker wrote: I've contacted the DirectAdmin technical support team and they said I need to send the username:password encrypted as base64 in the HTTP headers. Does anyone know of the easiest way to put this in the HTTP headers? NSURLRequest lets you set

Re: dynamic resolution

2010-05-31 Thread Alastair Houghton
On 31 May 2010, at 14:03, Rafael Cerioli wrote: I guess you need the framework libobjc.A.dylib for that stuff. 1. That's a dylib (aka DLL, aka shared object), not a framework. 2. Since you're using Objective-C, that library is already going to be linked with your program (it's the Objective-C

Re: six things I wasn't able to do with Cocoa

2010-05-31 Thread Alastair Houghton
On 31 May 2010, at 11:36, Uli Kusterer wrote: *5)** **I **can't create a simple list* I did it the only way I could -- with a table that has one column, etc. Man that was painful for a simple list. Is there a better way? I have to admit I thought AppKit's way of handling lists was the

Re: Stealing settings from Mail.app

2010-05-31 Thread Alastair Houghton
On 28 May 2010, at 07:02, Chris Idou wrote: I've got an app that needs to send out emails. I'm trying to import mail settings from Mail.app. For some reason my keychain has passwords for smtp.gmail.com, but not for smtp.me.com. Does anyone know where Mail.app stores other passwords? Or why

Re: Notification of file system modification arrives too early?

2010-05-31 Thread Alastair Houghton
On 31 May 2010, at 12:20, Dave Keck wrote: Really ? I find the first comment in libproc.h pretty clear about it. If it was private in the strictest sense, the header wouldn't exist. Certainly since the header has existed since 10.5, Apple intends for someone to use it? I doubt it. Head

Re: UIView retain past drawing?

2010-05-31 Thread Alastair Houghton
On 30 May 2010, at 22:30, Brad Garton wrote: To answer my own question: draw to a bitmap offscreen, and then draw that into the UIView rect. The bitmap isn't cleared (unless done explicitly). Hi Brad, Depending on the application, it may be better to use a CGLayer rather than a

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Alastair Houghton
On 27 May 2010, at 20:43, Bill Appleton wrote: *1) I can't hide a file, or test if a file is hidden* I had to resort to FSGetCatalogInfo -- there is no way to do it through NSFileManager, etc. Right? chflags(), with UF_HIDDEN? And stat() to read the same? I don't think

Re: six things I wasn't able to do with Cocoa

2010-05-28 Thread Alastair Houghton
On 28 May 2010, at 18:25, James Walker wrote: On 5/27/2010 12:43 PM, Bill Appleton wrote: *1) I can't hide a file, or test if a file is hidden* I had to resort to FSGetCatalogInfo -- there is no way to do it through NSFileManager, etc. Right? Since there are several ways to hide a file,

Re: getting file creation date from NTFS

2010-05-24 Thread Alastair Houghton
On 24 May 2010, at 10:42, Paul Sanders wrote: The docs don't really *have to* say, though, because it's the only choice that makes any sense. Of course they do. Ambiguity like this just leads to confusion. And I know it's off topic, Let's take it off list then, rather than posting

[OT] Re: getting file creation date from NTFS

2010-05-24 Thread Alastair Houghton
On 24 May 2010, at 10:52, Paul Sanders wrote: Let's take it off list then, rather than posting off-topic stuff to cocoa-dev? What for? Because it chokes the list up with things that other people (who are interested in *COCOA*) are not interested in, that's what for. As far as I'm

Re: getting file creation date from NTFS

2010-05-23 Thread Alastair Houghton
On 23 May 2010, at 18:39, Paul Sanders wrote: Yes, although the stat structure only has the st_birthtimespec field if you build with 64-bit inodes enabled. This is the default on Snow Leopard or for 64-bit, but not for 32-bit on Leopard or earlier. I'm not certain, but I think you have to

Re: getting file creation date from NTFS

2010-05-23 Thread Alastair Houghton
On 23 May 2010, at 19:07, Paul Sanders wrote: At the BSD layer, getattrlist() is the way to go here, with the ATTR_CMN_CRTIME attribute. From http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man2/getattrlist.2.html: Not all volumes support

Re: getting file creation date from NTFS

2010-05-23 Thread Alastair Houghton
On 23 May 2010, at 21:21, Paul Sanders wrote: On sensible platforms, stat() returns UTC, as you'd expect. That statement I can now verify by experiment (which is good as I assumed that when I wrote the code). The docs do not say. OS X conforms to the SUSv3 specification, which says

Re: singleton design pattern

2010-05-19 Thread Alastair Houghton
On 18 May 2010, at 23:58, Abhinay Kartik Reddyreddy wrote: static NSMutableDictionary* uniqueInstance = nil; // the static variable has to be initialized before you enter the uniqueInstance method. Not true. Static variables are initialised to nil (or zero) automatically (it says so

Re: NSTask and piped commands

2010-05-18 Thread Alastair Houghton
On 18 May 2010, at 20:48, Stephen J. Butler wrote: On Tue, May 18, 2010 at 2:33 PM, appledev apple...@xs4all.nl wrote: I dont want to use a call to a bash script, because of sneaking in bad commands. But how should I handle this? That's only a real concern when you put user supplied data

Re: NSTask and piped commands

2010-05-18 Thread Alastair Houghton
On 18 May 2010, at 21:13, Jens Alfke wrote: On May 18, 2010, at 12:33 PM, appledev wrote: I dont want to use a call to a bash script, because of sneaking in bad commands. As others said, it’s not a problem here because the command line is entirely hardcoded. If you wanted to avoid

Re: NSTask and piped commands

2010-05-18 Thread Alastair Houghton
On 18 May 2010, at 20:33, appledev wrote: [task launch]; [task waitUntilExit]; NSData *data; result = [file readDataToEndOfFile]; This part is not safe. If the tasks output enough data to fill the pipe buffer (which may be of whatever size the kernel chooses to make

Re: NSTask and piped commands

2010-05-18 Thread Alastair Houghton
On 18 May 2010, at 21:35, Jens Alfke wrote: On May 18, 2010, at 1:27 PM, Alastair Houghton wrote: Something like the following should work, right? That looks right; but you’re proving my point that it’s easier just to do the filtering in native code :) Well, there is that too :-) Kind

Re: Problem mac os X version 10.6 when using sprinft

2010-05-10 Thread Alastair Houghton
On 10 May 2010, at 16:54, paul morel wrote: Hi everybody, thanks a lot for your help. Actually you were right it size a problem of size. I increased the size and it works. See, that worries me. The size was 20 because I thought that '\t' or other thing like that were considered

Re: Avoid drawing in half pixel

2010-05-06 Thread Alastair Houghton
On 5 May 2010, at 17:01, Simone Tellini wrote: you can turn it on/off according to your needs: ie. turn it off, draw vertical/horizontal lines that you don't want to become blurry, turn it on and draw the rest. I wouldn't be inclined to do that, actually. Much easier in the long run to use

Re: Strange Behavior

2010-02-07 Thread Alastair Houghton
On 6 Feb 2010, at 00:44, MARC BLATT wrote: I have the following code in viewWillAppear: for my iPhone dev project (iPhone Development SDK Book, Chapter 4, p.63): [snip] NSLog(@%@ sold %@ because %@, self.movie.title, [formatter stringFromNumber:self.movie.boxOfficeGross],

Re: objc_msgSend() tour

2010-02-04 Thread Alastair Houghton
On 4 Feb 2010, at 06:58, Bill Bumgarner wrote: Folks- I finally banged out part IV -- the 'slow path' odds/ends -- of my tour of objc_msgSend() on x86_64. If you want to know how method invocations works in instruction by instruction detail on x86_64, you might find it

Finder-like icon view (MIT license)

2010-02-02 Thread Alastair Houghton
Hi all, I thought I'd just post a link to some code I just posted on Google Code. It's been sitting on my disk for ages (since 2005, in fact), somewhat unloved and not quite complete, but I think it's still an interesting bit of code and hopefully someone will find it useful. Here's the URL:

Re: Finder-like icon view (MIT license)

2010-02-02 Thread Alastair Houghton
On 2 Feb 2010, at 10:51, Daniel DeCovnick wrote: I really like the rectangle that appears when you hold shift so you know what will be selected next when you press an arrow key. Can you turn off snap-to-grid? Yes, you can turn that off; there isn't much documentation, but the methods in

Re: What is the equivalent of SetSystemUIMode() in Leopard and above?

2010-01-27 Thread Alastair Houghton
On 27 Jan 2010, at 05:36, Charles Srstka wrote: Or you could just do something like this: if(floor(NSAppKitVersionNumber) NSAppKitVersionNumber10_5) { [NSApp setPresentationOptions:whatever]; } else { SetSystemUIMode(whatever); } You could also use if([NSApp

Re: Bundle and window server interaction

2010-01-18 Thread Alastair Houghton
On 18 Jan 2010, at 13:43, jonat...@mugginsoft.com wrote: Can anyone cast any light on the interaction between the bundle structure and the window server? The following modified Cocoa app main function displays a dialog when run as an app. If the executable is extracted from the bundle

Re: Bundle and window server interaction

2010-01-18 Thread Alastair Houghton
On 18 Jan 2010, at 14:30, jonat...@mugginsoft.com wrote: Quite possibly. Have you tried calling NSApplicationLoad() at the top of your main() function? Makes no difference as far as I can tell. There is a practical point here as I am trying to launch user interacting AppleScript from a

Re: Bundle and window server interaction

2010-01-18 Thread Alastair Houghton
On 18 Jan 2010, at 14:30, jonat...@mugginsoft.com wrote: On 18 Jan 2010, at 14:22, Alastair Houghton wrote: Quite possibly. Have you tried calling NSApplicationLoad() at the top of your main() function? Makes no difference as far as I can tell. There is a practical point here as I am

Re: Best practice example for a setup wizard?

2010-01-14 Thread Alastair Houghton
On 13 Jan 2010, at 23:19, PCWiz wrote: If you really want to do a wizard, this might be a good starting point: http://www.cimgf.com/2008/03/03/core-animation-tutorial-wizard-dialog-with-transitions/ Remembering that **they aren't called Wizards**. That's Windows terminology. Mac OS X

Re: Best practice example for a setup wizard?

2010-01-14 Thread Alastair Houghton
On 14 Jan 2010, at 12:37, Dave Keck wrote: As long as we're following Apple's example, I say bombard the user with ads and wizards until their eyes bleed. :) ...***Assistants***... Kind regards, Alastair. -- http://alastairs-place.net ___

Re: Best practice example for a setup wizard?

2010-01-14 Thread Alastair Houghton
On 14 Jan 2010, at 13:53, Ian Piper wrote: OK, perhaps I need to rethink how this works. Given that the underlying purpose is to authenticate the user to allow access to an encrypted database, would it make more sense for me to use the user's Mac OS X account credentials? Is there a way (I

Re: Differentiate FAT16 and FAT32

2010-01-11 Thread Alastair Houghton
On 10 Jan 2010, at 21:05, Matthias Arndt wrote: According to the sources for the FAT filesystem driver (which you can get from http://opensource.apple.com), you can look at f_fssubtype in the statfs structure, which you can retrieve using statfs() or similar. See man 2 statfs. This

Re: Differentiate FAT16 and FAT32

2010-01-11 Thread Alastair Houghton
On 11 Jan 2010, at 17:22, Matthias Arndt wrote: if (statfs([path cStringUsingEncoding:NSASCIIStringEncoding], fsInfo) == 0) [path cStringUsingEncoding:NSASCIIStringEncoding] is wrong. You want [path filesystemRepresentation], otherwise you will have problems if there are any non-ASCII

Re: Differentiate FAT16 and FAT32

2010-01-10 Thread Alastair Houghton
On 10 Jan 2010, at 20:04, Matthias Arndt wrote: In my app I have to differentiate between USB storage devices formatted with a MSDOS-FAT16 or with MSDOS-FAT32 file system. Because? Remember that the flavour of FAT in use is defined *entirely* by the number of clusters on the volume... (i.e.

Re: Flicker Free Drawing

2010-01-08 Thread Alastair Houghton
On 8 Jan 2010, at 21:06, David Blanton wrote: I guess I just choose Buffered in Window Attributes in IB. Buffered is the default. So by default, you do precisely nothing. You can still achieve flickery drawing if you try hard, of course, but you have to do it deliberately one way or another.

Re: Hiding the Window Content View

2010-01-08 Thread Alastair Houghton
On 8 Jan 2010, at 20:46, David Blanton wrote: I am just trying to find the best way to do rapid drawing with no flicker. The answer to that question depends rather on what you mean by rapid and on what you're trying to draw. The fastest way to draw on Mac OS X is generally OpenGL; it's also

Re: iPhone: validate a NSString for US zipcode

2010-01-07 Thread Alastair Houghton
On 7 Jan 2010, at 16:11, Eric E. Dolecki wrote: I've been googling but haven't seen yet how to best validate a 5-digit zipcode for use in the US (without using a webservice). I have the NSString, I just need to validate it. I know zero RegExp, is there a formatter I can use? It might be

Re: Path comparison and case sensitivity

2010-01-06 Thread Alastair Houghton
On 6 Jan 2010, at 05:39, Ken Thomases wrote: On Jan 5, 2010, at 6:51 PM, Rob Keniger wrote: Should Cocoa applications always assume that the filesystem is case-insensitive when comparing path strings? Surely this could lead to problems if the user has formatted a volume with a

Re: Turn off font hinting?

2010-01-05 Thread Alastair Houghton
On 4 Jan 2010, at 21:47, Sander Stoks wrote: I wrote some code to draw an NSString rotated by an arbitrary angle, which can be manipulated interactively. The results are surprisingly bad (compared to how good font rendering is in general on the Mac). Most notably, the character positions

Re: NSBezierPath linewidth not correct

2010-01-04 Thread Alastair Houghton
On 2 Jan 2010, at 23:42, Rob Keniger wrote: On 02/01/2010, at 8:58 PM, Gustavo Pizano wrote: No worries, I modify it and in fact it does work, but the background images will display a .5 gap between along the horizon between the images that conform the background, so I will put just a .5

<    1   2   3   4   5   >