Re: Simple instance [[alloc] init] question.

2010-08-30 Thread Dave Geering
>>> // 1) >>> self.serialIDs = [[IRMSerialDetailsDO alloc] init]; >> >> The alloc method allocates an instance with a retain count of 1, and >> assigning it to the serialIDs property bumps it up to 2. In your >> dealloc method, you will [hopefully] send it a release message which >> puts it back at

Re: Simple instance [[alloc] init] question.

2010-08-30 Thread Dave Geering
> // 1) > self.serialIDs = [[IRMSerialDetailsDO alloc] init]; The alloc method allocates an instance with a retain count of 1, and assigning it to the serialIDs property bumps it up to 2. In your dealloc method, you will [hopefully] send it a release message which puts it back at 1, but this mean

Re: *** -[NSBundle Load] : Error loading code

2009-07-06 Thread Dave Geering
Hi Arjun, I know I'm a few weeks late but I only just yesterday had this same problem. It took me an hour or so but I finally clicked that my bundle was built for Intel and I was trying to load it on PowerPC. I think that the error is certainly not very informative, and I don't know whether or no

Re: Changing name of newly created NSDocument (instead of 'Untitled i')

2009-05-12 Thread Dave Geering
On Wed, May 13, 2009 at 12:07 PM, Dave Geering wrote: > On Wed, May 13, 2009 at 6:37 AM, Sean McBride wrote: >> Hi all, >> >> My doc-based application is able to import foreign file formats.  I do >> this by creating a new instance of my NSPersistentDocument subclass a

Re: Changing name of newly created NSDocument (instead of 'Untitled i')

2009-05-12 Thread Dave Geering
On Wed, May 13, 2009 at 6:37 AM, Sean McBride wrote: > Hi all, > > My doc-based application is able to import foreign file formats.  I do > this by creating a new instance of my NSPersistentDocument subclass and > populate it as needed. > > Works fine, but results in a document named "Untitled i".

Re: Text encoding issues

2009-05-12 Thread Dave Geering
On Wed, May 13, 2009 at 11:53 AM, Ryan Joseph wrote: > First question, why is the most obvious and best solution deprecated? > NSString's initWithContentsOfFile:  accepts no encoding and appears it is > getting the correct encoding in my tests.  Now they want us to use > initWithContentsOfFile:enc

Re: Create disk image files

2009-05-06 Thread Dave Geering
On Thu, May 7, 2009 at 8:52 AM, Jeff Johnson wrote: > Nope. > Yep. > There is none. It's reassuring that I was already heading the right way and that my fruitless search was inevitable, but it's a pity that the creation of disk images has not been exposed via a programming interface. I suppose it

Create disk image files

2009-05-06 Thread Dave Geering
Hi list, Is there any framework that can be used for the creation of disk image files, or do I have to resort to NSTask and hdiutil? I can't seem to find any documentation about programmatically creating disk image files. Cheers, Dave. ___ Cocoa-dev ma

Re: Binding the enabled attribute of each NSPopUpButtonCell

2009-05-05 Thread Dave Geering
On Wed, May 6, 2009 at 2:30 PM, Jerry Krinock wrote: > But then there would have to be another API to give it the items, and > another to localize the titles.  Don't wish for that. Well, it's still not too bad an idea for me. "optionTitle" is already localised in my custom object because it comes

Re: Binding the enabled attribute of each NSPopUpButtonCell

2009-05-05 Thread Dave Geering
On Wed, May 6, 2009 at 12:57 PM, Jerry Krinock wrote: > > Bindings are wonderful.  I try and use bindings whenever available -- except > when I'm dealing with menus. > > You see from Ken's response that there are things that just don't fit, or if > they do fit, it might take a long time to figure

Binding the enabled attribute of each NSPopUpButtonCell

2009-05-05 Thread Dave Geering
Hi List, I've got a problem when I try to bind the enabled attribute of an NSPopUpButtonCell. I have set up an NSArray of custom objects, these custom objects provide two keys that I want to use for binding (and other keys for other uses). The two keys are "optionTitle" and "optionAllowed". I hav

