Re: I can't find it in the docs so I know I'm missing it some where

2009-09-02 Thread Michael Ash
On Wed, Sep 2, 2009 at 4:41 PM, Harry Jordan wrote: > There' s a good reason to enforce the 99 cent rule. Imagine a scenario in > which a user downloads an app that is advertised as free, only to find that > it's crippled beyond use without a subscription to a service or an internal > upgrade. That

Re: NSDocumentController didCloseAllSelector

2009-09-30 Thread Michael Ash
On Wed, Sep 30, 2009 at 9:39 PM, Adam R. Maxwell wrote: > > On Sep 30, 2009, at 7:15 PM, Graham Cox wrote: > >> >> On 01/10/2009, at 12:06 PM, Adam R. Maxwell wrote: >> >>> That should bring you to a helpful discussion titled "Advice for >>> Overriders of Methods that Follow the >>> delegate:didSo

Re: Understanding CFMakeCollectable (was: EXC_BAD_ACCESS when -fobjc-gc)

2009-10-07 Thread Michael Ash
On Wed, Oct 7, 2009 at 5:48 PM, Gabriel Zachmann wrote: > Thanks for your response. > >> No. CFRetain & CFRelease continue to work the same regardless of GC. That >> is, the reference count field still exists, but Obj-C objects in GC start >> life with a 0 retain count and -retain/-release/-retain

Re: Screensaver won't run on 10.6 even after porting to 64-bit

2009-10-11 Thread Michael Ash
On Sun, Oct 11, 2009 at 4:08 PM, Clark Cox wrote: > On Sun, Oct 11, 2009 at 1:06 PM, Ben Haller > wrote: >> On 11-Oct-09, at 3:52 PM, Kyle Sluder wrote: >> >>> On Oct 11, 2009, at 12:44 PM, Ben Haller >>> wrote: >>> OK, makes sense.  My only question: what's the best way to switch at c

Re: Property List Format vs NSKeyedArchiver Format

2009-10-14 Thread Michael Ash
On Tue, Oct 13, 2009 at 6:24 PM, Ken Ferry wrote: > On Tue, Oct 13, 2009 at 2:40 PM, Jens Alfke wrote: > >> >> On Oct 13, 2009, at 1:08 PM, Bridger Maxwell wrote: >> >>  I would like to read more on the NSKeyedArchiver XML format, but can't >>> find >>> documentation on it. Is it open? >>> >> >>

Re: Can I make custom pasteboard type for an object reference?

2009-10-15 Thread Michael Ash
On Wed, Oct 14, 2009 at 8:21 PM, Rick Mann wrote: > I'm trying to implement a library like Interface Builder's. When the user > drags an item out of the library and onto one of my custom views, it should > instantiate an object and place it in the view accordingly. > > I'm trying to implement the

Re: GC and atomic getters/setters

2009-10-17 Thread Michael Ash
On Sat, Oct 17, 2009 at 12:18 PM, Bill Bumgarner wrote: > > On Oct 17, 2009, at 8:38 AM, BJ Homer wrote: > >> But assuming that you >> wanted it there in the first place, why does the GC version not need the >> synchronization? > > Under GC, object reference assignments -- scanned pointer assignme

Re: GC and atomic getters/setters

2009-10-17 Thread Michael Ash
On Sat, Oct 17, 2009 at 1:19 PM, Michael Ash wrote: > On Sat, Oct 17, 2009 at 12:18 PM, Bill Bumgarner wrote: >> >> On Oct 17, 2009, at 8:38 AM, BJ Homer wrote: >> >>> But assuming that you >>> wanted it there in the first place, why does the GC v

Re: GC and atomic getters/setters

2009-10-17 Thread Michael Ash
On Sat, Oct 17, 2009 at 9:32 PM, Kyle Sluder wrote: > On Sat, Oct 17, 2009 at 6:20 PM, Ken Ferry wrote: >> The issue concerns the order of in which changes to memory are observable by >> other processors. > > Okay, and the read example is immune because you have to read the > address before you c

Re: 10.4 System Preferences Cannot Find Its Main Window When Launched by a Pane Bundle

2009-10-29 Thread Michael Ash
On Wed, Oct 28, 2009 at 7:18 PM, Grant Erickson wrote: > I am working on a preference pane and in order to accommodate differences > among 10.4 and 10.5 and later without hard-coding widths, I call my own > [self resizeView] from mainViewDidLoad to adjust the view width as > appropriate: > >    -

Re: Create an NSCharacterSet constant

2009-11-02 Thread Michael Ash
On Mon, Nov 2, 2009 at 12:29 AM, Kyle Sluder wrote: > On Sun, Nov 1, 2009 at 9:19 PM, John Joyce > wrote: >> Is it possible to create an NSCharacterSet constant? > > No.  By definition, constants are assigned values at compile time. > Objects other than strings can only be created at runtime.  Th

Re: How can a plug-in bundle get access to its own resources?

