Re: Control USB Power

2008-06-13 Thread David Duncan
On Jun 12, 2008, at 10:38 PM, Omar Qazi wrote: I have a Cocoa application that controls an external USB device. I want to be able to turn the device off when the user performs some action, like click a button. Is there a way in Cocoa or IOKit to disable power to a USB Socket? The

Re: Control USB Power

2008-06-13 Thread Robert Douglas
I assume you are talking about an external piece of equipment, not a USB hub etc. Some pieces of equipment have USB interfaces, but I suspect many can not turn themselves on and off in response to a USB command. Macs can, but that may be rare. Even so it would be worth checking the

Re: Table View/Array Troubles

2008-06-13 Thread Bob Warwick
On 13-Jun-08, at 2:21 AM, Kyle Sluder wrote: On Thu, Jun 12, 2008 at 2:00 AM, Bob Warwick [EMAIL PROTECTED] wrote: Calling the NSMutableArray convenience method array will return an autoreleased object. You should do this instead: - (id) init { [super init];

Re: Attack My Code! Part 1

2008-06-13 Thread Manfred Schwind
NSData* data = [ attrString RTFDFromRange:wholeStringRange documentAttributes:nil ]; [ thePasteboard setData:data forType:NSRTFPboardType ]; Either use RTFDFromRange and NSRTFDPboardType or RTFFromRange and NSRTFPboardType, but do not mix them. Maybe that's the reason for the garbage, I

Re: Table View/Array Troubles

2008-06-13 Thread Chris Hanson
On Jun 12, 2008, at 10:21 PM, Kyle Sluder wrote: If you're implementing the singleton pattern, for example, you would override -init differently. In most cases, I would strongly suggest *not* doing anything differently if you are making a singleton. If you want something to be a

Re: Mail Rule Actions Control

2008-06-13 Thread Steven Huey
Thanks Thomas, I had seen that, but was hoping to find some sample code. Best regards, Steven Huey On Jun 11, 2008, at 12:32 PM, Ken Thomases wrote: On Jun 11, 2008, at 6:17 AM, Steven Huey wrote: There's plenty of resources available for how to use a NSPredicateEditor... I'm interested in

Re: 3rd Party Nonsense (was Re: Regular Expressions?)

2008-06-13 Thread Alastair Houghton
On 10 Jun 2008, at 15:16, Chris Ridd wrote: On 10 Jun 2008, at 05:12, Mark Munz wrote: Just wishing for the problem to go away or blaming external criteria will almost guarantee that nothing gets done. Filing bugs is how you, the developer, communicate your needs to Apple. Since ICU is open

Re: Have questions...

2008-06-13 Thread Ian Joyner
On 13/06/2008, at 2:09 PM, Rick Langschultz wrote: Am I aloud to ask where I can submit my iPhone programming questions to? Yes, much to loud! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Geographic Location drag type

2008-06-13 Thread William Bates
Here's what I've decided to use. I put two flavors on the pasteboard: com.knowledgeengineering.ISO6709.string a UTF8 string conforming to ISO6709 com.knowledgeengineering.ISO6709.dictionary a CFDictionary containting 3 CFNumbers of type double (kCFNumberDoubleType) with keys: latitude,

Custom mouse cursor in NSTextView

2008-06-13 Thread Todd Ransom
Hi All, I have a fullscreen text view in my app that allows the user to set a foreground and background color. Problem is, for some configurations the default I-beam mouse cursor does not show up very well so I want to provide a custom I-beam cursor in the same color as the text. I put

[NSOutlineView/NSTableView] Returning nil enables auto-edition?

2008-06-13 Thread Stephane Sudre
Mac OS X 10.4.11 (PPC) I'm seeing a potential bug or unsupported behavior when it comes to cell edition. I have a NSOutlineView. One of the column data cell of this view is a text field cell which is potentially editable. Now, if I return nil in - (id) outlineView:(NSOutlineView *)

Bindings and To-Many Relationship

2008-06-13 Thread Milen Dzhumerov
Hi all, I've got a question regarding bindings and to-many relationships. I've got my own array controller which has a arrangedObjects property. It is KVO observable as in notifications are sent when objects are added / removed (and obviously if the actually content array changes). Now

Re: [NSOutlineView/NSTableView] Returning nil enables auto-edition?

2008-06-13 Thread Corbin Dunn
You probably mean, editing (not edition). I have a NSOutlineView. One of the column data cell of this view is a text field cell which is potentially editable. Now, if I return nil in - (id) outlineView:(NSOutlineView *) inOutlineView objectValueForTableColumn:(NSTableColumn *)

Meetup - Macs in Prague (Czech Republic)

2008-06-13 Thread Simon Liu
Fellow coders, WWDC is drawing to a close, your team is heading out of Euro 2008, and long hot summer nights are upon us... so come to Prague to chill out and meet other Mac folk to discuss all things Mac, iPhone and to swap stories about life as an indie... Good beer, good chat, what are you

Re: PerlObjCBridge and SFAuthorization

2008-06-13 Thread Cameron Smith
For those reading this later and hoping for an answer, I was unable to find one and abandoned this approach shortly after the original post. Instead I wrote my own Perl module in C and used the OpenDirectory and Security frameworks to expose routines for authentication, authorization and

Transparent Window

2008-06-13 Thread Philip Lee Bridson
Hi Guys, I have a window that displays an image, I want the window to be transparent so that only the image is displayed and not have the white background that is present due to the window. I have tried sub- classing NSWindow and making the window transparent but then nothing is displayed

Re: Bindings and To-Many Relationship

2008-06-13 Thread Quincey Morris
On Jun 13, 2008, at 10:39, Milen Dzhumerov wrote: I've got a question regarding bindings and to-many relationships. I've got my own array controller which has a arrangedObjects property. It is KVO observable as in notifications are sent when objects are added / removed (and obviously if

Re: Transparent Window

2008-06-13 Thread Jean-Daniel Dupas
Le 13 juin 08 à 20:47, Philip Lee Bridson a écrit : Hi Guys, I have a window that displays an image, I want the window to be transparent so that only the image is displayed and not have the white background that is present due to the window. I have tried sub- classing NSWindow and making

Still trying to refactor a category as a class

2008-06-13 Thread Paul Archibald
Comrades: Geez, I am feeling totally wrapped around the axle here. I have posted questions on this project a couple of times, and have gotten useful answers that allow me to continue. Sometimes I think I am heading deeper into the weeds, though. So, let me try rephrasing my situation and

duplicating views

2008-06-13 Thread Torsten Curdt
I have a NSView template in my nib that I am duplicating in a container view like this: - (void) awakeFromNib { NSView *view; NSData *templateView = [NSArchiver archivedDataWithRootObject:myView]; view = [NSUnarchiver unarchiveObjectWithData:templateView]; [self

How to mix Check boxes and Radio buttons in NSOutlineView?

2008-06-13 Thread John
Hi, I have a two level hierarchy displayed in NSOutlineView. Currently all items have check boxes, but I have a request to replace check boxes by radio buttons in some branches of the hierarchy, where only one item can be checked at a time. Other branches should keep check boxes, which allow

Re: duplicating views

2008-06-13 Thread I. Savant
I have a NSView template in my nib that I am duplicating in a container view like this: snip Unfortunately (but to no big surprise) this does not set the IBOutlets. Is there any other way but injecting the references myself? If you have a 'reusable' portion of UI, the (usually) best

Re: How to mix Check boxes and Radio buttons in NSOutlineView?

2008-06-13 Thread I. Savant
I tried to call [cell setButtonType:NSRadioButton]; in - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item but that had no effect - check boxes are still displayed. Please get into the practice of posting the

Re: Still trying to refactor a category as a class

2008-06-13 Thread Jack Repenning
On Jun 13, 2008, at 12:16 PM, Paul Archibald wrote: Given my description of this project, does the two controller solution sound like the best one? Does anyone have any tips on how to re-factor this thing? My first effort kind of blew up in my face. I could not figure out how to do it

xml parsing

2008-06-13 Thread Bart Beulen
Hi All I'm new to cocoa and working on an xml parser. I would like to parse xml files like the following example poi descriptionbla bla/description imageimag1/image urlhttp://www.blabla.com/url /poi poi descriptionbla bla2/description imageimag2/image

Re: xml parsing

2008-06-13 Thread Mike Manzano
Try posting some code. On Jun 13, 2008, at 1:54 PM, Bart Beulen wrote: Hi All I'm new to cocoa and working on an xml parser. I would like to parse xml files like the following example poi descriptionbla bla/description imageimag1/image urlhttp://www.blabla.com/url

Re: xml parsing

2008-06-13 Thread Steve Majewski
Your example is not a valid xml file. You should have only a single document root element. You can check your test files first with xmllint. ( I don't use the Cocoa XML wrappers myself, but in SAX there are config options for the parser that may affect what errors are reported. Some

Re: When is a document moved or renamed?

2008-06-13 Thread Andy Mroczkowski
I had this same problem. I was storing some flat-file slave documents inside a package-based master document. This led to several problems: Internally NSDocument stores its path as an FSRef, not just a URL. FSRefs allow you to track files as they move around the volume. Convenient.

Nib file not created - Xcode 3.1

2008-06-13 Thread Michael Hernandez
Downloaded xcode 3.1, now when I create a new project in Xcode. Choosing Document-based application or Core Data Document-based application (are the two types I’ve tried), MainMenu.nib or MyDocument.nib files are not created. There are MainMenu.xib and a MyDocument.xib. Am I doing

How does an instance variable in the ObjC code get connected to an interface element in the NIB file?

2008-06-13 Thread Paul Archibald
Comrades: This puzzles me. I am tracing through some code in which I am looking at the value of some selected popup menu items. I am seeing the correct values for them, but I have to confess I don't know how the code is connected to the popup, or just why the code even works! I see the

Re: Nib file not created - Xcode 3.1

2008-06-13 Thread Dale Jensen
On Jun 13, 2008, at 5:21 PM, Michael Hernandez wrote: Downloaded xcode 3.1, now when I create a new project in Xcode. Choosing Document-based application or Core Data Document-based application (are the two types I’ve tried), MainMenu.nib or MyDocument.nib files are not created. There

Re: PerlObjCBridge and SFAuthorization

2008-06-13 Thread Sherm Pendley
On Tue, Apr 29, 2008 at 4:59 PM, Cameron Smith [EMAIL PROTECTED] wrote: my $frameworkPath = NSString-stringWithCString_('/System/Library/Frameworks/Security.framework'); my $framework = NSBundle-alloc-init-initWithPath_($frameworkPath); You're calling both init() and initWithPath_() here, but

Re: Nib file not created - Xcode 3.1

2008-06-13 Thread Aaron Wallis
XIB files are the new black. http://speirs.org/2007/12/05/what-are-xib-files/ On 14/06/2008, at 8:21 AM, Michael Hernandez wrote: Downloaded xcode 3.1, now when I create a new project in Xcode. Choosing Document-based application or Core Data Document-based application (are the two types

Re: PerlObjCBridge and SFAuthorization

2008-06-13 Thread Sherm Pendley
On Fri, Jun 13, 2008 at 2:41 PM, Cameron Smith [EMAIL PROTECTED] wrote: For those reading this later and hoping for an answer, I was unable to find one and abandoned this approach shortly after the original post. Oops, sorry - I saw your followup and didn't realize how old the original post

Re: toggleToolbarShown: How do I localize the menu item strings for non-supported languages?

2008-06-13 Thread Peter Ammon
Hi Ulf, There's no simple way to inform AppKit of your translations of these strings. The simplest way to insert your own titles is to do it in validateUserInterfaceItem like this: @implementation MyWindow - (BOOL)validateUserInterfaceItem:(id NSValidatedUserInterfaceItem)item {

Re: NSToolbarItems - can I define the sorting in the customization palette

2008-06-13 Thread Peter Ammon
On Jun 11, 2008, at 11:54 AM, Ulf Dunkel wrote: Is there any method to sort NSToolbarItem objects for the representation in the customization sheet which is shown on runToolbarCustomizationPalette: ? Any help is appreciated. Ulf Dunkel NSToolbar uses the order of the item identifiers

Re: duplicating views

2008-06-13 Thread Torsten Curdt
On Jun 13, 2008, at 13:01, I. Savant wrote: I have a NSView template in my nib that I am duplicating in a container view like this: snip Unfortunately (but to no big surprise) this does not set the IBOutlets. Is there any other way but injecting the references myself? If you have a

converting HTML causes crash

2008-06-13 Thread Rod Schmidt
I'm trying to convert some HTML to an attributed string to display in a text view. The conversion takes place fine using NSAtrributedString initWithData:..., but later on I get an EXC_BAD_ACCESS. Here's the stack trace where it usually happens (sometimes its different): #0 0x911546e8

Re: duplicating views

2008-06-13 Thread I. Savant
Hm ...factored out NIBs before. But in this case it just felt a bit award to use this for potentially like a few hundred items. Is your current approach working smoothly? No? Then the usual way is probably best. ;-) -- I.S. ___ Cocoa-dev

PDFView's NSPrintPanel : Determine if Print / Cancel clicked?

2008-06-13 Thread Wilhelm Phillips
Hi Everyone, Problem: I'm trying to determine what button a user clicks in PDFViews' print dialog (i.e. Print, Cancel, etc.) so that I can adjust custom PDFPage drawing after the page has printed successfully. Calling [myPDFView printWithInfo:[NSPrintInfo sharedPrintInfo] autoRotate:YES]

Re: How does an instance variable in the ObjC code get connected to an interface element in the NIB file?

2008-06-13 Thread Robert Martin
Hint: If you want to ask a question about your code, we're not psychics On Jun 13, 2008, at 5:21 PM, Paul Archibald wrote: Comrades: This puzzles me. I am tracing through some code in which I am looking at the value of some selected popup menu items. I am seeing the correct values for

Re: duplicating views

2008-06-13 Thread Graham Cox
I've done exactly this in the past and it worked fine. I just checked my code to see if I was doing anything different from you - I'm not: view = [NSUnarchiver unarchiveObjectWithData:[NSArchiver archivedDataWithRootObject:prototypeView]]; However, I'm not relying on the view having

Re: Still trying to refactor a category as a class

2008-06-13 Thread Ken Thomases
On Jun 13, 2008, at 2:16 PM, Paul Archibald wrote: The project I am working on is used to make and distribute copies of certain files. I am trying to add a module that will do some extra processing of the files, and then distributing copies of that new, processed file. I was given the

Re: How does an instance variable in the ObjC code get connected to an interface element in the NIB file?

2008-06-13 Thread Ken Thomases
On jun 13, 2008, at 4:21 PM, Paul Archibald wrote: This puzzles me. I am tracing through some code in which I am looking at the value of some selected popup menu items. I am seeing the correct values for them, but I have to confess I don't know how the code is connected to the popup, or

Re: PDFView's NSPrintPanel : Determine if Print / Cancel clicked?

2008-06-13 Thread Joel Norvell
Hi Will, I'm not sure what you mean by adjust custom PDFPage drawing after the page has printed. And this may be no help at all, but if you could factor that drawing into drawPagePost (in 10.5 PDF Kit), then it wouldn't be printed, but it would be drawn on the screen. You could look at John

Re: converting HTML causes crash

2008-06-13 Thread Jens Alfke
On 13 Jun '08, at 4:22 PM, Rod Schmidt wrote: later on I get an EXC_BAD_ACCESS. Here's the stack trace where it usually happens (sometimes its different): #0 0x911546e8 in objc_msgSend #1 0x9331aed9 in _NSValuesAreEqual A crash in objc_msgSend almost always means something's

Re: PDFView's NSPrintPanel : Determine if Print / Cancel clicked?

2008-06-13 Thread Wilhelm Phillips
Hi Joel, Thanks for responding. I have experimented with drawPagePost:, but in this case I'm drawing certificate numbers on the page that need to print and the numbering is managed by my app. Notification that the print job has gone through successfully would tell my app to increment

looking for a crc code

2008-06-13 Thread Angelo Chen
Hi, Is there a crc code that can be used directly in Objective-C? any tips? Thanks. Angelo Yahoo! Mail具備一流的網上安全保護功能,請前往 http://hk.antispam.yahoo.com/ 了解更多相關資訊! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: looking for a crc code

2008-06-13 Thread Graham Cox
No, but this was turned up on Google in about a third of a second: http://www.programmersheaven.com/download/13761/download.aspx Then, read this: http://catb.org/~esr/faqs/smart-questions.html hth, Graham On 14 Jun 2008, at 2:34 pm, Angelo Chen wrote: Hi, Is there a crc code that can

Re: How hard is it to learn Cocoa - Survey ?

2008-06-13 Thread Georg Tuparev
On May 25, 2008, at 1:18 PM, Erik Buck wrote: So this is a survey: For those who consider themselves intermediate to advanced Cocoa programmers, how long was the journey from newbie to competent and from competent to advanced ? What percentage of your time did you dedicate over how many

Re: duplicating views

2008-06-13 Thread Michael Ash
On Fri, Jun 13, 2008 at 4:05 PM, Torsten Curdt [EMAIL PROTECTED] wrote: Hm ...factored out NIBs before. But in this case it just felt a bit award to use this for potentially like a few hundred items. If you use NSNib, you can load the file just once, then instantiate it many times. This avoids

Re: duplicating views

2008-06-13 Thread Graham Cox
On 14 Jun 2008, at 11:10 am, Graham Cox wrote: However, I'm not relying on the view having outlets to its subviews set - in fact I don't have any outlets. Instead I embed the controls normally and find them later using their tags. This works well in my case because I'm not using the tags

Re: xml parsing

2008-06-13 Thread Mike
Steve Majewski wrote: Your example is not a valid xml file. You should have only a single document root element. You can check your test files first with xmllint. ( I don't use the Cocoa XML wrappers myself, but in SAX there are config options for the parser that may affect what errors are