NSNumber negative or positive in TableView?

2008-07-24 Thread Trygve Inda
I have a tableView with one column containing an NSNumber. This tableView is bound to an array and an arrayController is used as well. In the case of the unsigned NSNumber 2481864868 (signed -1813102428)... Sometimes when I load my array from the plist it shows up as the positive value, and

Re: IBOutlet to same control in different nibs

2008-07-18 Thread Trygve Inda
On Thu, Jul 17, 2008 at 7:52 PM, Ken Thomases [EMAIL PROTECTED] wrote: How can I build one class to handle both??? You sound very vexed by this question, but the answer seems self-evident to me. You just do. It's totally up to you what your classes do and how you use them. Nobody's

Re: NSMutableDictionary autorelease chrashes application

2008-07-18 Thread Trygve Inda
Hi! I'm a rookie with Cocoa development, please excuse if this question is stupid, but I'm struck with memory management (an even Aaron's book doesn't help me): In a method I use a (temporary) dictionary vAttributes to read an object from an instance variable vColors (a dictionary, too):

IBOutlet to same control in different nibs

2008-07-17 Thread Trygve Inda
I touched on this before, but I think this is a better explanation of the problem. I am creating a System Pref Pane that has one window for each physical monitor, very similar to the Displays prefpane. Like the Displays prefpane, on the Main monitor there will be the System Pref window with 4

Can't open PrefPane on Air w/10.5.3

2008-06-25 Thread Trygve Inda
We have a prefPane app that uses additional background apps for doing its thing. We have an odd report that we can't duplicate: A user is reporting: You cannot open (PrefName) preferences pane because it is not available to you at this time. You might need to connect a device to your computer to

Code signing and bundle layout

2008-06-23 Thread Trygve Inda
Apple's guide at: http://developer.apple.com/releasenotes/Security/RN-CodeSigning/ says: Do not put helper applications, plugins, and other separately signed code into the Resources directory of a bundle. The Resources directory is directly sealed to the main executable. Put plugins into the

Re: OT: code signing

2008-06-23 Thread Trygve Inda
On 23 Jun '08, at 9:59 AM, Trygve Inda wrote: I have an Authenticode certificate for our VC++ Windows-based app, but it does not seem to work on 10.5's code signing system. I haven't tried to do any code signing yet, but my naïve impression is that any valid X.509 cert plus private key

Re: zlib in 10.4 and 10.5

2008-06-22 Thread Trygve Inda
No. The library will return Z_VERSION_ERROR if you try to inflate something that the working zlib library doesn't understand. That said, zlib has been stable for years. If you're just now getting started with compression, you should't have version problems (that you can't manage). Are all

SSCrypto Framework

2008-06-20 Thread Trygve Inda
I am considering using the SSCrypto Framework: http://septicus.com/products/opensource/ I would embed a public key in my app and encrypt a data file on our site that the software needs to download periodically. This is mostly to ensure that file can not be modified or substituted except by us.

Re: Linking with OpenSSL

2008-06-20 Thread Trygve Inda
It seems to me that the linker can't find the OpenSSL libraries. I already added the Security Framework to my application, this did not make any difference. Any suggestion what I need to configure to get this to compile. Thanks in advance Alex Try adding these to the project:

Re: SSCrypto Framework

2008-06-20 Thread Trygve Inda
There would be a couple of ways that you could do it... you could place your certificate in the System keychain and then add it so that it can be read by your application anytime. This should work okay and if you do this during installation, the user should only have to authenticate then.

Can't sort NSTableView

2008-06-19 Thread Trygve Inda
I have an NSTableView tied to an NSArrayController After I populate the array, the table does show the data via bindings on each of the columns. However, clicking a column header does nothing - how can I make it sort? I have done this before in IB2 and it sorted ok, but I can't make this new

NSData text representation

2008-06-19 Thread Trygve Inda
In my plist (xml1 format) I see something like: data +/YgByAMQo78MBADoA /data However when I send a [myNSData description] I get something like: 4705 78da8d53 cb4ac340 146d1ea0 a0b8f133 5c09 How can I get something more like the first example that I can copy/paste into a plist? Thanks,

Link to zlib