2009-11-10 Thread Michael Ash
On Tue, Nov 10, 2009 at 6:57 AM, Kiel Gillard wrote: > On 10/11/2009, at 10:51 PM, Benjamin Miller wrote: > >> On 10 Nov 2009, at 11:45, Motti Shneor wrote: >> >>> This may seem a silly question, but I cannot find any decent way for my >>> Plug-In bundle code to access its own resources! >>> >>> .

Re: CPU sampling and +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]

2009-11-14 Thread Michael Ash
On Fri, Nov 13, 2009 at 1:28 PM, Paulo Andrade wrote: > Hello, > > I'm using the CPU sampler template. > > Here (http://1wzi.sl.pt) is a sample of a very simple run to prove my point. > > Here's how I collected it: > - Start the app and let it fully launch (it does a few request at boot) > - Attac

Re: Performance

2009-11-16 Thread Michael Ash
On Mon, Nov 16, 2009 at 1:14 AM, Chris Carson wrote: > The application runs pretty well, and running it through the Leaks instrument > there are no leaks except for 16-bytes when the application is first starting > caused by IOUSBLib. However, looking at it in the Activity Monitor, the real > m

Re: Key-Value Observing speed

2010-03-12 Thread Michael Ash
On Fri, Mar 12, 2010 at 5:41 PM, Gwynne Raskind wrote: > On Mar 12, 2010, at 4:52 PM, Peter Ammon wrote: >>> While profiling a project I'm working on, I found that while most of my >>> time was being spent in glFlush() (which is completely expected for an >>> OpenGL-based game), a non-trivial am

Re: mount dmg disk

2010-03-14 Thread Michael Ash
On Sun, Mar 14, 2010 at 8:42 PM, Kyle Sluder wrote: > On Sun, Mar 14, 2010 at 1:41 PM, gMail.com wrote: >> I had to modify just one thing, then it worked: since we invoke directly >> hdiutil, I removed "hdiutil" from the args, so now it looks like: > > This is incorrect. Unix convention requires

Re: mount dmg disk

2010-03-15 Thread Michael Ash
On Mon, Mar 15, 2010 at 12:33 AM, Kyle Sluder wrote: > On Sun, Mar 14, 2010 at 9:50 PM, Michael Ash wrote: >> NSTask is also not like calling the exec family of functions. NSTask >> implicitly passes the target path as the first argument, and puts your >> arguments

Re: User-space threads and NSAutoreleasePool

2010-03-18 Thread Michael Ash
On Wed, Mar 17, 2010 at 11:11 PM, BJ Homer wrote: > Okay, so that's the setup. Obviously, the problem is that the two user-space > threads are sharing an autorelease pool stack that is intended to be > thread-local. My question, then, is whether there exists a way to get and > set the autorelease

Re: User-space threads and NSAutoreleasePool

2010-03-18 Thread Michael Ash
On Thu, Mar 18, 2010 at 12:05 PM, Jens Alfke wrote: > > On Mar 18, 2010, at 8:35 AM, Michael Ash wrote: > >> Cocoa keeps around a lot of thread-specific state. In addition to >> autorelease pools, you also have exception handlers, graphics >> contexts, and possibly oth

Re: Detecting if you're being debugged

2010-03-19 Thread Michael Ash
On Thu, Mar 18, 2010 at 8:14 AM, Jeremy Pereira wrote: > > On 18 Mar 2010, at 11:48, Peter Hudson wrote: > >> Technical Q&A QA1361 >> Detecting the Debugger >> >> Does this code report on my app being debugged by any third party, even when >> the app has been stripped of symbols ? >> Would it wor

Re: Trouble forking my project

2010-03-23 Thread Michael Ash
On Tue, Mar 23, 2010 at 8:48 PM, Graham Cox wrote: > I'm having a problem making settings in a new target apply in my code. I'm > sure this is really simple and I'm missing something obvious. > > The point is to permit me to release bugfixes to my existing codebase while > moving it forward in a

Re: The fastest way to render bitmaps to screen in Cocoa on Snow Leopard?

2010-03-25 Thread Michael Ash
On Wed, Mar 24, 2010 at 10:02 AM, Oleg Krupnov wrote: > Hi, > > I need to open a bitmap file, perhaps do some filtering, and render it > to the screen with the maximum possible performance. > > I am allowed to assume Snow Leopard. > > Now I am a bit confused what technology (-ies) I should use to

Re: "-forwardInvocation:" like NSInvocation creation

2010-03-30 Thread Michael Ash
On Mon, Mar 29, 2010 at 2:15 PM, Philip Mötteli wrote: > Hi, > > > Am 29.03.2010 um 18:52 schrieb A.M.: >> >> On Mar 29, 2010, at 11:07 AM, Philip Mötteli wrote: >> >>> I need to temporary save the invocation of a method. For that, I just need >>> to put the stack frame into an NSInvocation. Unfo

Re: Terminating subtasks reliably

2010-04-02 Thread Michael Ash
On Thu, Apr 1, 2010 at 7:19 PM, Dave Keck wrote: >>> Look like a race condition. The man page says getppid() will not fail, but >>> not what happens after the parent dies. I will test this. >> >> If the parent dies, the process becomes the child of launchd. For a quick >> fix I checked for the par

