Exception

2009-05-04 Thread Kiran Kumar S
i am developing a client/server app using Distributed objects, i register my client to server. when server pings the client the following exception occurs. Can any one suggest me why this exception occurs, 2009-05-05 12:12:29.023 Project X[5278:10b] *** NSDistantObject initWithCoder: 0x1 n

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Greg Parker
That's right. In some discussions of object-oriented programming, a distinction is made between "value objects" and "reference objects". Two value objects can be "equal" if they share the same "value", even if they are separately allocated objects with different pointer addresses in memory.

Re: Correct memory management in -awakeAfterUsingCoder: ?

2009-05-04 Thread Graham Cox
On 05/05/2009, at 3:57 PM, Greg Parker wrote: Two answers: 1. Retain it. Conceptually, you're balancing the [self release] that you did to the old-self. The old-self came in with one retain count that was not your responsibility to release. That means the new-self needs to go back out wi

Re: how to combine addObject in mutablearray with Object instantiation?

2009-05-04 Thread Graham Cox
On 05/05/2009, at 4:05 PM, Weydson Lima wrote: If you use indexOfObject:[NSNumber numberWithInt:7] that wouldn't work, right? D'oh. Engage brain... Yes, this would work, because objects are compared using -isEqual: I read that as -objectAtIndex:, not -indexOfObject: --Graham ___

Re: how to combine addObject in mutablearray with Object instantiation?

2009-05-04 Thread Graham Cox
On 05/05/2009, at 4:05 PM, Weydson Lima wrote: When you add a NSNumber object, how can you quickly reference back to it? Let's say you want to find the index in the array of the object you just created. If you use indexOfObject:[NSNumber numberWithInt:7] that wouldn't work, right? No it

Re: Installer has admin permissions but installer plugins don't

2009-05-04 Thread ERG Consultant
I am fully aware of the security issues having already written several helper tools. Stating that a temp text file written to /tmp is a security hole is really stretching it a bit. NSTemporaryDirectory can't be used because there is no way to specify that path in Packagemaker. I did indeed end

Re: how to combine addObject in mutablearray with Object instantiation?

2009-05-04 Thread Weydson Lima
Oops, wrong list :) On Tue, May 5, 2009 at 1:05 AM, Weydson Lima wrote: > Sorry for jumping in, but I have a question in the following line: > >> For other objects, you'll have to use a convenience method like: >> >>[myArray addObject:[NSNumber numberWithInt:7]]; >> > > When you add a NS

Re: how to combine addObject in mutablearray with Object instantiation?

2009-05-04 Thread Weydson Lima
Sorry for jumping in, but I have a question in the following line: > For other objects, you'll have to use a convenience method like: > >[myArray addObject:[NSNumber numberWithInt:7]]; > When you add a NSNumber object, how can you quickly reference back to it? Let's say you want to find t

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Nick Zitzmann
On May 4, 2009, at 11:52 PM, Weydson Lima wrote: when I use the removeObjectForKey, how can I make a reference to a specific key? Let's say I want to remove key that was initialized with [NSNumber numberWithInt:1]. If I call removeObjectForKey:[NSNumber numberWithInt:1], that method won't

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Jonathan Hess
Hey Weydson - NSDictionary equates keys by using -[NSObject isEqual:] and -[NSObject hash], so a number with a different pointer address but the same value as determined by isEqual: is fine. If identity vs value does become an important distinction for you, CFDictionary gives you control

Re: Correct memory management in -awakeAfterUsingCoder: ?

2009-05-04 Thread Greg Parker
On May 4, 2009, at 9:45 PM, Graham Cox wrote: I am trying to track down an over-release bug. It looks like I'm doing something wrong in -awakeAfterUsingCoder: which leads to an object being insufficiently retained. I have two objects, A and B. A loads B from an archive within - initWithCode

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Weydson Lima
Thanks all for the replies. I clearly understand now that I should use NSNumber instead of NSInteger. However, another question came up: when I use the removeObjectForKey, how can I make a reference to a specific key? Let's say I want to remove key that was initialized with [NSNumber numberWithInt:

Re: Correct memory management in -awakeAfterUsingCoder: ?

2009-05-04 Thread Graham Cox
On 05/05/2009, at 3:44 PM, Jonathan Hess wrote: This isn't clearly documented, so I would recommend filing a documentation bug. Cool :) I love answers like this! Thanks, --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