Re: Writable dir for non-admin user outside user's dir

2009-04-30 Thread Dave Geering
On Fri, May 1, 2009 at 8:52 AM, Erg Consultant wrote: > Is there any location on the system outside the current user's dir that is > writable outside the user's domain? I need my app to create some files when > run under a non-admin acct that I need to persist across boots/logins. But > every p

Re: NSString may not respond to a method in documentation?

2009-04-26 Thread Dave Geering
> I think this is weird because componentsSeparatedByCharactersInSet is in the > documentation for NSString It still works, but I don't know why xcode would > give me this warning. This method was added in Mac OS 10.5, so if you're using the Cocoa framework from the 10.4 SDK you will get that warn

Re: CF autorelease?

2009-04-23 Thread Dave Geering
On Fri, Apr 24, 2009 at 6:42 AM, Todd Heberlein wrote: > For example, will > > foo2( CFSTR("bar") ); or > foo2 ( CFStringCreateWithCString(NULL, "bar", kCFStringEncodingASCII) ); > > leak memory? The first won't, but the second will. It's similar to taking the [[NSString alloc] initWithCString:]

Re: Cocoa program without xib file

2009-04-16 Thread Dave Geering
On Fri, Apr 17, 2009 at 1:31 PM, Bill Bumgarner wrote: > What are you trying to do? > > Building a Cocoa program without a MainMenu.xib [or MainMenu.nib] is > possible, but it is not recommended, supported, or at all standard/typical. > > b.bum Objective-C-based command-line utilities that use on

Re: Equivalent of Redraw(MFC) on Cocoa

2009-04-06 Thread Dave Geering
On Mon, Apr 6, 2009 at 10:52 PM, Sourabh Sahu wrote: > Hi Everyone, > What is equivalent of Redraw method of MFC on Cocoa? > Sourabh Usually you can send an NSView or a subclass of NSView "setNeedsDisplay:YES" and it will redraw the entire view. ___ Co

Re: NSData encode decode

2009-04-02 Thread Dave Geering
>> >> IEEE 754 floats always in the same order. >> >> p = 2.71828; >> fprintf (stdout, "%x", *(unsigned long *)&p); >> >> Produces 402df84d on both my PPC and Intel Mac. > > Of course it does. Both long and float use the same byte order within > the same CPU. That's all your test shows. Try doing t

Re: XMLParser

2009-03-23 Thread Dave Geering
On Tue, Mar 24, 2009 at 1:53 PM, Development wrote: > I'm using an an NSXMLParser to parse a document. some of the elements are as > follows: Some Thing > The problem is that I cannot seem to come up with the element's property. > During the parse which callback is going to give me the property an

Re: Making NSTableView behave more like a spreadsheet with arrow keys

2009-03-05 Thread Dave Geering
Hi all, My solution to this problem can be found at: http://stackoverflow.com/questions/612805/arrow-keys-with-nstableview It's not very elegant but it gets the job done, and I'm welcome to suggestions for improvements. Cheers, Dave. On Thu, Mar 5, 2009 at 3:13 PM, Dave Geering w

Making NSTableView behave more like a spreadsheet with arrow keys

2009-03-04 Thread Dave Geering
Hi all, Is there a clean way to subclass NSTableView or the field editor to provide a way for users to change the currently editable cell in an NSTableView by pressing the arrow keys? I've already tried subclassing NSTableView but that will only be sent keyDown if a cell isn't being edited, and I'

Re: Linking with a very specific library version

2008-11-13 Thread Dave Geering
> Dave, > I have had similar problems in the past with linking with libcrypto. > My solution has been to set the "Other Linker Flags" to the path to the > library I want and set the "Library Search Paths" to that same library. > The resulting linker flags look like: > "-L " > ../../IKEngine/IKEngin

Re: Problem with NSData to NSString to NSData

2008-10-29 Thread Dave Geering
> From your original implementation of putting the metadata directly into the > PDF file, you'll now end up with obviously a proprietary file. i.e. No > application that works with PDF will be able to work with that file. That is not at all true. You can embed the data into a PDF stream but nev