Re: Alternative Location of Cocoa ID3 Framework??

2010-04-07 Thread Michael Ash
On Wednesday, April 7, 2010, Jens Alfke wrote: > > FYI to the OP: If you haven't worked with LGPL code before, be aware that you > must build it into a separate dynamic library or framework that you can > bundle inside your app. Statically linking the code into your app violates > the LGPL lice

Re: [NSMutableArray array]

2010-04-08 Thread Michael Ash
On Thu, Apr 8, 2010 at 1:21 PM, Patrick M. Rutkowski wrote: > Agreed, but there's always the danger the +array method, which might > actually be implemented in NSArray.m, will not properly initialize the > more specific NSMutableArray object. > > Of course, in this specific case that's the case, b

Re: Zeroing out instance variables

2010-04-18 Thread Michael Ash
On Sun, Apr 18, 2010 at 2:09 AM, Kyle Sluder wrote: > On Sat, Apr 17, 2010 at 8:29 PM, Ben Haller > wrote: >>  I don't think I'm crazy about this.  There are many different subclasses, >> so each subclass would have its own corresponding struct, and every ivar >> access would go through an indire

Re: Introspecting the current method

2010-04-18 Thread Michael Ash
On Sun, Apr 18, 2010 at 10:15 PM, Dave DeLong wrote: > Yes, code should obviously be written with this knowledge in mind.  The use > case I have for it is for macros.  I like to use a debugging macro like the > following to ensure that methods are getting called (without having to break > execu

Re: Zeroing out instance variables

2010-04-18 Thread Michael Ash
On Sun, Apr 18, 2010 at 10:58 PM, Kyle Sluder wrote: > On Apr 18, 2010, at 6:52 PM, Michael Ash wrote: > >> If by "indirected through the runtime" you mean "accesses one global >> variable to get an offset". It does not, as one might take your >> co

Re: Introspecting the current method

2010-04-19 Thread Michael Ash
On Mon, Apr 19, 2010 at 3:27 AM, Jean-Daniel Dupas wrote: > > Le 19 avr. 2010 à 04:21, Michael Ash a écrit : > >> On Sun, Apr 18, 2010 at 10:15 PM, Dave DeLong wrote: >>> Yes, code should obviously be written with this knowledge in mind.  The use >>> case I have

Re: NSApplicationMain question

2010-04-22 Thread Michael Ash
On Thu, Apr 22, 2010 at 6:45 PM, Bill Appleton wrote: > hi all, > > thanks for the great advice > > for better or worse i am porting a large piece of enterprise software from > carbon/windows to cocoa/windows > > most of the code is platform independent, but i can't make big changes to > the overa

Re: NSApplicationMain question

2010-04-27 Thread Michael Ash
On Tue, Apr 27, 2010 at 5:53 AM, Paul Sanders wrote: >> Um, actually the menu bar is on the primary display.  That's >> the definition of the primary display >> -- it's the one with the menu bar.  Did you perhaps mean the >> built-in display? > > I was speaking from memory.  My recollection is tha

Re: NSApplicationMain question

2010-04-27 Thread Michael Ash
On Tue, Apr 27, 2010 at 11:29 AM, Thomas Clement wrote: > > On Apr 27, 2010, at 4:48 PM, Michael Ash wrote: > >> On Tue, Apr 27, 2010 at 5:53 AM, Paul Sanders >> wrote: >>>> >>>> Um, actually the menu bar is on the primary display.  That's >&

Re: Fastest way to check for descendants of an object

2010-04-27 Thread Michael Ash
On Tue, Apr 27, 2010 at 2:05 PM, Keith Blount wrote: > Indeed, I believe that's my problem - currently when I add objects to my > children array I do things such as [[myNode children] addObject:newNode], > meaning I have nowhere to catch it. I'll update my code to add some accessors > as you su

Re: NSKeyedArchiver and NSPoints

2010-04-28 Thread Michael Ash
On Wed, Apr 28, 2010 at 3:31 PM, Quincey Morris wrote: > On Apr 28, 2010, at 11:42, Kyle Sluder wrote: > >> Er? Unless there's some documentation about the precision of >> NSStringFromPoint being less than that of the members, >> NSStringFromPoint could certainly include just as much precision as

Re: NSTask objectalloc problem

2010-04-29 Thread Michael Ash
On Wed, Apr 28, 2010 at 2:16 PM, Tom Foutz wrote: > I am trying to run a back-up type of unix script whenever a file > changes in the directory.  However, my implementation, when viewed in > "Instruments" with "ObjectAlloc", demonstrates an ever-increasing > number of living objects. > > A problem

Re: NSKeyedArchiver and NSPoints

2010-04-29 Thread Michael Ash
On Thu, Apr 29, 2010 at 12:55 AM, Quincey Morris wrote: > On Apr 28, 2010, at 20:49, Michael Ash wrote: > >> Actually, while there are finite decimal numbers with no finite binary >> representation, the reverse is not true. Every binary number can be >> represented by a

Re: crash on altering NSMutableArray

2010-05-01 Thread Michael Ash
On Sun, May 2, 2010 at 1:50 AM, James Maxwell wrote: >> On May 1, 2010, at 21:22, James Maxwell wrote: >> >>> If I drop into the debugger arbitrarily, before the crash, and check this >>> same array, I noticed that it is nicely filled with NSCFNumbers. But, >>> strangely, there are too many. >>

Re: Compress / Uncompress

2010-05-03 Thread Michael Ash
On Sun, May 2, 2010 at 10:09 PM, wrote: > If a director is compressed in the Finder, and added to an app's resources, > and the app wants to copy the compressed director to a location and > uncompress the directory what is the  correct process. > > I have done unzip and uncompress as NSTask but n

Re: [[NSFileManager alloc] init] considered thread-safe

2010-05-05 Thread Michael Ash
On Wed, May 5, 2010 at 2:37 AM, Ken Ferry wrote: > On Tue, May 4, 2010 at 11:27 PM, Quincey Morris > wrote: > >> I'm not concerned with the issue of delegates. My question is whether a >> single (delegate-less) instance of NSFileManager can be used simultaneously >> from multiple threads, or wheth

Re: [[NSFileManager alloc] init] considered thread-safe

2010-05-05 Thread Michael Ash
On Wed, May 5, 2010 at 2:29 PM, Jens Alfke wrote: > > On May 5, 2010, at 8:50 AM, Michael Ash wrote: > >>> Delegates are the only reason the doc says anything other than "go nuts". >>>  This is what both Jens and I were trying to say. >> >> Is th

Re: iPhone resource cache - memory question

2010-05-06 Thread Michael Ash
On Thu, May 6, 2010 at 2:12 PM, Jens Alfke wrote: > An intermediate level would be if the library loads the _compressed_ audio. > This is a lot less memory usage. It may even memory-map the file, which > wouldn't affect your process's heap space at all. (I know the iPhone doesn't > have VM, but I'

Re: isKindOfClass:

2010-05-08 Thread Michael Ash
On Sat, May 8, 2010 at 5:14 PM, Sherm Pendley wrote: > On Sat, May 8, 2010 at 3:51 PM, Kevin Callahan wrote: >> isKindOfClass: is an instance method and doesn't work on a class you get >> from NSClassFromString(). > > Because NSObject is a root class (i.e. it has no superclass), you > *can* send

Re: [iPhone] How to create a unique string

2010-05-13 Thread Michael Ash
On Thu, May 13, 2010 at 10:56 AM, Thomas Davie wrote: > > On 13 May 2010, at 15:33, Eric Gorr wrote: > >> So long as it is ok for the string to be unique for the network the user is >> on only. From the docs: >> >> The ID includes the host name, process ID, and a time stamp, which ensures >> tha

Re: [iPhone] How to create a unique string

2010-05-13 Thread Michael Ash
On Thu, May 13, 2010 at 11:52 AM, Louis Gerbarg wrote: > On May 13, 2010, at 11:05 AM, Michael Ash wrote: > >> On Thu, May 13, 2010 at 10:56 AM, Thomas Davie wrote: >>> >>> On 13 May 2010, at 15:33, Eric Gorr wrote: >>> >>>> So long as it is

Re: [[NSFileManager alloc] init] considered thread-safe

2010-05-14 Thread Michael Ash
On Fri, May 14, 2010 at 1:12 PM, Ken Ferry wrote: > On Wed, May 5, 2010 at 11:33 AM, Michael Ash wrote: >> >> On Wed, May 5, 2010 at 2:29 PM, Jens Alfke wrote: >> > >> > On May 5, 2010, at 8:50 AM, Michael Ash wrote: >> > >> >>> Delegates

Re: Encode a 'Class' type using NSValue

2010-05-14 Thread Michael Ash
On Fri, May 14, 2010 at 5:45 AM, Billy Flatman wrote: > Hi Quincey, > > Thanks for you help. I am trying to pass the class reference around for drag > and drop, I think i'll try your idea of converting the pointer to a number, The best way to pass arbitrary pointers around your app for drag and

Re: [[NSFileManager alloc] init] considered thread-safe

2010-05-14 Thread Michael Ash
On Fri, May 14, 2010 at 4:46 PM, Ken Ferry wrote: >> Regarding that 10.5 singleton safety bug, is this documented anywhere? >> It seems like there are a lot of minor bugs which get fixed in later >> OS revisions but persist in earlier ones that we often have to support >> for a while. There are of

Re: Drawing invisible window. was Re: Forcing ordered-out-window to adjust position

2010-05-15 Thread Michael Ash
On Sat, May 15, 2010 at 3:48 PM, Philip White wrote: > > On May 15, 2010, at 2:31 PM, Philip White wrote: > > I wrote this: > >> -(void)display >> { >>       /* seems to be unnecessary? >>       NSGraphicsContext *context = [NSApp context]; >>       NSGraphicsContext *oldContext = [NSGraphicsConte

Re: Notifications on main thread

2010-05-18 Thread Michael Ash
On Tue, May 18, 2010 at 12:58 PM, Nick Zitzmann wrote: > > On May 18, 2010, at 8:34 AM, Jonny Taylor wrote: > >> - I could try acquiring the NSNotificationQueue for the main thread, but >> there does not appear to be a standard way of doing that. I have seen this >> suggested as a strategy elsew

Re: NSKeyedArchiver: confusion

2010-05-18 Thread Michael Ash
On Tue, May 18, 2010 at 5:21 PM, Matthew Weinstein wrote: > My mistake for not being clear: > I have an NSData in an object; > I read that data using a keyedArchiver to get to the chunk I want. > > I want to replace a chunk of that data with another using the same key. (the > file part is immater

Re: isKindofClass with NSData and NSKeyUnarchiver

2010-05-28 Thread Michael Ash
On Fri, May 28, 2010 at 7:40 PM, Philip Vallone wrote: > Hi, > >> Wait, are you archiving and unarchiving data over a network? That’s a bad >> idea unless you’re extremely careful. The problem is that a malicious peer >> can send you an archive that expands into any codable object, not just the

Re: authenticating peers

2010-05-29 Thread Michael Ash
On Fri, May 28, 2010 at 10:34 PM, Jens Alfke wrote: > > On May 28, 2010, at 6:59 PM, Michael Ash wrote: > >> An attacker can execute a man-in-the-middle attack... >> An attacker can simply impersonate your app... >> Neither of these can be defended agains

Re: authenticating peers

2010-05-29 Thread Michael Ash
On Sat, May 29, 2010 at 3:04 PM, Jens Alfke wrote: > This is rapidly heading off-topic, but: > On May 29, 2010, at 4:15 AM, Michael Ash wrote: > >> Man-in-the-middle: if I execute the attack the first time you talk to >> a given peer, you have no way of detecting me. > &g

Re: Simulating app termination

2010-06-01 Thread Michael Ash
On Tue, Jun 1, 2010 at 3:16 PM, John Joyce wrote: > > On Jun 1, 2010, at 2:09 PM, has wrote: > >> lorenzo7620 wrote: >> >>> My question at this point is not about the dialog not displaying, not yet >>> anyway, but how to tell my app to quit without actually restarting or >>> shutting down the comp

Re: Simulating app termination

2010-06-02 Thread Michael Ash
On Tue, Jun 1, 2010 at 3:34 PM, Kyle Sluder wrote: > On Tue, Jun 1, 2010 at 12:26 PM, Michael Ash wrote: >> If your goal is to simulate shutdown/restart termination, this won't >> work; the system does not send signals to your app to kill it during >> those situation

Re: nibs don't know about protocols?

2010-06-02 Thread Michael Ash
On Wed, Jun 2, 2010 at 11:00 AM, Matt Neuburg wrote: > On or about 6/1/10 12:01 PM, thus spake "Kyle Sluder" > : > >> On Tue, Jun 1, 2010 at 11:00 AM, Matt Neuburg wrote: >>> So... Are nibs just ignorant of protocols? >> >> I don't believe the nib loading machinery checks protocol conformance >>

Re: [SOLVED] Delayed -dealloc occurs on worker thread if object is "working".

2010-06-04 Thread Michael Ash
On Fri, Jun 4, 2010 at 11:27 AM, Jerry Krinock wrote: > > On 2010 Jun 02, at 10:48, BJ Homer wrote: > >> detachNewThreadSelector:target:withObject: retains both the target and the >> object. > > Thank you, BJ.  That explains everything. > > On 2010 Jun 02, at 11:12, Jens Alfke wrote: > >> It’s re

Re: changing NSTextView text colour

2010-06-06 Thread Michael Ash
On Sun, Jun 6, 2010 at 10:21 AM, James Maxwell wrote: > I have a NSTextView that's displaying MIDI info from my app's current MIDI > input device. I show this info in a couple of places - one is in a "MIDI > Setup" type window, and the other is in an Inspector window. I want the > Inspector win

Re: BOOL returned via -performSelctor: not BOOL on 64-bit system

2010-06-08 Thread Michael Ash
> I concede that you're technically correct. But pragmatically, the CPU > register used to return integer and pointer values to the caller has always > been the same register for both Motorola and Intel processors since as long > as I can remember programming in C -- and that's been awhile. No

Re: Design Option: Exception handling vs Code Testing....

2010-06-10 Thread Michael Ash
On Thursday, June 10, 2010, Kyle Sluder wrote: > On Thu, Jun 10, 2010 at 1:58 PM, Frederick C.Lee > wrote: >> Greetings: >>    I have a situation where I need to access a member of a mutable array >> (max 4 members). >> Sometimes I could get an out-of-bounds exception, if for example, I try to

Re: Incomplete rendering returned from glReadPixels

2010-06-22 Thread Michael Ash
On Tue, Jun 22, 2010 at 9:25 AM, Ben Haller wrote: >  It's a little weird because this method gets called sometimes on a view > that is not yet installed in a window, so I just make a window then and > there.  (This is run in a headless command-line app, I ought to mention.) >  And yes, I don't bo

Re: changes to NSView's frame in its window

2010-06-23 Thread Michael Ash
On Wed, Jun 23, 2010 at 1:33 PM, Alexander Cohen wrote: > Hello, > > I have a view in an NSScrollView's document view that has a small child > window attached to it, meaning the window follows that view wherever it goes. > But when i scroll the scrollview, not much changes for that view. So i'm

Re: How tell tell if an NSNumber was initialized from a float or int?

2010-06-26 Thread Michael Ash
On Sat, Jun 26, 2010 at 12:45 PM, Jaime Magiera wrote: > Hello, > > The list search keeps timing out for me, and web searches are not finding > anything. I can see how to tell if an NSNumber was initialized with an int or > boolean (NSCFNumber vs. NSCFBoolean). However, I can't figure out how to

Re: Unstuffing my build

2010-06-28 Thread Michael Ash
On Mon, Jun 28, 2010 at 6:09 AM, Graham Cox wrote: > > On 28/06/2010, at 7:40 PM, Graham Cox wrote: > >> I recently switched my project from using the 10.5 Base SDK to the 10.6 SDK >> (but with minimum deployment target 10.5). >> >> My project links to libcrypto by adding -lcrypto to "Other Linke

Re: inference of block return type

2010-06-28 Thread Michael Ash
On Mon, Jun 28, 2010 at 4:42 PM, Tony Romano wrote: > Did you happen to read this link?  It's clearly documented in the section > Declaring and Using a Block.  HTH. > > http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Blocks/Articles/00_Introduction.html I see this part: "If

Re: Unstuffing my build

2010-06-28 Thread Michael Ash
On Mon, Jun 28, 2010 at 11:39 AM, Kyle Sluder wrote: > On Mon, Jun 28, 2010 at 7:58 AM, Michael Ash wrote: >> If Apple broke it, they would break every single app built against the >> 10.5 SDK, so I think you're pretty safe. > > Don't be so sure. 10.6 broke OmniOut

Re: inference of block return type

2010-06-28 Thread Michael Ash
On Mon, Jun 28, 2010 at 4:48 PM, Bill Bumgarner wrote: > > On Jun 28, 2010, at 1:45 PM, Michael Ash wrote: > >> But I was unable to find any discussion of HOW you explicitly declare >> the return value of a block expression. > > ^ () { }; Sure, but is this documente

Re: Unstuffing my build

2010-06-28 Thread Michael Ash
On Mon, Jun 28, 2010 at 9:12 PM, Kyle Sluder wrote: > On Jun 28, 2010, at 5:52 PM, Graham Cox wrote: > >> Isn't there a way to link against the "latest", whatever it is? Since >> there's a symlink for that, at least there's an access point in the file >> system. I realise that it still has to r

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

2010-06-30 Thread Michael Ash
On Wed, Jun 30, 2010 at 11:11 AM, Alastair Houghton wrote: > 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

Re: Calling javascript from Cocoa 'facelessly'

2010-06-30 Thread Michael Ash
On Wed, Jun 30, 2010 at 1:01 PM, Geoffrey Holden <45rpmli...@googlemail.com> wrote: > I realize that this is a hell of a big query, and I'm not entirely sure that > I've given enough information for anyone to help answer it.  At the very > least, I guess I'm hoping for a reference to some really

Re: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Michael Ash
On Wed, Jun 30, 2010 at 5:44 PM, Dave Carrigan wrote: > > On Jun 30, 2010, at 2:35 PM, Laurent Daudelin wrote: > >> Well, isn't -respondsToSelector: an instance method? > > > if ([[Someclass class] respondsToSelector:@selector(classSelector)]) { >        // yup > } An extremely minor nitpick: the

Re: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Michael Ash
On Thu, Jul 1, 2010 at 12:05 PM, Michael Ash wrote: > An extremely minor nitpick: the use of +class here is necessary. Of course I meant to write that the use of +class here is UNnecessary. Sigh. Mike ___ Cocoa-dev mailing list (Cocoa-

Re: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Michael Ash
On Thu, Jul 1, 2010 at 1:30 PM, Jonathon Kuo wrote: > > On Jul 1, 2010, at 9:49 AM, Kyle Sluder wrote: > >> On Jul 1, 2010, at 9:42 AM, Jonathon Kuo >> wrote: >> >>> On Jul 1, 2010, at 7:56 AM, Matt Neuburg wrote: >>> "Instance methods defined in a root class can be performed both by

Re: iOS4: VOIP App

2010-07-02 Thread Michael Ash
On Fri, Jul 2, 2010 at 6:49 AM, Angelica Grace Tanchico wrote: > > > Hello Again, > > As stated in iPhone App Programming Guide Document, below are the interfaces > that can be used to configure VOIP: > - NSInputStream and NSOutputStream > - NSURLRequest > - CFReadStreamRef and CFWriteStreamRef >

Re: How to catch [NSEvent dealloc]?

2010-07-07 Thread Michael Ash
On Wed, Jul 7, 2010 at 3:53 PM, Paul Sanders wrote: > I have a problem.  I need to know when an NSApplicationDefined NSEvent is > deallocated, because it contains a reference to an object in data1 and I want > to release that object at that time.  Problem is, you can't subclass NSEvent > becaus

Re: static analyzer

2010-07-07 Thread Michael Ash
On Wed, Jul 7, 2010 at 2:33 PM, Matt Neuburg wrote: > On or about 7/7/10 11:17 AM, thus spake "Bill Bumgarner" : > >> I missed the OP's post >> >> If the static analyzer is barfing up a false positive, please report it >> (http://bugreport.apple.com/ works fine). > > Is that generally true? I

Re: static analyzer

2010-07-07 Thread Michael Ash
On Wed, Jul 7, 2010 at 8:41 PM, Matt Neuburg wrote: > On Wed, 7 Jul 2010 17:54:58 -0400, Michael Ash said: >>> I get a false positive in *any* >>> of my apps that uses NSURLConnection, for example: >>> >>> NSURLConnection* con = [[NSURLConnection alloc

Re: How to catch [NSEvent dealloc]?

2010-07-07 Thread Michael Ash
On Wed, Jul 7, 2010 at 6:34 PM, Paul Sanders wrote: >> If you can require 10.6 (or iOS 4, maybe?) then you can use the new >> associated object API. Use objc_setAssociatedObject to attach your >> object to the NSEvent object, and the runtime will automatically take >> care of destroying it for you

Re: NSPreferencePane and sheets

2010-07-09 Thread Michael Ash
On Fri, Jul 9, 2010 at 7:21 PM, Dave DeLong wrote: > Hi everyone, > > I'm working on a preference pane and am having issues getting some sheets to > work. > > I have a button that executes: > > NSOpenPanel * open = [NSOpenPanel openPanel]; > //basic configuration > [NSApp beginSheet:open modalFor

Re: Custom control and cells

2010-07-09 Thread Michael Ash
On Fri, Jul 9, 2010 at 6:22 PM, Georg Seifert wrote: > Hi, > The thing is, I want to replicate the NSCollectionView but using cells > instead of views. The NSCollectionView has a lot of problems like performance >  and I couldn’t find a way to get the rect of the view of an item (both fixed > i

Re: Use of blocks

2010-07-12 Thread Michael Ash
On Mon, Jul 12, 2010 at 3:34 AM, Giannandrea Castaldi wrote: > Hi, > I want to use blocks to extract the min price and the max price from > an NSArray of trips. I've found the following way: > >    float minValue = 0.0; >    [someTrips enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, > BOOL *s

Re: NSPreferencePane and sheets

2010-07-12 Thread Michael Ash
On Mon, Jul 12, 2010 at 11:30 AM, Dave DeLong wrote: > That did the trick!  Thanks! > > Out of curiosity, under what circumstances for sheet displaying should I be > using the NSApplication method? That method is for when you're building a completely custom sheet. You'd build the sheet as an NSP

Re: Installation of screensaver fails

2010-07-16 Thread Michael Ash
On Fri, Jul 16, 2010 at 4:34 AM, Gabriel Zachmann wrote: >> In order for a screen saver to be fully compatible with Snow Leopard, you >> must add an Intel 64 slice that supports GC. The reason is because both the >> screen saver engine and System Preferences run as Intel 64 apps on Snow >> Leop

Re: Conversion of CFSocketCreateWithNative -> NSSocketPort

2009-11-27 Thread Michael Ash
On Fri, Nov 27, 2009 at 6:46 AM, René v Amerongen wrote: > Hello, > > I' am busy to make an old app up to date and want to use 100% 10.6 cocoa. > I have +75% percent done, but there is something what I can't figure out. > > Network calls are now using NSSocketPort, except a few that uses a fileHan

Re: My try/catch block isn't catching exceptions on 10.6

2009-11-28 Thread Michael Ash
On Fri, Nov 27, 2009 at 2:40 PM, Mark Allan wrote: > > On 27 Nov 2009, at 1:10 am, Dave Keck wrote: >>> >>> Exception Type:  EXC_BAD_ACCESS (SIGBUS) >> >> After a cursory reading of your code it looks like you're dealing with >> a threading issue involving myItemList or imminentList. Your comment

Re: iPhone and GC

2009-12-21 Thread Michael Ash
On Tue, Dec 22, 2009 at 8:54 AM, Lorenzo Thurman wrote: > Why can't iPhone apps use GC? Is it resources? Performance? Some combination > of the two or other reasons altogether? > Just curious, thanks. I know that this will be unsatisfying, but the real reason that iPhone apps can't use GC is beca

Re: Cancelable NSBlockOperations

2010-01-14 Thread Michael Ash
On Thu, Jan 14, 2010 at 3:15 PM, Jamie Hardt wrote: > On Jan 14, 2010, at 12:07 PM, Nick Zitzmann wrote: > >> Sorry, forgot that block operations, unlike invocation operations, don't >> take arguments. (Guess which one I use more often?) Yes, I'd try what you're >> proposing. > > It was a good t

Re: Blocking for input during a loop?

2010-01-20 Thread Michael Ash
On Tue, Jan 19, 2010 at 1:16 PM, Jens Alfke wrote: > > On Jan 19, 2010, at 6:10 AM, Per Bull Holmen wrote: > >> I have made one class called GameController, which is overridden by >> subclasses to control one specific type of game (PS: I will soon rename the >> class "Controller" to "MainControlle

Re: [iPhone] Implementing VOIP for iPhone App

2010-01-25 Thread Michael Ash
On Sun, Jan 24, 2010 at 10:17 AM, Tharindu Madushanka wrote: > Hi > > I am currently in 4th year student of University of Moratuwa, Sri Lanka. I > am thinking of creating iPhone client and server application (using Java) > for my final year project. I have following things in my mind. I would like

Re: How to access iTunes using cocoa

2010-01-26 Thread Michael Ash
On Tue, Jan 26, 2010 at 3:57 PM, Jens Alfke wrote: > > On Jan 26, 2010, at 12:45 PM, has wrote: > >> I think a big hit comes from the time it takes to evaluate Apple event >> object specifiers. The cost-benefit tradeoff of having a complex, >> query-driven IPC system is much poorer on OS X, both i

Re: Detect HFS path type and coerce to POSIX

2010-01-29 Thread Michael Ash
On Fri, Jan 29, 2010 at 6:03 AM, jonat...@mugginsoft.com wrote: > My app receives both HFS and POSIX NSString file paths back from AppleScript. > > On the AS Implementors list I was advised to coerce all the AS data to say > HFS before it is converted to an NSString. > > This will be my goal but

Re: Network Reachability

2010-01-30 Thread Michael Ash
On Fri, Jan 29, 2010 at 2:37 PM, Jens Alfke wrote: > > On Jan 29, 2010, at 11:12 AM, Laurent Daudelin wrote: > >> I was able to determined that when the connection is down, I found out that >> kSCNetworkFlagsConnectionRequired was true, so it seems to work. It's just >> difficult to determine wh

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Michael Ash
On Mon, Feb 1, 2010 at 3:05 AM, Rick Mann wrote: > I'd like to use a CALayer object as a key in a dictionary. The reason is that > when my app detects a hit in a layer, I need to quickly determine which > object I've associated with it. Since I can't store a reference to an > arbitrary object i

Re: updating NSView on separate thread

2010-02-01 Thread Michael Ash
On Mon, Feb 1, 2010 at 10:20 AM, Kyle Sluder wrote: > Ooh. So you need to perform this operation synchronously but still pole the > main thread (performing UI work is actually irrelevant; you need to run the > runloop to avoid the spinning beachball anyway). > > So in your override of -writeToURL:

Re: Sending messages without knowing number of args and types at compile time

2010-02-01 Thread Michael Ash
On Mon, Feb 1, 2010 at 6:30 AM, Per Bull Holmen wrote: > Hi > > I've been playing around with the idea of making a simple bridge between > Objective-C (running under Cocoa) and a script language. Not for the API, > that is, but for user defined classes and methods. For this reason, I'd like > t

Re: HELP! My app crashes on startup, with a very weird stack trace.

2010-02-02 Thread Michael Ash
On Tue, Feb 2, 2010 at 3:41 PM, Oleg Krupnov wrote: > Good point, Jesper. > > But in this case, how should I catch real unhandled exceptions and > send bug reports? What is the recommended best practice? As far as I know, you really can't. The problem is that what we would generally consider to b

Re: Help with NSData dataWithContentsOfURL

2010-02-03 Thread Michael Ash
On Wed, Feb 3, 2010 at 1:46 PM, Charles Srstka wrote: > On Feb 3, 2010, at 8:26 AM, cocoa-dev wrote: > >> Thanks Graham, here's what I'm thinking.  The documents for my app are >> fileWrappers.  Before the document is saved for the first time I can copy >> the files to a temp folder and during a

Re: Sheets, blocks and garbage collector

2010-02-06 Thread Michael Ash
2010/2/6 Frédéric Testuz : > Hi all, > > I'm beginning a new application targeting Snow Leopard only. So I want to use > the new tools (blocks) and garbage collection (GC). It will be my first > application using GC. > > I read some sites on GC and blocks. In the blog of Mike Ash I found some ver

Re: Uncaught exceptions not terminating my app

2010-02-07 Thread Michael Ash
On Sun, Feb 7, 2010 at 5:43 PM, Graham Cox wrote: > > On 08/02/2010, at 4:23 AM, Paul Sanders wrote: > >> do they really have 7 1/2 million bugs outstanding!? > > > No - this is the total number of reports ever submitted, assuming the > numbering started at 1, which is unlikely (maybe started at

  1   2   3   4   5   6   7   8   9   10   >