NSTreeController -moveNode:toIndexPath doesn't work correctly

2008-09-26 Thread Rob Keniger
Hi all, I'm having a problem with the -moveNode:toIndexPath: method of NSTreeController, which is new to 10.5. I'm not using Core Data, I have a very simple model object like so: @interface Item : NSObject { NSMutableArray* children; Item* parent; NSString* text;

Re: problems in runModal in NSOpenPanel used with defaults

2008-09-26 Thread spartan g
Thanks Corbin, I have used your tips in the updated code. Besides, my aim is to save the filename selected through the panel to a pList file timely whenever it is changed, so I am using synchronization of defaults. I checked and found that there is no resetStandardUserDefaults used anywhere in the

Re: Using aggregate functions in a Core Data Fetch Request

2008-09-26 Thread Jamie Hardt
What about taking your objects and sorting them by value, and popping the last object? NSFetchPredicate *fr = /* lets say this is setEntity to your entity */; NSManagedObjectContext *moc = /* your moc here */; [fr setSortDescriptor: [[[NSSortDescriptor alloc] initWithKey:@"value" ascending:Y

Re: [NSCFNumber intValue]: unrecognized selector

2008-09-26 Thread cocoa-dev-owner
On Sep 26, 2008, at 11:22 AM, j o a r wrote: On Sep 25, 2008, at 6:22 AM, Steve Rossi wrote: I've deduced that he crash seems to be something timing related which occurs only at application startup, and only under certain conditions (i.e. reproduce occassionlly by opening an NSOpenPanel

Re: sending email with attachement from cocoa

2008-09-26 Thread Chris Suter
On Sat, Sep 27, 2008 at 4:11 AM, has <[EMAIL PROTECTED]> wrote: > Alexander Cohen wrote: > >> Is there a way to use a url request to open mail with all its fields >> completed but most importantly, contain an image attachement? > > > Nope. If you want to send an email in the background, you'll need

Re: sending email with attachement from cocoa

2008-09-26 Thread has
Alexander Cohen wrote: Is there a way to use a url request to open mail with all its fields completed but most importantly, contain an image attachement? Nope. If you want to send an email in the background, you'll need to look into a third-party framework option: http://www.collaboration

NSURLConnection issues

2008-09-26 Thread Colin Cornaby
I'm doing an async NSURLConnection and am having issues. It's an http connection, and at first it seems to work. The server sends an authentication challenge (as it should), I respond with credentials, the servers seems to accept the credentials. Then the server responds with an HTTP header

Re: [NSCFNumber intValue]: unrecognized selector

2008-09-26 Thread j o a r
On Sep 26, 2008, at 4:36 PM, Steve Rossi wrote: Yes, that is correct. A separate thread is spawned which updates the model - consequently driving UI updates based on KVO notifications. It is the only thread that is updating the model - the main thread does very little except respond to fairl

Re: NSNotificationCenter

2008-09-26 Thread Graham Cox
On 27 Sep 2008, at 3:28 am, John Love wrote: In almost all cases, whenever you call the -postNotificationName: method of NSNotificationCenter, the object you pass is 'self'. If it's any other, chances are you've done something weird. So, short answer: your design is a bit whiffy. ;) I l

Using aggregate functions in a Core Data Fetch Request

2008-09-26 Thread Fred McCann
I'm attempting to find an object that has a maximum value in the data store. In sql, the query would be something like this: select * from foo where value = select max(value) from foo. Actually, I would be thrilled if I could just get select max(value) from foo. I've read through the Core

Changing slide back destination during drag

2008-09-26 Thread Nathan Vander Wilt
I have a view that allows users to drag copies of the items it contains. I'd like to add autoscrolling to the view, which will move the drag's source item. However, I can find no way to change the drag properties so that upon failure the image will slide back to where the item *is* rather t

Re: Always allowing drags from WebView inside a global NSPanel

2008-09-26 Thread Nick Beadman
Just wanted to follow up on this so the list archive has a solution in case anyone searches for anything similar in the future. The solution is courtesy of Darin Adler over on webkitsdk-dev. The solution is to override -[NSWindow sendEvent:] and if the window is not main send the NSLeftMous

Re: showing window causes EXC_BAD_ACCESS

2008-09-26 Thread Michael Ash
On Fri, Sep 26, 2008 at 2:45 PM, Daniel Child <[EMAIL PROTECTED]> wrote: > I should? Then how do I get the reference back? If windowA is a window > outlet in my AppController, then first time around I don't do anything. It > is automatically assigned a reference when the window loads, and I can use

Re: addTrackingRect strangness

2008-09-26 Thread Peter Ammon
On Sep 26, 2008, at 11:17 AM, Mudi Dandan wrote: Hi Guys, I have a custom view which is set in an NSMenuItem. This view contains 9 rectangles which I would like to track for mouse-over event. I use the the very same method for calculating the size of the rects for drawing and the for defi

Re: Saving an annotated PDF to a flat image

2008-09-26 Thread John Calhoun
On Sep 26, 2008, at 5:55 AM, Danny Greg wrote: I load a document from disk, get it's first page (they are all 1 page docs), add the annotations by calling addAnnotation: and then save out the document. Am I missing a stage? No, that sounds right — assuming you are saving the PDF document by

Re: showing window causes EXC_BAD_ACCESS

2008-09-26 Thread Charles Steinman
--- On Fri, 9/26/08, Daniel Child <[EMAIL PROTECTED]> wrote: > I should? Then how do I get the reference back? If windowA > is a window > outlet in my AppController, then first time around I > don't do > anything. If it's accessed via an outlet in your app controller, you probably don't have

Re: window controllers and managed object contexts

2008-09-26 Thread Kyle Sluder
On Fri, Sep 26, 2008 at 2:33 PM, Daniel Child <[EMAIL PROTECTED]> wrote: > I tried this, but with Core Data, I'm getting a message that I need a > managed object context (moc). I know how to get the moc, but I can't figure > out who is calling for the moc in the first place. Something inside of the

Re: showing window causes EXC_BAD_ACCESS

2008-09-26 Thread Daniel Child
I should? Then how do I get the reference back? If windowA is a window outlet in my AppController, then first time around I don't do anything. It is automatically assigned a reference when the window loads, and I can use makeKeyAndOrderFront. But if I choose to automatically release the win

window controllers and managed object contexts

2008-09-26 Thread Daniel Child
To avoid cluttering up my main AppController (which had five windows), I've started placing the individual windows into separate xib files. Pre-Core Data (for a regular cocoa app), I would simply set up a window controller, establish a reference to it in the main controller (initWithWindowN

[Q] Which mailing list is for the functions like valloc()?

2008-09-26 Thread JongAm Park
Hello, all. I think I found a bug in the valloc(). However, before reporting it to Apple, I would like to ask if it is really a bug or if anyone also noticed the problem. So, I tried figuring out what mailing list is for, but couldn't determined it. Can it be here, Cocoa-dev, or others like *D

addTrackingRect strangness

2008-09-26 Thread Mudi Dandan
Hi Guys, I have a custom view which is set in an NSMenuItem. This view contains 9 rectangles which I would like to track for mouse- over event. I use the the very same method for calculating the size of the rects for drawing and the for defining the tracking rects. What I experience is that

Re: sending email with attachement from cocoa

2008-09-26 Thread j o a r
On Sep 26, 2008, at 10:03 AM, Alexander Cohen wrote: Is there a way to use a url request to open mail with all its fields completed but most importantly, contain an image attachement? Not using the frameworks provided by Apple. Your problem, in particular, is that you can't assume that all

Re: NSNotificationCenter

2008-09-26 Thread John Love
Graham Cox, Andy Lee, et. al: This violates the spirit and purpose of notifications. Your receiver shouldn't also be forcing the "transmitter" to transmit, as you are doing here. Instead, the transmitter object should always send a "status changed" message whenever its status changes. Then

Re: problems in runModal in NSOpenPanel used with defaults

2008-09-26 Thread Corbin Dunn
Howdy spartan, Oh! A few little tips: On Sep 26, 2008, at 3:11 AM, spartan g wrote: Hi, I am writing an utility which needs to open a panel to browse files and select one. - (IBAction)browseClicked:(id)sender { NSOpenPanel *panel = [NSOpenPanel openPanel]; if ([panel runModal]) {

Re: showing window causes EXC_BAD_ACCESS

2008-09-26 Thread Michael Ash
On Fri, Sep 26, 2008 at 11:34 AM, Scott Ribe <[EMAIL PROTECTED]> wrote: >> I can't think of a single reasonable use case for it > > An app with many windows, many of which can display multiple instances at a > time--they should be released when closed. Sure. By the objects that own them. Them's th

sending email with attachement from cocoa

2008-09-26 Thread Alexander Cohen
Is there a way to use a url request to open mail with all its fields completed but most importantly, contain an image attachement? thx AC ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

Re: [NSCFNumber intValue]: unrecognized selector

2008-09-26 Thread j o a r
On Sep 25, 2008, at 6:22 AM, Steve Rossi wrote: I've deduced that he crash seems to be something timing related which occurs only at application startup, and only under certain conditions (i.e. reproduce occassionlly by opening an NSOpenPanel modal dialog before the application is fully up

Re: Fastest color detection in image?

2008-09-26 Thread chaitanya pandit
Well, there are 2 ways you can do it first would be to use: NSReadPixel(apoint); This method requires you to lock focus on the image before u call it. You would have to iterate through every point in the image and get it's color. But i found that this is a bit slow, to make it a bit faster you c

Re: unrecognized selector sent to instance

2008-09-26 Thread j o a r
On Sep 25, 2008, at 4:01 AM, pan xuan wrote: Hi, I am having a strange problem of my class declaration. I used to declare some methods of a class in a category, "Private". After I have done some refactoring work (basically moving some classes into another framework), it seems those methods

Re: Use other key than "tab" to cycle through text fields

2008-09-26 Thread Gerd Knops
On Sep 25, 2008, at 10:37 PM, Ken Thomases wrote: On Sep 25, 2008, at 9:18 PM, Graham Cox wrote: On 26 Sep 2008, at 10:24 am, Gerd Knops wrote: I would like to use a key other than "tab" to advance to the next text field, so that users can use a numeric keypad to enter something like "11

Re: What does @loader_path refer to when loading ibplugins from a linked-in framework?

2008-09-26 Thread Dalzhim Dalzhim
Hello Michael, I have tried many things to get my plugin to load automatically in Interface Builder but I still haven't made it. I tried many things before testing something I assumed would work but I realized that even this wasn't enough. I changed DYLD_FALLBACK_FRAMEWORK_PATH to add the folder

Re: Causing systemUIServer to update the User Menu for Fast User Switching.

2008-09-26 Thread Ken Andrews
This turned out to be pretty simple. I just needed to send out either com.apple.UserWasRemovedNotification or com.apple.UserWasAddedNotification and the switch screenname list gets updated. E.g. // We need to send the standard OS notification so that the switch screen name list will be updated

Re: Use other key than "tab" to cycle through text fields

2008-09-26 Thread Gerd Knops
On Sep 25, 2008, at 9:18 PM, Graham Cox wrote: On 26 Sep 2008, at 10:24 am, Gerd Knops wrote: I would like to use a key other than "tab" to advance to the next text field, so that users can use a numeric keypad to enter something like "11-22-33" and have 11, 22 and 33 end up in differen

Re: Porting 'operator' to Obj-C

2008-09-26 Thread Jonathan Prescott
This is C++, not C. You need to be compiling this as Objective-C++, not Objective-C. Easiest way is to change the extension of the file from ".m" to ".mm" if you are using Xcode. As an aside, you do not need the "typedef" in C++. Simply declaring the struct (or class) is enough to declare

NSLevelIndicator - setEnabled not respected

2008-09-26 Thread Michael LaMorte
I have a Core Data application, several fields of which are Int16s which are bound to NSLevelIndicators and a NSLevelIndicatorCell. I have some methods that calculate and set the values of these properties in a subclass of NSManagedObject, using old-style accessor methods. I'm aware of th

Re: Porting 'operator' to Obj-C

2008-09-26 Thread Alex Finkel
Thanks, but can you point me in the right direction. The code bellow does not build. Am I doing something wrong with the struct? typedef struct dbnames { short Handle; short Version; int Size; intNumEntries; char Name[ 32 ]; dbnames() :Handle(-1), Version

Re: showing window causes EXC_BAD_ACCESS

2008-09-26 Thread Scott Ribe
> I can't think of a single reasonable use case for it An app with many windows, many of which can display multiple instances at a time--they should be released when closed. I'd turn the question around--why do people assume that a single instance of a window can be closed and then re-displayed,

Re: objc_msgSend_ptr

2008-09-26 Thread Tilo Villwock
That did the trick, thanks a lot. Seems like I need to review a few concepts here. -Ursprüngliche Nachricht- Von: chaitanya pandit [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 26. September 2008 12:25 An: Tilo Villwock Cc: cocoa-dev@lists.apple.com Betreff: Re: objc_msgSend_ptr if your

Re: Porting 'operator' to Obj-C

2008-09-26 Thread Robert Claeson
On 26 Sep 2008, at 17:03, Alex Finkel wrote: Hi there. I am in a process of porting some C++ code to ObjC. How to port the code bellow (operators). Thanks. snip - operator= is a normal assignment method that takes an NSArray as its argument. Something like the following (unte

Re: Fastest color detection in image?

2008-09-26 Thread douglas welton
On Sep 26, 2008, at 10:04 AM, Christian Klotz wrote: Hi, I'm trying to scan an image for existence of a given color. So I was wondering what the most performing way is to achieve this goal. Take a look at the "vImage Programming Guide" and the associated reference. vImage contains severa

Re: Porting 'operator' to Obj-C

2008-09-26 Thread Dave DeLong
Objective-C does not support operator overloading. [1, 2] If you're looking to compare equality, the convention is to implement your own isEqual: method that returns a BOOL (YES or NO). HTH, Dave [1] http://borkwarellc.wordpress.com/2007/08/19/objective-c-is-stupid-but-i-still-like-it/ [2

Porting 'operator' to Obj-C

2008-09-26 Thread Alex Finkel
Hi there. I am in a process of porting some C++ code to ObjC. How to port the code bellow (operators). Thanks. typedef struct encoding_tag { byte encodings[ 16 ]; ushort count; encoding_tag() { count = 0; } encoding_tag( encoding_tag& encoding ) { *this = encoding; } v

Re: Fastest color detection in image?

2008-09-26 Thread Ricky Sharp
On Friday, September 26, 2008, at 09:04AM, "Christian Klotz" <[EMAIL PROTECTED]> wrote: >I'm trying to scan an image for existence of a given color. So I was >wondering what the most performing way is to achieve this goal. You probably want to look into direct-pixel access (there are some co

Re: Properties and bindings

2008-09-26 Thread mmalc crawford
On Sep 24, 2008, at 4:32 PM, D.K. Johnston wrote: - (IBAction)buttonClick:(id)sender; @end Both properties are synthesized in the implementation files. Here's what buttonClick: does: [self.model changeMyInteger]; This method is not KVO compliant (

Fastest color detection in image?

2008-09-26 Thread Christian Klotz
Hi, I'm trying to scan an image for existence of a given color. So I was wondering what the most performing way is to achieve this goal. Basically I want to find out which amount of the given color that image has. Furthermore, are there ways to find all regions of the image having the col

problems in runModal in NSOpenPanel used with defaults

2008-09-26 Thread spartan g
Hi, I am writing an utility which needs to open a panel to browse files and select one. - (IBAction)browseClicked:(id)sender { NSOpenPanel *panel = [NSOpenPanel openPanel]; if ([panel runModal]) { NSArray *filenames = [panel filenames]; NSString *filename = [filenames object

Re: NSNotificationCenter

2008-09-26 Thread Andy Lee
On Sep 26, 2008, at 8:14 AM, John Love wrote: Shouldn't my call to -addObserver automatically monitor "StatusChanged" rather than my having to -postNotificationName?? I wonder if you're confusing notifications with KVO or bindings. Notifications have to be explicitly posted in order for obs

Re: Converting from Carbon Event Manager to NSTimer

2008-09-26 Thread Uli Kusterer
On 25.09.2008, at 01:18, Dan Birns wrote: So what happened when I used [NSTimer scheduledTimerWithTimeInterval... I was getting another timer. The result was that my selector would get called maybe 10X more often than intended. This didn't break anything, but impaired performance. So no

Re: Saving an annotated PDF to a flat image

2008-09-26 Thread Danny Greg
PDFDocument has methods for saving PDF's � since Leopard, annotations are preserved as annotations. I thought that, but if I load annotations into a PDFPage programatically and then save that page's document the annotations are not saved. I load a document from disk, get it's first page

Re: NSNotificationCenter

2008-09-26 Thread Graham Cox
On 26 Sep 2008, at 10:14 pm, John Love wrote: Shouldn't my call to -addObserver automatically monitor "StatusChanged" rather than my having to -postNotificationName?? Well, no. It's not magic - something needs to "transmit" so that there is something to "receive". All the NSNotificationC

NSNotificationCenter

2008-09-26 Thread John Love
Within MyController, I call: notifyCenter = [NSNotificationCenter defaultCenter]; [notifyCenter addObserver:self selector:@selector(mySelector:) name:@"StatusChanged" object:sentNotifyObject]; // We will be the obs

Re: objc_msgSend_ptr

2008-09-26 Thread chaitanya pandit
if your sizeOfFile: method is returning an integer, then you should convert it to NSNumber like: object = [NSNumber numberWithInt:[[files objectAtIndex:rowIndex] sizeOfFile]]; hth, Chaitanya On 25-Sep-08, at 5:22 PM, Tilo Villwock wrote: i have the following piece of code in my controlle

Re: NSURLDownload resumeData always nil

2008-09-26 Thread Andrew Zahra
Sorry I didn't see your reply earlier due to digest mode... I have confirmed with Wireshark that my test download file: http://google-web-toolkit.googlecode.com/files/gwt-mac-1.5.2.tar.gz includes and ETag. Then I do this: - (void)cancel { [download cancel]; resumeData = [download resumeDa

Re: Converting from Carbon Event Manager to NSTimer

2008-09-26 Thread Graham Cox
On 25 Sep 2008, at 9:18 am, Dan Birns wrote: I must say, after 20 years of C malloc(), I find retain/release mysterious. It's probably no better or worse than malloc/free, but confusing to me. It seems to me that it has exactly the same advantages/disadvantages, but it's just wildly diff

Loading mechanism with NSAtomicStore

2008-09-26 Thread Alexander Lamb (dev)
Hello List, As I understand, when using NSAtomicStore, there is only a "load" method to load the data. It looks like it is an "all or nothing" operation. However, if I want to load data from a server through some kind of HTTP/XML/Whatever method and only receive a subset of data. How would

[NSCFNumber intValue]: unrecognized selector

2008-09-26 Thread Steve Rossi
Sorry in advance for a long-winded post, I need help debugging a application crash caused by this unrecognized selector which requires some explanation I've deduced that he crash seems to be something timing related which occurs only at application startup, and only under certain conditions

objc_msgSend_ptr

2008-09-26 Thread Tilo Villwock
i have the following piece of code in my controller class: - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn: (NSTableColumn *)aTableColumn row:(int)rowIndex{ id object = nil; if([tableView columnWithIdentifier:[aTableColumn identifier]] == 1){

Re: lauchd and svnserve

2008-09-26 Thread Kevin McEnhill
I ran svnserve under launchd on 10.4 but found that using the built in Apache2 and svn_dav mod on 10.5 MUCH easier and less finicky. If anyone in interested in a crudely assembled document about how I did it, you are more than welcome to visit

Re: Image processing in Cocoa

2008-09-26 Thread Helder da Rocha
Since you can't use NSImage, you could try Core Image. You can do all that with CGImage in your restricted environment. You can use a bitmap or layer context and then later render it on whatever view you wish. There is a good Core Graphics Quartz tutorial at http://developer.apple.com/docume

Re: Properties and bindings

2008-09-26 Thread D.K. Johnston
It's working now, but I don't understand why. I've got two objects: MyController and MyModel. The interesting parts of the headers look like this: @interface MyModel : NSObject { NSInteger myInteger; } @property(assign) NSInteger myInteger; - (void)changeMyInteger; @end @interface

Re: Converting from Carbon Event Manager to NSTimer

2008-09-26 Thread Dan Birns
I have my problem largely resolved, and I thought I'd share the resolution. Some have written pointing out that the following code has a bug: timer = [NSTimer alloc]; [timer initWithFireDate:[NSDate date] interval:t target:self selector:@selector(mainLoopTimer:) userInfo:hal

unrecognized selector sent to instance

2008-09-26 Thread pan xuan
Hi, I am having a strange problem of my class declaration. I used to declare some methods of a class in a category, "Private". After I have done some refactoring work (basically moving some classes into another framework), it seems those methods declared in the category, "Private" do not belong

Re: NSOutlineView example

2008-09-26 Thread chaitanya pandit
Have a look at /Developer/Examples/Appkit/OutlineView On 26-Sep-08, at 2:08 PM, Arun wrote: Hello, Does anyone know or has good example code showing how to create a NSOutlineView, create a datasource and information to the datasource and display the final result. I am trying to dispaly a NS

NSOutlineView example

2008-09-26 Thread Arun
Hello, Does anyone know or has good example code showing how to create a NSOutlineView, create a datasource and information to the datasource and display the final result. I am trying to dispaly a NSDictionary in an oultlineview. Thanks Arun ___ Cocoa-

KVO observing across to-many relationships

2008-09-26 Thread Roland King
I managed to think myself into a corner with KVC/KVO, I was wondering if you can automatically observe across a to-many relationship, I can't see how you could, but cocoa often surprises me. Simple example would be .. I have a instance, race, of a Race object which has an array property 'c