NSManagedObjectContext -insertObject: Cancels Prior Deletion?

2009-05-04 Thread Jerry Krinock
I have a tree of managed objects with parent <--> child relationships, and Delete Rule set to Cascade children when a parent is deleted. But sometimes, after deleting a parent, I need to restore a deleted child under a new parent. So I set the new relationships and also send [managedObj

Re: Correct memory management in -awakeAfterUsingCoder: ?

2009-05-04 Thread Jonathan Hess
Hey Graham - I believe the expectation is that you return a retained instance from an override of awakeAfterUsingCoder:. This isn't clearly documented, so I would recommend filing a documentation bug. Good Luck - Jon Hess On May 4, 2009, at 9:45 PM, Graham Cox wrote: I am trying to track

Re: Does Cocoa layer translate Objective-C objects to C++?

2009-05-04 Thread Caleb Strockbine
On May 4, 2009, at 11:07 PM, johnmadst...@yahoo.it wrote: I am confused. Perhaps, but not nearly so much as your developer friend. I was discussing with a developer about my desire to translate our C++ code (really simple and few methods and classes) to Objective-C, for a Cocoa/Cocoa Touch

Re: Registering Clients using DO

2009-05-04 Thread Kiran Kumar S
hi ken, So, the questions are: is -getServer called on the main thread? Is the client object, the one which you pass to the server with - registerClient:. retained so that it is still alive when the ping comes? the object i send is shared object, which exist until the application qu

Re: How to change the case of letters

2009-05-04 Thread Graham Cox
On 05/05/2009, at 3:04 PM, rethish wrote: Actually I want to change the case of letters in a particular range of selection. [textView replaceCharactersInRange:[textView selectedRange] withString: [[[textView string] substringWithRange:[textView selectedRange] uppercaseString]]; Pick th

Re: How to change the case of letters

2009-05-04 Thread rethish
Hi Thank you reply. Actually I want to change the case of letters in a particular range of selection. That is, when I select a range of text from a textview , that selection must be changed depending upon my action. Thank you On 5/5/09 2:21 AM, "Тимофей Даньшин" wrote: > It looks like, if

Re: Programatically hiding file extensions in Finder

2009-05-04 Thread Dave Fernandes
NSDictionary* attributes = [NSDictionary dictionaryWithObject: [NSNumber numberWithBool:YES] forKey:NSFileExtensionHidden]; [[NSFileManager defaultManager] changeFileAttributes:attributes atPath:path]; On May 4, 2009, at 6:40 PM, Finlay Dobbie wrote: On Fri, May 1, 2009 at 8:30 AM, Er

Correct memory management in -awakeAfterUsingCoder: ?

2009-05-04 Thread Graham Cox
I am trying to track down an over-release bug. It looks like I'm doing something wrong in -awakeAfterUsingCoder: which leads to an object being insufficiently retained. I have two objects, A and B. A loads B from an archive within - initWithCoder: while dearchiving and retains it. When B is

Re: Best way to save a CIImage to disk

2009-05-04 Thread Michael Ash
On Mon, May 4, 2009 at 4:58 PM, Jan-Willem Buurlage wrote: > I'm running a CIImage through some CIFilters, and I want to save the > returned CIImage to disk. Everything is very fast up until the point where I > try to actually save the image. I first create an NSBitmapImageRep with my > CIImage, g

Re: TCPServer Example

2009-05-04 Thread Chris Suter
On Tue, May 5, 2009 at 6:58 AM, Development wrote: > I'm using parts of the TCPServer example code from apple. It's fairly > straight forward code however I have a problem. > > in the method:- (void)handleNewConnectionFromAddress:(NSData *)addr > inputStream:(NSInputStream *)istr outputStream:(NSO

Uncaching NSBundle's "objectForInfoDictionaryKey"

2009-05-04 Thread Bridger Maxwell
Hello, My application loads several plugins as NSBundles. During runtime, I would like the user to be able to drop in a newer version of the plugin. When this happens, I unload all of the bundles (by calling "unload" and releasing the bundle), and load the new ones pretty easily. If the new plugin

Re: Does Cocoa layer translate Objective-C objects to C++?

2009-05-04 Thread Andrew Farmer
On 03 May 09, at 17:17, johnmadst...@yahoo.it wrote: I was discussing with a developer about my desire to translate our C+ + code (really simple and few methods and classes) to Objective-C, for a Cocoa/Cocoa Touch software. His answer has been: « I do not understand the reason, considering

Re: Does Cocoa layer translate Objective-C objects to C++?

2009-05-04 Thread Graham Cox
On 04/05/2009, at 10:17 AM, johnmadst...@yahoo.it wrote: I do not understand the reason, considering that, after our translation to Objective-C, the Cocoa layer will perform another translation to C++ Completely false. --Graham ___ Cocoa-de

Re: A couple NSRunLoop questions

2009-05-04 Thread Ken Thomases
On May 4, 2009, at 8:54 PM, Miles wrote: 1) I have a timer on a run loop. Every so often I invalidate the timer which as I understand it should remove the run loop as well. At a later time I start a new run loop (by calling the same method as before), then invalidate that timer after a whi

Re: Cocoa-dev Digest, Vol 6, Issue 661

2009-05-04 Thread Aaron Scott
Does anybody know how to use QT Access Keys in Cocoa? Cheers, Aaron -- A Handicapped parking sign does not signify that this spot is for handicapped people. It is actually in fact a warning, that the spot belongs to Chuck Norris and that you will be handicapped if you park there. _

Re: Does Cocoa layer translate Objective-C objects to C++?

2009-05-04 Thread Gwynne Raskind
On May 3, 2009, at 8:17 PM, johnmadst...@yahoo.it wrote: I am confused. I was discussing with a developer about my desire to translate our C+ + code (really simple and few methods and classes) to Objective-C, for a Cocoa/Cocoa Touch software. His answer has been: « I do not understand the r

Re: Does Cocoa layer translate Objective-C objects to C++?

2009-05-04 Thread Kiel Gillard
http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html On 04/05/2009, at 10:17 AM, johnmadst...@yahoo.it wrote: I am confused. I was discussing with a developer about my desire to translate our C+ + code (really simple and few methods and classe

Re: Programatically hiding file extensions in Finder

2009-05-04 Thread Finlay Dobbie
On Fri, May 1, 2009 at 8:30 AM, Erg Consultant wrote: > Is there a way to do this? I checked all the File Manager docs and would have > thought there would have been something in the cat info to do it, but > apparently not. OSStatus LSSetExtensionHiddenForRef ( const FSRef *inRef, Boolean

NSPredicateEditorRowTemplate and switching views

2009-05-04 Thread Arved von Brasch
Hi Cocoa list, I have noticed a strange bug in my NSPredicateEditorRowTemplate implementation. I have implemented a Pop-Up Pop-Up Level-Indicator template row to allow users to sort by rating. The relevant code is below: @synthesize levelIndicator; - (id)copyWithZone: (NSZone *)zone {

Best way to save a CIImage to disk

2009-05-04 Thread Jan-Willem Buurlage
I'm running a CIImage through some CIFilters, and I want to save the returned CIImage to disk. Everything is very fast up until the point where I try to actually save the image. I first create an NSBitmapImageRep with my CIImage, get the needed NSData from that object, and then save it to d

TCPServer Example

2009-05-04 Thread Development
I'm using parts of the TCPServer example code from apple. It's fairly straight forward code however I have a problem. in the method:- (void)handleNewConnectionFromAddress:(NSData *)addr inputStream:(NSInputStream *)istr outputStream:(NSOutputStream *)ostr I have the availability of the addr

Does Cocoa layer translate Objective-C objects to C++?

2009-05-04 Thread johnmadstone
I am confused. I was discussing with a developer about my desire to translate our C++ code (really simple and few methods and classes) to Objective-C, for a Cocoa/Cocoa Touch software. His answer has been: « I do not understand the reason, considering that, after our translation to Objective

How to play the next sound after the first sound is finished playing using AVAudioPlayer

2009-05-04 Thread Bess Ho
How do you play the next sound after the end of sound file? This code play 2 sound files at the same time. audioPlayerDidFinishPlaying only run at the end of 1st sound file. - (IBAction) playSound:(id)sender{ int i; for (i=1; i<3; i++) { NSString *soundFilePath = [[NSString alloc] init

Bindings related NSUndoManager problem

2009-05-04 Thread Lawrence Manning
Hi everyone, First up, the usual disclaimer: I am new to cocoa, and Objective C, etc. Please be gentle. :) As a learning exercise I am writing a simple drawing program. It is document based, and so far I have quite a few things working: loading/ saving, simple printing, drawing with line

Load TableViews One TableView At a Time.

2009-05-04 Thread Philip Juel Borges
Hi all, I'm re-posting this question. Hopefully more clear than before. I've been struggling much with a problem for so long and fail to get it to work. I don't know where I go wrong but below is my code. I've got 2 tableviews populated by this file, data.plist, with bindings. When I push

Re: A couple NSRunLoop questions

2009-05-04 Thread Chris Suter
Hi Miles, On Tue, May 5, 2009 at 11:54 AM, Miles wrote: > 1) I have a timer on a run loop. Every so often I invalidate the timer which > as I understand it should remove the run loop as well. No, invalidating a timer just removes it as a source from the run loop. > At a later time I > start a n

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

2009-05-04 Thread Kyle Sluder
On Mon, May 4, 2009 at 7:38 PM, Marcel Weiher wrote: > I wish Adobe understood/respected this.  Last I checked they write to > unallocated blocks on the hard disk...not exactly a safe place. Blame Macrovision. They're the ones who wrote the DRM package that Adobe uses. Also, the last I heard ab

A couple NSRunLoop questions

2009-05-04 Thread Miles
1) I have a timer on a run loop. Every so often I invalidate the timer which as I understand it should remove the run loop as well. At a later time I start a new run loop (by calling the same method as before), then invalidate that timer after a while, and repeat. When I pause the debugger after t

Re: -[CALayer hitTest:] incorrect when embedding layer-backed NSView subclass inside NSScrollView

2009-05-04 Thread Jim Correia
On Mon, May 4, 2009 at 6:19 PM, Steven Degutis wrote: > Specifically, you'll notice that the -hitTest: returns the correct > layer *only* if you click the view while it is fully visible in the > window, and before you have made it not-fully-visible for the first > time. After you resize the scrol

OT: WWDC Rooms available

2009-05-04 Thread David LeBer
Sorry for the off topic post. If you have any questions, please respond to me directly to minimize the list noise. The WebObjects community's developer conference WOWODC 2009 is occurring the weekend before WWDC (June 6 & 7) and we have some rooms available in our room block at the Hotel Wh

Re: Adding objects to NSMutableArray out of order?

2009-05-04 Thread Graham Cox
On 05/05/2009, at 9:50 AM, Colin Cornaby wrote: I'm dealing with some code that returns results out of order, but the results contain the proper index. In the end, I'd like to put them all into an NSArray, but unlike a C array, NSArray doesn't seem to allow me to simply reserve X number of

Re: Adding objects to NSMutableArray out of order?

2009-05-04 Thread Jonathan Hess
Hey Colin - It sounds like you are going to get results 1-n, out of order, here's what I would do: - (void)start { myArray = [[NSMutableArray alloc] init]; for(NSInteger idx = 0; idx <= n; idx += 1) { [myArray addObject:[NSNull null]]; } } - (void)processResult:(id)result

Re: Adding objects to NSMutableArray out of order?

2009-05-04 Thread Greg Parker
On May 4, 2009, at 4:50 PM, Colin Cornaby wrote: I'm dealing with some code that returns results out of order, but the results contain the proper index. In the end, I'd like to put them all into an NSArray, but unlike a C array, NSArray doesn't seem to allow me to simply reserve X number of

Re: Adding objects to NSMutableArray out of order?

2009-05-04 Thread Chris Suter
Hi Colin, On Tue, May 5, 2009 at 9:50 AM, Colin Cornaby wrote: > I'm dealing with some code that returns results out of order, but the > results contain the proper index. In the end, I'd like to put them all into > an NSArray, but unlike a C array, NSArray doesn't seem to allow me to simply > res

Re: Newbie question about non-document-based app

2009-05-04 Thread Graham Cox
On 05/05/2009, at 8:36 AM, Chris Goedde wrote: Hi, I have a simple question about my non-document-based app. It's a computer simulation of a physical system, and I've implemented file saving and loading to save the state of the system. Works great except for one thing. If I double-click

Re: drawing image

2009-05-04 Thread Ricky Sharp
On May 4, 2009, at 6:45 PM, Mike Manzano wrote: It's inverted because of differences in coordinate systems between the image and the view it's being draw into. Before you draw the image, invert it: [[self image] setInverted:YES] ; Before doing that, you should first ask the cell's view i

Re: Custom log file for NSLog

2009-05-04 Thread Torsten Curdt
Have a look here: http://github.com/tcurdt/feedbackreporter/blob/443300c21f6b7c5b70298edd861b4b2017a97b00/Sources/Main/FRConsoleLog.m HTH -- Torsten On Mon, May 4, 2009 at 22:49, Randall Meadows wrote: > I want to have a custom log file for my app, so that my client can send it > to me when thi

Adding objects to NSMutableArray out of order?

2009-05-04 Thread Colin Cornaby
I'm dealing with some code that returns results out of order, but the results contain the proper index. In the end, I'd like to put them all into an NSArray, but unlike a C array, NSArray doesn't seem to allow me to simply reserve X number of slots and fill the slots as the results come in.

Re: sheets

2009-05-04 Thread Kyle Sluder
On Fri, May 1, 2009 at 3:22 PM, Jason Todd Slack-Moehrle wrote: > Does anyone have an example for creating a 'sheet' without using Interface > Builder at all? I just am trying to display a sheet with some text and an OK > button and have it dismissed when pressed. Commencing obligatory questionin

Re: drawing image

2009-05-04 Thread Mike Manzano
It's inverted because of differences in coordinate systems between the image and the view it's being draw into. Before you draw the image, invert it: [[self image] setInverted:YES] ; On May 4, 2009, at 12:25 PM, Livio Isaia wrote: I have a custom NSButtonCell named MyButtonCell with a drawi

Re: NSXMLParser frees itself on error?

2009-05-04 Thread Kyle Sluder
On Mon, May 4, 2009 at 2:31 PM, Stephen J. Butler wrote: > I still maintain that it's never safe to release/autorelease an object > from inside one of it's delegate calls. If it works at all, you're > implicitly relying on an implementation detail that's subject to > change. Sometimes you do have

Re: NSTableView, 2mln rows, looks bad.

2009-05-04 Thread Gregory Weston
Timofey wrote: I need to have a tableView with about 2 million rows, and that figure may actually be bigger. But the table looks awfully bad in that case: you get artifacts when scrolling, the text in the rows does not coincide with the alternate bluish and white stripes, and if you click on a r

Re: ObjectAlloc and objects that should have been released

2009-05-04 Thread John Pannell
Hi Miles- This may not be your issue, but I know it has bitten me a few times... a common tool in tracking down over-released memory is to set NSZombieEnabled. I sometimes end up setting this in the early, crashy stages of my development and then forget to disable this in the later, perf

Re: parsing a string into words

2009-05-04 Thread Deborah Goldsmith
As much as I enjoy languages (I've taken a few in college, and 10 years ago I was on a couple Unicode e-mailing lists mainly to read the interesting discussion about the differences), for now I'll stick with the US+Euro+Japanese+ Latin+Hebrew solution that I have, that uses "Separated by whites

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

2009-05-04 Thread Marcel Weiher
On May 4, 2009, at 13:37 , Michael Ash wrote: On Fri, May 1, 2009 at 3:28 AM, Erg Consultant > wrote: That's a pretty lame approach considering that Apple hides theirs. Seems like a poor example to me, given that the path to the iTunes DRM directory was posted right here in this very thread (

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Jean-Daniel Dupas
Le 4 mai 09 à 22:58, Alexander Heinz a écrit : On May 4, 2009, at 3:22 AM, Weydson Lima wrote: I know that these methods are expecting pointers as parameters and I am passing a scalar. So, what's the best way to approach that? That's correct. You really shouldn't put any scalar types in an

Re: NSTableView, 2mln rows, looks bad.

2009-05-04 Thread Corbin Dunn
On May 4, 2009, at 1:46 PM, Тимофей Даньшин wrote: Hello. I need to have a tableView with about 2 million rows, and that figure may actually be bigger. But the table looks awfully bad in that case: you get artifacts when scrolling, the text in the rows does not coincide with the alternate

Re: NSTableView, 2mln rows, looks bad.

2009-05-04 Thread Nick Zitzmann
On May 4, 2009, at 2:46 PM, Тимофей Даньшин wrote: Is it the problem of my design (i.e. i may have done anything wrong while writing that), or is it a flaw of NSTableView? Are there any workarounds? Try rebuilding your application as 64-bit and see if that makes a difference. NSTableVie

Re: Full content of "Cocoa Design Patterns" available as "Rough-Cut" on-line

2009-05-04 Thread Bill Cheeseman
On May 4, 2009, at 1:23 PM, Julian Leviston wrote: Man I hate safari books online. Subscribed? Bah. I haven't had any previous experience with Safari books online, but my experience buying Erik's book in PDF, online and printed form just now was perfectly acceptable. Plus, I know the book

Re: Crashing resetting or releasing an NSManagedObjectContext

2009-05-04 Thread Keary Suska
On May 1, 2009, at 2:24 AM, Daniel Kennett wrote: Thanks for your reply. Yes, I have code that triggers relationship faults, and removing that code solves the problem. However, I need that code to work! :-) When fetching the data from the object tree, I call a method on the pet instance c

Newbie question about non-document-based app

2009-05-04 Thread Chris Goedde
Hi, I have a simple question about my non-document-based app. It's a computer simulation of a physical system, and I've implemented file saving and loading to save the state of the system. Works great except for one thing. If I double-click one of the save files in the Finder, my app laun

Re: Discussion on how to draw text like that seen in toolbars

2009-05-04 Thread Steven Degutis
What you're looking for is done with this code: [[textField cell] setBackgroundStyle:NSBackgroundStyleRaised]; Though with great power comes great responsibility. Use this code wisely, try to follow the HIG or some equivalent set of guidelines! The world would be a much worse place if all text had

Re: Crashing resetting or releasing an NSManagedObjectContext

2009-05-04 Thread Keary Suska
On May 4, 2009, at 11:59 AM, Alexander Spohr wrote: You are still having the same error. Although the advice is sound, the premise is false. All your objects in the relationships are fetched. Therefore they are owned by the NSManagedObjectContext. You kill the NSManagedObjectContext by re

Re: drawing image

2009-05-04 Thread Nick Zitzmann
On May 4, 2009, at 1:25 PM, Livio Isaia wrote: [[self image] drawInRect:cellFrame fromRect:NSZeroRect operation:NSCompositeCopy fraction:1.0]; } The image is well drawn... but upside down. Can you tell why? For some historical reason (you can probably find out more by searching the

-[CALayer hitTest:] incorrect when embedding layer-backed NSView subclass inside NSScrollView

2009-05-04 Thread Steven Degutis
Hello. The basic problem boils down to -hitTest: returning a completely incorrect layer when the layer-backed NSView with the root layer is inside a scroll view. I've provided some sample code to demonstrate this problem. To see it in action, just put the code into an NSView class, and stick an N

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Martin Wierschin
Assume that: NSMutableDictionary *result = [[NSMutableDictionary alloc] initWithCapacity:10]; NSInteger ID; And I add objects to the dictionary: [result setObject:[NSArray arrayWithObjects: {... objects ...} nil]

Re: drawing image

2009-05-04 Thread Alexander Spohr
Am 04.05.2009 um 21:25 schrieb Livio Isaia: The image is well drawn... but upside down. Can you tell why? Because your view/image isFlipped == NO? atze ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requ

Developing with Java

2009-05-04 Thread Kelvin Chung
Has anyone tried to use Rococoa (http://rococoa.dev.java.net) to develop a Cocoa program with Java? If so, how is it? I'm trying to build the sample Currency Converter program in XCode, but with Java using Rococoa. Are there any tips on developing a Cocoa program with Java (using JNI/ JN

Re: NSTask, or threading?

2009-05-04 Thread James Maxwell
Thanks for this. I actually found your page while googling around for help. I'll check it out now. Cheers, J. Sent from my iPod On 26-Apr-09, at 12:29 PM, Richard Frith-Macdonald > wrote: On 26 Apr 2009, at 18:39, James Maxwell wrote: So, how can I put my dataThing into some process,

NSImage drawing

2009-05-04 Thread Livio Isaia
I have a custom NSButtonCell named MyButtonCell with a drawing method: - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView { cellFrame = [self imageRectForBounds:cellFrame]; [[self image] drawInRect:cellFrame fromRect:NSZeroRect operation:NSCompositeCopy fractio

Re: NSXMLParser frees itself on error?

2009-05-04 Thread Jesper Storm Bache
Hi Stephen, I agree with you, deleting the owner of a delegate from a delegate callback (either directly, or though an auto-release pool) is not a good practice. Lifetime should be managed on the outside of the parser (after "parse" returns). Jesper On May 4, 2009, at 11:31 AM, Stephen J

Re: Discussion on how to draw text like that seen in toolbars

2009-05-04 Thread Brandon Walkin
[yourTextFieldCell setBackgroundStyle:NSBackgroundStyleRaised]; This method was introduced in 10.5. If you require Tiger compatibility, you can use NSShadow but you'll be losing subpixel antialiasing. Alternately, you can use BWInsetTextField which is part of the BWToolkit IB plugin: http

Re: Programmatically Changing Display(s) to Greyscale

2009-05-04 Thread Jean-Daniel Dupas
Le 4 mai 09 à 19:23, Grant Erickson a écrit : While the Displays preference pane doesn't appear to allow it, the Universal Access preference pane allows setting all active, online displays to greyscale mode. However, when using CGDisplayAvailableModes, the only modes that appear for the cu

Re: Key window/first responder handling with NSDrawer containing NSTextView

2009-05-04 Thread Luke Evans
Further to this... The workaround of subclassing NSTextView, and having a mouse down event set push the first responder to itself, seems to work OK. It's a rather annoying/plaltry reason to have to subclass however. I still wonder if I'm looking at a bug, or some lack of education on my pa

Re: NSURLConnection unhappiness

2009-05-04 Thread Kyle Sluder
On Fri, May 1, 2009 at 12:00 PM, Nick Hristov wrote: > One more comment on self->ivar... I used this approach because using [self > connection] or self.connection (they are both the same thing) amount to an > extra message call. This is true, and sometimes you want to do this, while other times y

Re: question about mutable vs. non-mutable

2009-05-04 Thread Kyle Sluder
On Fri, May 1, 2009 at 4:54 PM, Erik Buck wrote: > There is nothing to add now (13 years later): That's a bit bold, isn't it? Sure, the primitives and research might not have changed all that much, but the technology sure has. We now have GPGPU and the prospect of manycore Larabee, both thrusti

Re: Discussion on how to draw text like that seen in toolbars

2009-05-04 Thread Jean-Daniel Dupas
Le 2 mai 09 à 00:42, Alex Kac a écrit : I know there was a discussion about this a few months ago on this list, but I cannot find the right terms to search for. The discussion was how to draw text so that it was sunken much like you see in the toolbar. I just remember there was a specific

Re: NSXMLParser frees itself on error?

2009-05-04 Thread Kyle Sluder
On Mon, May 4, 2009 at 5:05 PM, Sean McBride wrote: > Actually, they should call [super dealloc] not [self release], see: You're right. Brain fart. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin request

Re: Installer has admin permissions but installer plugins don't

2009-05-04 Thread Kyle Sluder
On Sat, May 2, 2009 at 5:07 PM, Fritz Anderson wrote: > For most purposes, it's enough for the plugin to write what it has learned > into /tmp, for one of the scripts to act on. Do not use /tmp. Use NSTemporaryDirectory, which on Leopard is a user-specific directory. Using /tmp opens up a class

Re: NSXMLParser frees itself on error?

2009-05-04 Thread Sean McBride
On 5/3/09 5:38 PM, Kyle Sluder said: >Initializers must call -[self release] in case of an error. This >means that in response to an error that occurs as part of >initialization, you must not release that object. Actually, they should call [super dealloc] not [self release], see:

Re: Why is -makeWindowControllers getting called twice?

2009-05-04 Thread Tommy Nordgren
Are the listing from two different GDB sessions? Otherwise, judging from the value of self in [MyDocument makeWindowControllers], you have TWO instances of the MyDocument class. Is this intentional? On May 4, 2009, at 3:38 AM, David Scheidt wrote: I'm trying to figure out why my NSPersistantDo

Re: Creating a NSHTTPCookie

2009-05-04 Thread Nick Zitzmann
On May 4, 2009, at 12:58 AM, Chris wrote: When I try to set the newly created cookie to the sharedHTTPCookieStorage it doesn't ever get set. Am I doing something wrong? Possibly. From the -setCookie: documentation: "This method will accept the cookie only if the receiver’s cookie accep

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Ken Thomases
On May 4, 2009, at 2:22 AM, Weydson Lima wrote: NSMutableDictionary *result = [[NSMutableDictionary alloc] initWithCapacity:10]; NSInteger ID; And I add objects to the dictionary: [result setObject:[NSArray arrayWithObjects: {... objects ...}

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Alexander Heinz
On May 4, 2009, at 3:22 AM, Weydson Lima wrote: I know that these methods are expecting pointers as parameters and I am passing a scalar. So, what's the best way to approach that? That's correct. You really shouldn't put any scalar types in an NSDictionary (or any other container type in the

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Nick Zitzmann
On May 4, 2009, at 1:22 AM, Weydson Lima wrote: I am getting warnings when adding integers in the array and assigning the integer ID as a key. The code does work though, but I am guessing there is a better way to accomplish what I want. I know that these methods are expecting pointers as parame

Re: Why is -makeWindowControllers getting called twice?

2009-05-04 Thread Kyle Sluder
Note these two lines: On Sun, May 3, 2009 at 9:38 PM, David Scheidt wrote: > #0  -[MyDocument makeWindowControllers] (self=0x10471d0, _cmd=0x9464d69c) at > #0  -[MyDocument makeWindowControllers] (self=0x105d5b0, _cmd=0x9464d69c) at The self pointers are different (0x10471d0 vs. 0x105d5b0): you

Re: How to change the case of letters

2009-05-04 Thread Тимофей Даньшин
It looks like, if you want to change the case of a particular letter (say, all occurrences, letter "a"), you will have to iterate through all the chars in your textView, check if they are "a"s, if they are upper or lower case, and change their case accordingly. That is, if I understood your

Custom log file for NSLog

2009-05-04 Thread Randall Meadows
I want to have a custom log file for my app, so that my client can send it to me when things go "different". In reading the docs for NSLog, it seems that it is just a front-end for asl. So here's what I thought should work: directories = NSSearchPathForDirectoriesInDomains(NSLibraryDirecto

NSTableView, 2mln rows, looks bad.

2009-05-04 Thread Тимофей Даньшин
Hello. I need to have a tableView with about 2 million rows, and that figure may actually be bigger. But the table looks awfully bad in that case: you get artifacts when scrolling, the text in the rows does not coincide with the alternate bluish and white stripes, and if you click on a row

Re: Problem with the list?

2009-05-04 Thread Alexander Spohr
Same problem here. Messages come in again since today. But my answers are delayed as well. atze Am 04.05.2009 um 16:31 schrieb Robert Martin: Hi, I haven't received any posts for several days now, on any of the Apple lists I'm subscribed to...Is this a known problem, or should I

Re: Problem with the list?

2009-05-04 Thread Тимофей Даньшин
Same here. Didn't receive anything from the first of May till today. They must have been celebrating the international workers' day :). On May 4, 2009, at 6:31 PM, Robert Martin wrote: Hi, I haven't received any posts for several days now, on any of the Apple lists I'm subscribed to...Is thi

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Jason Foreman
On May 4, 2009, at 2:22 AM, Weydson Lima wrote: I am getting warnings when adding integers in the array and assigning the integer ID as a key. The code does work though, but I am guessing there is a better way to accomplish what I want. I know that these methods are expecting pointers as paramet

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

2009-05-04 Thread Michael Ash
On Fri, May 1, 2009 at 3:28 AM, Erg Consultant wrote: > That's a pretty lame approach considering that Apple hides theirs. Seems like a poor example to me, given that the path to the iTunes DRM directory was posted right here in this very thread (albeit not completely correct, but close enough to

Re: Storing a password (iPhone)

2009-05-04 Thread Sidney San Martín
You can use the iPhone's keychain (search for that term) to store passwords. Start by taking a look at these two pages: http://developer.apple.com/iphone/library/documentation/Security/Conceptual/keychainServConcepts/01introduction/introduction.html http://developer.apple.com/iphone/library/docume

Re: Storing a password (iPhone)

2009-05-04 Thread Sidney San Martín
You can use the iPhone's keychain (search for that term) to store passwords. Start by taking a look at these two pages: http://developer.apple.com/iphone/library/documentation/Security/Conceptual/keychainServConcepts/01introduction/introduction.html http://developer.apple.com/iphone/library/docume

Re: NSXMLParser frees itself on error?

2009-05-04 Thread Ed Wynne
On May 3, 2009, at 5:38 PM, Kyle Sluder wrote: Initializers must call -[self release] in case of an error. This means that in response to an error that occurs as part of initialization, you must not release that object. Initializers that call -[self release], for any reason, had also bette

Re: Discussion on how to draw text like that seen in toolbars

2009-05-04 Thread Dave Keck
While I'm not familiar with the original discussion, I will say that the effect you're going for can easily be created using a shadow. If it doesn't look right, the values you're using to create the shadow probably need tweaking. For the recessed look, I use a shadow offset of (0.0, 1.1) or (0.0, -

  1   2   >