2008-06-11 Thread Trygve Inda
I am not quite sure how to do this (and maybe this belongs on the Xcode list), but I need to link to zlib. I managed to find another project that linked and copied it into mine so now I have the little yellow toolbox icon in my linked files list and doing a Get Info shows: Path:

NSData from NSArchiver and plist Utility

2008-06-11 Thread Trygve Inda
I have a plist that I will store on a server and my app will retrieve it. I'd like to archive one of the keys (an array) into an NSData and possibly compress it Makes for less storage and thus lower bandwidth for my server. myData = [NSArchiver archivedDataWithRootObject:(NSArray*)myArray];

Re: NSData from NSArchiver and plist Utility

2008-06-11 Thread Trygve Inda
myData = [NSArchiver archivedDataWithRootObject:(NSArray*)myArray]; Will something archived with this under 10.5 be readable in 10.4? This seems like something an existing utility should be able to do... Is there something that does this? Or do I need to write a simple custom app to

Re: NSData from NSArchiver and plist Utility

2008-06-11 Thread Trygve Inda
On 11 Jun '08, at 9:35 AM, Trygve Inda wrote: I have a plist that I will store on a server and my app will retrieve it. I'd like to archive one of the keys (an array) into an NSData and possibly compress it Makes for less storage and thus lower bandwidth for my server. Why

zlib in 10.4 and 10.5

2008-06-08 Thread Trygve Inda
Is zlib in all versions of 10.4 and 10.5? Will any version of zlib always uncompress something created with a different version? I am thinking to store some compressed data on our site that a Cocoa app will need to download and would like to compress it. This will be for NSData in a plist. Any

Re: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Trygve Inda
On Jun 3, 2008, at 2:48 PM, Trygve Inda wrote: Hi, Trygve, With regard to your code duplication, I would use a common NSWindowController superclass, with a subclass for your main window and a subclass for your aux window. Then you can just use the right nib name in each of them

Re: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Trygve Inda
On Tue, Jun 3, 2008 at 10:21 PM, Trygve Inda [EMAIL PROTECTED] wrote: Since the IBOutlets in Main point to a different Nib than the IBOutlets in Aux (even though they are functionally identical) is there a good, clean way to manage this? Can you not wire the IBOutlets in Aux to the File's

Re: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Trygve Inda
On Wed, Jun 4, 2008 at 8:17 PM, Trygve Inda [EMAIL PROTECTED] wrote: I'd need two instances of WindowController. The way I see it, you have a choice: either a single instance of a controller with 2n outlets, or two instances of a controller with n outlets. If you want to have one

IBOutlet, multiple nibs, method duplication

2008-06-03 Thread Trygve Inda
Hi All, Sorry for the vague subject title... Let me explain. I have one window per attached screen so at least one, but perhaps 3 (for example). There is always one main window and the others are considered aux windows. The Main window has 4 groups of controls (A, B, C, D). The Aux windows have

Re: Is there any compression library for Cocoa?

2008-04-30 Thread Trygve Inda
There's a handy NSData-Compression class in Dustin Mierau's NetSocket 0.9 sample code available here: http://blackholemedia.com/code/ Here's a snippet from the header file. @interface NSData (Compression) - (NSData*)compressedData; - (NSData*)compressedDataWithLevel:(int)inLevel; -

Re: Is there any compression library for Cocoa?

2008-04-30 Thread Trygve Inda
On 30 Apr 2008, at 11:24, Trygve Inda wrote: If the compression is successful, and I later release the (compressed) NSData, buffer is still around, right? No, from the documentation for + (id)dataWithBytes: length: The returned object takes ownership of the bytes pointer and frees

Re: prefPane with background process

2008-04-02 Thread Trygve Inda
Hi, I want to create a service which can be launched from the system preferences, do some config setting and continue working even if the system preferences application is closed. To achieve this, I have created a myapp.prefPane which is of type BUNDLE and installed this in the

Re: CGDisplayReconfigurationCallBack

2008-04-01 Thread Trygve Inda
return. Le 30 mars 08 à 15:31, Trygve Inda a écrit : ___ 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

CGDisplayReconfigurationCallBack

2008-03-30 Thread Trygve Inda
void MyDisplayReconfigurationCallBack ( CGDirectDisplayID display, CGDisplayChangeSummaryFlags flags, void *userInfo ); Your callback function should avoid attempting to change display configurations, and should not raise exceptions or perform a non-local return such as calling

Re: Thread safe?

2008-03-30 Thread Trygve Inda
On 29.03.2008, at 18:54, Adam R. Maxwell wrote: Drawing into an NSImage is explicitly documented to be thread safe in the article you linked to, and each thread has its own graphics context. The post I linked to does indicate that you might want to use [image

Re: Thread safe?

2008-03-30 Thread Trygve Inda
Or drop down just a step to just use NSBitmapImageRep instead of NSImage which avoids all the caching issues (since you never make an NSImage). It is very well suited for pixel level work that is saved in a file (since you'll need it to do NSBitmapImageRep's representationUsingType:

Re: BitMap data format and autorelease

2008-03-13 Thread Trygve Inda
I'd use something like this (typed in Mail): [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithBitmapImageRep:imageRep]]; // draw here [NSGraphicsContext restoreGraphicsState]; which avoids creating an NSImage. Is

Re: BitMap data format and autorelease

2008-03-12 Thread Trygve Inda
On 12 Mar '08, at 9:09 AM, Trygve Inda wrote: NSImage * image = [NSImage imageNamed:@colorTest]; NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData: [image TIFFRepresentation]]; That will work, I think, but it's sort of inefficient, since it requires encoding

Re: BitMap data format and autorelease

2008-03-12 Thread Trygve Inda
On 12 Mar '08, at 9:09 AM, Trygve Inda wrote: NSImage * image = [NSImage imageNamed:@colorTest]; NSBitmapImageRep * imageRep = [NSBitmapImageRep imageRepWithData: [image TIFFRepresentation]]; This comes from here: http://www.cocoadev.com/index.pl?NSBitMapImageRep The easiest

Re: BitMap data format and autorelease

2008-03-12 Thread Trygve Inda
Then you definitely want to create your own NSBitmapImageRep — the init method will give you total control over the pixel format. Then you can lockFocus and draw whatever you want into it. So I have created this: imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL

Re: BitMap data format and autorelease

2008-03-12 Thread Trygve Inda
On 12 Mar '08, at 12:01 PM, Trygve Inda wrote: (1) draw an NSImage into this bitmap (2) draw some semi-opaque text over the bitmap As I said, call -lockFocus on the imagerep. Then issue drawing commands (just as though you were in a view's -drawRect: method). Then calll -unlockFocus

Re: NSUserDefaults and mutability

2008-03-09 Thread Trygve Inda
On 8 Mar '08, at 1:57 PM, Trygve Inda wrote: Is this expected? Can I rely on it? I will never need to change dict, but I am modifying items within a known sub Dictionary. Don't rely on this; it's entirely possible this behavior could change in the future, causing your app to throw

Re: NSUserDefaults and mutability

2008-03-09 Thread Trygve Inda
Is it enough then to take the dictionary I get back and do a [dict mutableCopy]? Will this cascade down to the subdicts (dicts within the top level dict). No it won't. mutableCopy only operates on one particular object and not all its contained objects. While that behavior does

IB3 Application vs File Owner

2008-03-08 Thread Trygve Inda
In IB 2 there was only a File's Owner and First Responder and one typically made an AppController object as a subclass of NSObject and made it a delegate of File's Owner. IB3 has added an NSApplication object. How does this work... It seems if my AppController is still the delegate of the File's

NSButton Subclass - 2 states plus tracking image

2008-02-23 Thread Trygve Inda
I need an NSButton with 5 different graphics and two states: State 0 (enabled disabled graphics) State 1 (enabled disabled graphics) Pressed/Tracking state I was thinking to subclass NSButton and in IB use Momentary Change so that I can set the alt image to always be my Pressed/Tracking

Re: NSButton Subclass - 2 states plus tracking image

2008-02-23 Thread Trygve Inda
Hi Trygve, I don't you should override -value or anything like that. NSOnState and NSOffState should do fine. You should draw your pressed art if and only if -isHighlighted is true. It's probably appropriate to subclass NSButtonCell for this and draw what you like. In IB3, you can

<    1   2   3   4   5