Re: Seeking advice on best practice for managing visibility of many subviews

2009-04-02 Thread WT
From the perspective of efficiency, I speculate that hiding/showing views would be a better approach, given that adding/removing subviews has to traverse and manipulate the view hierarchy, which could be potentially an expensive proposition (unless all the subviews are siblings of one

UITableView port to Mac?

2009-04-02 Thread Seth Pellegrino
Hello list, I'm looking for something similar to UITableView for Mac development. NSCollectionView seems a little like what I'd want, but the API on UITableView is much cleaner and easier to use (and I'm only really interested in a single column rather than a grid). I've also looked at

Content of the page cleared

2009-04-02 Thread developers mac
hi there, I am working on a iphone project. I have 2 forms named as a b. Actions : I move from form a to b return back to form a. But when i do this all the contents of the form a gets refreshed (textfield, lables gets cleared). How to eliminate this for the same action. Thanks in

Re: UITableView port to Mac?

2009-04-02 Thread René v Amerongen
Hi On 2 apr 2009, at 08:46, Seth Pellegrino wrote: Hello list, I'm looking for something similar to UITableView for Mac development. NSCollectionView seems a little like what I'd want, what is your definition of 'a little like what I'd want'. What do you need? but the API on

Re: Bindings and MenuItems

2009-04-02 Thread Alexander Spohr
Am 02.04.2009 um 06:59 schrieb Ben Lachman: Yeah, I ended up reverting to just setting the target of the menu item in code when certain notifications happened (NSWindowDidBecomeKey and NSOutlineViewSelectionDidChange). This works, but isn't quite as simple as a bindings based solution

Re: Seeking advice on best practice for managing visibility of many subviews

2009-04-02 Thread Alexander Spohr
Am 02.04.2009 um 04:47 schrieb Stuart Malin: I have a view that has hundreds of subviews. This sounds like a conceptual error. You could make something like cells instead of views, to avoid the NSView overhead. Arrange them in groups (NSArray/NSSet?) Then just don’t draw the groups you

Re: Seeking advice on best practice for managing visibility of many subviews

2009-04-02 Thread Stuart Malin
On Apr 1, 2009, at 10:54 PM, Alexander Spohr wrote: Am 02.04.2009 um 04:47 schrieb Stuart Malin: I have a view that has hundreds of subviews. This sounds like a conceptual error. You could make something like cells instead of views, to avoid the NSView overhead. Arrange them in groups

Huge and weird problem with NSScanner

2009-04-02 Thread Gustavo Adolfo Pizano
Hello, Im reading a txt file, big one, and the only way (I see) to read specific areas of the  file for my final goal, is using the NSScanner.  now, I set up the Scanner with the string I get from the file like this: inputString = [ NSString stringWithCString:[ inputData bytes ]

Re: Huge and weird problem with NSScanner

2009-04-02 Thread Jonathan Hess
Hey Gustavo - This is probably auxiliary to your problem, but are you running 32-bit or 64-bit? The reason I ask is that the %i format specifier is for an 'int', but NSUInteger is a 'unsigned long' when running 64 bit. You should probably change that NSLog line to NSLog(@initial %lu,

Re: Looking for [NSNumber numberWithString:]

2009-04-02 Thread Graham Cox
On 02/04/2009, at 12:17 PM, Greg Robertson wrote: I would like to convert an NSString to an NSNumber. Is there a direct method for this or should I go NSString to double and then double to NSNumber? One reason this isn't directly supported is probably because it only has meaning within a

Re: Looking for [NSNumber numberWithString:]

2009-04-02 Thread Kyle Sluder
On Wed, Apr 1, 2009 at 9:17 PM, Greg Robertson trifus...@gmail.com wrote: I would like to convert an NSString to an NSNumber. Is there a direct method for this or should I go NSString to double and then double to NSNumber? Use an NSNumberFormatter. Then your results will actually be valid for

RE: How to synchronize two managedObjectContexts...

2009-04-02 Thread Jon C. Munson II
Namaste! OK, after spending gobs of time (and some sleep) on this, I solved my issue. In my NSWindowController subclass's .m file I added in the filename processing routine (which is readFromPasteBoard which is called from performDrop): [[NSNotificationCenter defaultCenter] addObserver:self

Re: How to download images for a contact in Cocoa?

2009-04-02 Thread Clint Shryock
Should you be using stringByAddingPercentEscapesUsingEncoding: instead of stringByReplacingPercentEscapesUsingEncoding: ? unless I'm reading that wrong it seems like you're taking a encoded URL and decoding it. I don't believe you need to initiate a download process, that method should take care

Re: disable row highlighting NSTableView

2009-04-02 Thread Jo Phils
Hello again, I have looked into this a bit more and it seems I still do something wrong? I make a new class file and set it to be a subclass of NSTableView and insert the following method: If you're building for Leopard only, subclass NSTableView so that this method is a no-op: -

Re: disable row highlighting NSTableView

2009-04-02 Thread Graham Cox
On 03/04/2009, at 12:10 AM, Jo Phils wrote: But how exactly do I make this method a no-op? Please forgive my ignorance... :-) As you have it shown there, it is a no-op. In other words, it does nothing. --Graham ___ Cocoa-dev mailing list

bitmapImageRepForCachingDisplayInRect CALayers ...

2009-04-02 Thread Mic Pringle
Hi, I have an NSView that hosts several CAlayers. Each layer composites an image over the previous ones to build up a complete image (think layers in Photoshop). What I'd like to do now is get an image rep of what the user see's on screen, the final image as it were. I know I can use

Re: Best Strategy to Control iTunes

2009-04-02 Thread Ammar Ibrahim
On Thu, Apr 2, 2009 at 12:07 AM, Bill Bumgarner b...@mac.com wrote: On Apr 1, 2009, at 2:04 PM, ammar.ibrahim wrote: Right now, I'm more confused than I was, hehe. My question is: Why would I care about thread safety? Assuming that everytime I communicate with iTunes I create a thread and

Re: disable row highlighting NSTableView

2009-04-02 Thread Jens Miltner
Am 02.04.2009 um 15:10 schrieb Jo Phils: Hello again, I have looked into this a bit more and it seems I still do something wrong? I make a new class file and set it to be a subclass of NSTableView and insert the following method: If you're building for Leopard only, subclass

Re: UITableView port to Mac?

2009-04-02 Thread Andreas Mayer
Am 02.04.2009 um 08:46 Uhr schrieb Seth Pellegrino: NSCollectionView seems a little like what I'd want, but the API on UITableView is much cleaner and easier to use (and I'm only really interested in a single column rather than a grid). I've also looked at stepwise's method for using

Printing/reports?

2009-04-02 Thread Jon C. Munson II
Namaste! Can anyone recommend a really good resource, or any good resources for that matter, that cover printing in-depth? I'd like to create some data-based reports and so on, but got hung up with the impending complexity and lack of knowledge in that area. For now I'm using DrawWell's

core data, opening a previously saved xml file... bug/glitch/unexpected behavior

2009-04-02 Thread eblugamma
hi, this SHOULD be automatic, if its a bug I'm guessing its WELL documented, but no matter how well I search, I can't get ANY hits on this. my application is Not Properly Loading my saved Core Data files. I have a very simple Core data App. it has 3 entities, two of them have relationships

Re: Huge and weird problem with NSScanner

2009-04-02 Thread Gustavo Pizano
I think I have a solution, it seems that the encoding of the text file, which was an output from a Piece Of Crap computer AKA PC: windows, was different from the one Im using inside the application, so what I did was to open the file and save it with the proper encoding, then all its

Re: disable row highlighting NSTableView

2009-04-02 Thread Jo Phils
Ok thank you both. I was thinking that and seems I did try it...but maybe I did something else wrong. Ok I will work on it some more. Thank you so much! rick From: Jens Miltner j...@mac.com To: Jo Phils jo_p...@yahoo.com Cc: Cocoa List

Re: disable row highlighting NSTableView

2009-04-02 Thread I. Savant
On Thu, Apr 2, 2009 at 10:56 AM, Jo Phils jo_p...@yahoo.com wrote: Ok thank you both. I was thinking that and seems I did try it...but maybe I did something else wrong. Ok I will work on it some more. Thank you so much! Have you set your table view's class in Interface Builder to be your

Re: Printing/reports?

2009-04-02 Thread John Velman
Jon C. Munson II jmun...@his.com writes: Namaste! Can anyone recommend a really good resource, or any good resources for that matter, that cover printing in-depth? I'd like to create some data-based reports and so on, but got hung up with the impending complexity and lack of knowledge in

Re: Best Strategy to Control iTunes

2009-04-02 Thread Kyle Sluder
On Thu, Apr 2, 2009 at 9:22 AM, Ammar Ibrahim ammar.ibra...@gmail.com wrote: To sum up, you mean I should use osascript in a separate process? How can I achieve that, and how can I have this separate process communicate back to the main process? NSTask creates child processes. The general

Re: Printing/reports?

2009-04-02 Thread I. Savant
On Thu, Apr 2, 2009 at 10:26 AM, Jon C. Munson II jmun...@his.com wrote: Can anyone recommend a really good resource, or any good resources for that matter, that cover printing in-depth? Nothing Google can't find, I'm afraid. I'd like to create some data-based reports and so on, but got

RE: Printing/reports?

2009-04-02 Thread Jon C. Munson II
Namaste! OK, I'll give that a look-see as well. Thanks! Peace, Love, and Light, /s/ Jon C. Munson II -Original Message- From: I. Savant [mailto:idiotsavant2...@gmail.com] Sent: Thursday, April 02, 2009 11:26 AM To: jmun...@his.com Cc: Cocoa Developers Subject: Re:

Update UITextField

2009-04-02 Thread Barry Fawthrop
Trying to Update a UITextField from a c function I have a UITextField on the Window in controller.h IBOutlet UITextField *username; I have a c function getName(); in controller.m Collect linked to NSButton -(IBAction)Collect:(id)sender { ... ... getName(); ... } void

Re: Update UITextField

2009-04-02 Thread Nick Zitzmann
On Apr 2, 2009, at 10:51 AM, Barry Fawthrop wrote: The setText Fails to compile error 'username' undeclared How should I set the Value ??? You'll need to pass the class in as an argument, since C functions don't have any concept of self, even when the function is declared within the

Example of collapsible disclosure view

2009-04-02 Thread Robert Mullen
I am working on a view and window that needs to collapse/expand with a disclosure triangle and cause the Window containing it to resize as well as the controls that are static to reposition. The effect I am after is much like the disclosure triangle in a print dialog. Is there an example

Automatic code generation for C++/Objective C bridge

2009-04-02 Thread Ashish Sharma
Greetings! I am seeking an opinion from the Cocoa developers here about a new project. The idea is to start an open source initiative using swig (www.swig.org) for automatically generating the C++/Objective C bridge. Apple provides a very good support for mixing objective c and c++ via objective

Re: Example of collapsible disclosure view

2009-04-02 Thread Scott Anguish
doing a full text search on collapsible disclosure view in Xcode shows this example http://developer.apple.com/samplecode/Reducer/ On 2-Apr-09, at 12:57 PM, Robert Mullen wrote: I am working on a view and window that needs to collapse/expand with a disclosure triangle and cause the Window

Re: Example of collapsible disclosure view

2009-04-02 Thread Scott Anguish
Searching for just disclosure view also brings up the iSpend example which also implements one On 2-Apr-09, at 12:57 PM, Robert Mullen wrote: I am working on a view and window that needs to collapse/expand with a disclosure triangle and cause the Window containing it to resize as well

Disabling Highlighting of Row Selection in NSTableView

2009-04-02 Thread Sourabh Sahu
Hi Everyone, I tried highlighSelectionInClipRect method set the color but I still getting row selected,but there is gap between cells. But it still m not able to remove it completely,Please reply Sourabh DISCLAIMER == This e-mail may contain privileged and confidential information

Re: Looking for [NSNumber numberWithString:]

2009-04-02 Thread Greg Robertson
Thanks to everyone who helped me out with this. I really appreciate it. Greg ___ 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

[Q] doubleAction on a NSTableView misbehaving?

2009-04-02 Thread Eric Gorr
The documentation for setDoubleAction on a NSTableView states: If the double-clicked cell is editable, this message isn’t sent and the cell is edited instead. However, the behavior I am seeing is that although my double-clicked cell is editable (tableView:shouldEditTableColumn:row:

Re: [Q] doubleAction on a NSTableView misbehaving?

2009-04-02 Thread Quincey Morris
On Apr 2, 2009, at 11:11, Eric Gorr wrote: The documentation for setDoubleAction on a NSTableView states: If the double-clicked cell is editable, this message isn’t sent and the cell is edited instead. However, the behavior I am seeing is that although my double-clicked cell is

KVO or Value Transformer?

2009-04-02 Thread Trygve Inda
I need to enable a view if the value of a popup menu is kSomeValue or kSomeOtherValue, and disable it otherwise. The popup's value is bound to an NSNumber in a NSDictionary. I think I could add an observer for this and manually enable/disable the view when the popup value meets my criteria...

Re: disable row highlighting NSTableView

2009-04-02 Thread Jo Phils
Thank you very much. I was able to get it working by either using a single private method or also subclassing my Cell and using two public methods. No more highlighting although the font does still slightly change when you select a row, but I guess that's as good as it gets. :-) Thank you to

Re: Toll-free bridge type at runtime

2009-04-02 Thread Marcel Weiher
On Apr 1, 2009, at 21:44 , Michael Ash wrote: On Thu, Apr 2, 2009 at 12:33 AM, Ryan Joseph [distinguishing between NSArray and CFArray] The test cannot be performed, because the question does not make any sense. While this answer is mostly true for what the original poster is trying to

Re: [Q] doubleAction on a NSTableView misbehaving?

2009-04-02 Thread Eric Gorr
On Apr 2, 2009, at 2:34 PM, Quincey Morris wrote: On Apr 2, 2009, at 11:11, Eric Gorr wrote: The documentation for setDoubleAction on a NSTableView states: If the double-clicked cell is editable, this message isn’t sent and the cell is edited instead. However, the behavior I am

re: core data, opening a previously saved xml file... bug/glitch/unexpected behavior

2009-04-02 Thread Ben Trumbull
this SHOULD be automatic, if its a bug I'm guessing its WELL documented, but no matter how well I search, I can't get ANY hits on this. my application is Not Properly Loading my saved Core Data files. Core Data relies on NSXMLDocument for its XML parsing and serialization. There was

Re: [Q] doubleAction on a NSTableView misbehaving?

2009-04-02 Thread Eric Gorr
On Apr 2, 2009, at 3:28 PM, Eric Gorr wrote: On Apr 2, 2009, at 2:34 PM, Quincey Morris wrote: On Apr 2, 2009, at 11:11, Eric Gorr wrote: The documentation for setDoubleAction on a NSTableView states: If the double-clicked cell is editable, this message isn’t sent and the cell is

Re: [Q] doubleAction on a NSTableView misbehaving?

2009-04-02 Thread Quincey Morris
On Apr 2, 2009, at 12:28, Eric Gorr wrote: So, it doesn't seem possible to, for example, avoid have the doubleAction invoked if -hitTestForEvent:inRect:ofView: returns NSCellHitEditableTextArea. I would still like the edit to start if the user double-clicks on the editable part of the

Re: KVO or Value Transformer?

2009-04-02 Thread Quincey Morris
On Apr 2, 2009, at 11:53, Trygve Inda wrote: I need to enable a view if the value of a popup menu is kSomeValue or kSomeOtherValue, and disable it otherwise. The popup's value is bound to an NSNumber in a NSDictionary. I think I could add an observer for this and manually enable/disable the

Re: [Q] doubleAction on a NSTableView misbehaving?

2009-04-02 Thread Corbin Dunn
Hi Eric, The documentation for setDoubleAction on a NSTableView states: If the double-clicked cell is editable, this message isn’t sent and the cell is edited instead. Oops! Can you please use the documentation feedback to log some feedback and say that is incorrect. snip Actually,

Re: Disabling Highlighting of Row Selection in NSTableView

2009-04-02 Thread Corbin Dunn
Hi Sourabh, It sounds like you missed my prior reply to your original email. Here it is again: This should work on tiger too. You also should subclass your cells and make sure they don't draw any highlighting by overriding this and returning nil: - (NSColor

Re: Toll-free bridge type at runtime

2009-04-02 Thread Michael Ash
On Thu, Apr 2, 2009 at 3:20 PM, Marcel Weiher marcel.wei...@gmail.com wrote: On Apr 1, 2009, at 21:44 , Michael Ash wrote: On Thu, Apr 2, 2009 at 12:33 AM, Ryan Joseph [distinguishing between NSArray and CFArray] The test cannot be performed, because the question does not make any sense.

Re: NSPopUpButton pullsDown:YES and dummy first item - normal?

2009-04-02 Thread Michael Ash
On Thu, Apr 2, 2009 at 7:58 AM, Graham Cox graham@bigpond.com wrote: On 02/04/2009, at 12:55 PM, Rua Haszard Morris wrote: This seems like a weird hack, and makes me think I'm going about this the wrong way - is this a normal approach? I'm afraid so. I think the reason could be

Re: NSPopUpButton pullsDown:YES and dummy first item - normal?

2009-04-02 Thread Rua Haszard Morris
Thanks for the suspicion-confirmation and docs pointers. I had seen the conceptual info about the 1 versus zero thing: my problem with that documentation is it says the first item is stored at 1 - which is written the wrong way around, in that the first item is stored at zero, but is

Problem with NSOutlineView

2009-04-02 Thread Laurent Daudelin
Hello all. I'm using an NSOutlineView driven by an NSTreeController. I use it to display the file system from different location on disks, a bit like in the Finder in 10.5 with the sidebar. The problem I'm having is when I expand an item from one location and then switch to another

Re: [Q] doubleAction on a NSTableView misbehaving?

2009-04-02 Thread Eric Gorr
On Apr 2, 2009, at 4:31 PM, Corbin Dunn wrote: Hi Eric, The documentation for setDoubleAction on a NSTableView states: If the double-clicked cell is editable, this message isn’t sent and the cell is edited instead. Oops! Can you please use the documentation feedback to log some

Re: Toll-free bridge type at runtime

2009-04-02 Thread Marcel Weiher
On Apr 2, 2009, at 13:54 , Michael Ash wrote: On Thu, Apr 2, 2009 at 3:20 PM, Marcel Weiher marcel.wei...@gmail.com wrote: On Apr 1, 2009, at 21:44 , Michael Ash wrote: On Thu, Apr 2, 2009 at 12:33 AM, Ryan Joseph [distinguishing between NSArray and CFArray] The test cannot be performed,

NSDocument Object Changing

2009-04-02 Thread K . Darcy Otto
I am writing a document-based application, and seem to be having a problem with my NSDocument object (using the standard MyDocument.h/m) changing. In particular, I have a toolbar button that brings up a previously populated NSWindowController and shows a window and a panel). The problem

Re: NSPopUpButton pullsDown:YES and dummy first item - normal?

2009-04-02 Thread Kyle Sluder
On Thu, Apr 2, 2009 at 5:18 PM, Rua Haszard Morris r.haszardmor...@adinstruments.com wrote: I had seen the conceptual info about the 1 versus zero thing: my problem with that documentation is it says the first item is stored at 1 - which is written the wrong way around, in that the first item

Re: Toll-free bridge type at runtime

2009-04-02 Thread Michael Ash
On Thu, Apr 2, 2009 at 6:11 PM, Marcel Weiher marcel.wei...@gmail.com wrote: On Apr 2, 2009, at 13:54 , Michael Ash wrote: On Thu, Apr 2, 2009 at 3:20 PM, Marcel Weiher marcel.wei...@gmail.com wrote: On Apr 1, 2009, at 21:44 , Michael Ash wrote: On Thu, Apr 2, 2009 at 12:33 AM, Ryan

NSData encode decode

2009-04-02 Thread James Maxwell
I'm having some real trouble with encoding/decoding a 2D float matrix wrapped in an NSData. I'm doing this: - (void)encodeWithCoder:(NSCoder*) coder { NSUInteger mGraphSize = self containerNode] spatialPooler] quantizationCentres] count] * self

Non-pageable app

2009-04-02 Thread Rich Collyer
Is there a way to mark as application (or at least its heap) as non- pageable. +++ Rich Collyer - Senior Software Engineer +++ smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list

Re: NSData encode decode

2009-04-02 Thread James Maxwell
Just a quick update... If I do this: const float *markovBytes = (float *)[coder decodeBytesForKey:@normalizedMarkovGraph returnedLength:mGraphSize]; [self setNormalizedMarkovGraph:[NSData dataWithBytes:markovBytes length:mGraphSize]]; it seems to work (it doesn't raise an exception). Don't

Loading a view controller from a tab bar controller

2009-04-02 Thread Weydson Lima
Hello there, Another noob question that I couldn't find a solution yet. In my mainwindow xib file, I have a tab bar controller which has two different view controllers. However, when I create those view controllers, how can I set the view property to a view controller instead of just a

Re: Toll-free bridge type at runtime

2009-04-02 Thread Clark Cox
On Thu, Apr 2, 2009 at 3:11 PM, Marcel Weiher marcel.wei...@gmail.com wrote: On Apr 2, 2009, at 13:54 , Michael Ash wrote: On Thu, Apr 2, 2009 at 3:20 PM, Marcel Weiher marcel.wei...@gmail.com wrote: On Apr 1, 2009, at 21:44 , Michael Ash wrote: On Thu, Apr 2, 2009 at 12:33 AM, Ryan

Re: Non-pageable app

2009-04-02 Thread Clark Cox
On Thu, Apr 2, 2009 at 3:50 PM, Rich Collyer rcoll...@ironkey.com wrote: Is there a way to mark as application (or at least its heap) as non-pageable. You could ask the kernel to wire down your memory to physical memory, but that is usually a very Bad Idea. -- Clark S. Cox III

Re: Non-pageable app

2009-04-02 Thread Dave Carrigan
On Apr 2, 2009, at 3:50 PM, Rich Collyer wrote: Is there a way to mark as application (or at least its heap) as non- pageable. mlock(2) might be what you're looking for, but we would need more information on what you are specifically attempting to do. -- Dave Carrigan d...@rudedog.org

Re: Toll-free bridge type at runtime

2009-04-02 Thread Marcel Weiher
NSArray / \ NSCFArrayMYNSArray From the Objective-C perspective, there is no such thing as NSArray; Sure there is. it is a class cluster, So apart from being a class cluster (which is also something and not no thing) it is also an actual

Re: Toll-free bridge type at runtime

2009-04-02 Thread Marcel Weiher
[On Apr 2, 2009, at 15:24 , Michael Ash wrote: yes/no/yes/no/yes/no...] Your answer is correct if and only if the NSArray in question is a NSCFArray. If the NSArray in question is not a NSCFArray, the question is valid (thought possibly not what the original author intended) and the

Re: Toll-free bridge type at runtime

2009-04-02 Thread Chris Suter
Hi Marcel, On Fri, Apr 3, 2009 at 10:37 AM, Marcel Weiher marcel.wei...@gmail.com wrote: So the compiler also disagrees with you that these are the same type.  You can *cast* them to be compatible, but they are not the same type. Right, but the original question was about figuring out what

Re: Toll-free bridge type at runtime

2009-04-02 Thread Marcel Weiher
On Apr 2, 2009, at 16:43 , Chris Suter wrote: On Fri, Apr 3, 2009 at 10:37 AM, Marcel Weiher marcel.wei...@gmail.com wrote: So the compiler also disagrees with you that these are the same type. You can *cast* them to be compatible, but they are not the same type. Right, but the

Re: Toll-free bridge type at runtime

2009-04-02 Thread Marcel Weiher
On Apr 2, 2009, at 17:06 , Marcel Weiher wrote: As I explained, it is trivially possible, because the only Objective- C class that is the same as its underlying CFType is NSCFArray. That is, of course, nonsense. All the other bridged class are as well, but NSArray itself or other direct

Re: Seeking advice on best practice for managing visibility of many subviews

2009-04-02 Thread Kyle Sluder
On Thu, Apr 2, 2009 at 5:21 AM, Stuart Malin stu...@zhameesha.com wrote: Alas, I don't believe it is a conceptual error, just a complex U/I -- the many views that I am controlling the display of each have multiple sub views themselves as well as multiple controls... text, images, and buttons.

Re: Toll-free bridge type at runtime

2009-04-02 Thread Chris Suter
Hi Marcel, On Fri, Apr 3, 2009 at 11:06 AM, Marcel Weiher marcel.wei...@gmail.com wrote: As I explained, Did you? it is trivially possible, because the only Objective-C class that is the same as its underlying CFType is NSCFArray.  So a simple test would be  [object class] == [NSCFArray

Re: Toll-free bridge type at runtime

2009-04-02 Thread Greg Guerin
Despite each side presenting its own test that proves its own case, may I suggest answering the OP's question: http://lists.apple.com/archives/cocoa-dev/2009/Apr/msg00082.html The conditions seem pretty clear to me. Last one to the garden gate is a rotten egg. ;-) -- GG

Re: NSPopUpButton pullsDown:YES and dummy first item - normal?

2009-04-02 Thread Michael Ash
On Thu, Apr 2, 2009 at 5:18 PM, Rua Haszard Morris r.haszardmor...@adinstruments.com wrote: Thanks for the suspicion-confirmation and docs pointers. I had seen the conceptual info about the 1 versus zero thing: my problem with that documentation is it says the first item is stored at 1 - which

Re: Toll-free bridge type at runtime

2009-04-02 Thread Michael Ash
On Thu, Apr 2, 2009 at 7:37 PM, Marcel Weiher marcel.wei...@gmail.com wrote: It can be distinguished from an array created using CFArrayCreate, just as it can be distinguished from an array created using [NSArray array], Glad that you agree that the test can be performed, which is different

Re: Loading a view controller from a tab bar controller

2009-04-02 Thread Jonathan Hess
Are you saying that you want to load the view controller's view from a separate NIB/XIB? If so, you can use the inspector for that view controller to set the NIB Name property to the name of an XIB file in your project. In that XIB file, the file's owner's class should be set to your view

Re: Toll-free bridge type at runtime

2009-04-02 Thread Ali Ozer
One point of the discussion is that there is no need to do this, and things you think you might want to do the test for are probably invalid. But, if you wanted to test, you could see if the instance you have isKindOfClass:[NSCFArray class]. However, this would be fragile, since NSCFArray

Re: NSData encode decode

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

Re: Toll-free bridge type at runtime

2009-04-02 Thread Ryan Joseph
On Apr 3, 2009, at 9:17 AM, Ali Ozer wrote: One point of the discussion is that there is no need to do this, and things you think you might want to do the test for are probably invalid. But, if you wanted to test, you could see if the instance you have isKindOfClass:[NSCFArray class].

Re: Toll-free bridge type at runtime

2009-04-02 Thread Greg Parker
On Apr 2, 2009, at 7:38 PM, Ryan Joseph wrote: What I'm really asking is there a way to know where they ORIGINATED from, CoreFoundation API or Cocoa. I said clever because there must be some sub-standard way to get this info, as this is a sub-standard situation. There is not. For example,

Re: Toll-free bridge type at runtime

2009-04-02 Thread Mark Ritchie
On 2-Apr-09, at 10:38 PM, Ryan Joseph wrote: I think I need explain what exactly I need this for. I'm making a Pascal bridge to Cocoa and it would be convenient if I could pass a CF type or a Pascal wrapper indiscriminately and decide at runtime how they should handled. If I knew the type

Re: Toll-free bridge type at runtime

2009-04-02 Thread Ryan Joseph
On Apr 3, 2009, at 9:59 AM, Mark Ritchie wrote: On 2-Apr-09, at 10:38 PM, Ryan Joseph wrote: I think I need explain what exactly I need this for. I'm making a Pascal bridge to Cocoa and it would be convenient if I could pass a CF type or a Pascal wrapper indiscriminately and decide at

Re: Toll-free bridge type at runtime

2009-04-02 Thread Michael Ash
On Thu, Apr 2, 2009 at 11:06 PM, Ryan Joseph thealchemistgu...@gmail.com wrote: On Apr 3, 2009, at 9:59 AM, Mark Ritchie wrote: On 2-Apr-09, at 10:38 PM, Ryan Joseph wrote: I think I need explain what exactly I need this for. I'm making a Pascal bridge to Cocoa and it would be convenient if

Re: Toll-free bridge type at runtime

2009-04-02 Thread Ryan Joseph
Oh, if they're connected on THAT level then there really is no way. So NSArray is a wrapper for CFArray? ;) If the Runtime Wrangler says it can't be done, it probably can't be done. Thanks for clearing this up. On Apr 3, 2009, at 9:59 AM, Greg Parker wrote: On Apr 2, 2009, at 7:38 PM, Ryan

Re: How to animate the drawing of UIImages inside a drawRect: method of a UIView?

2009-04-02 Thread WT
25 was just a test. The actual app has 2 interlocking 7x7 grids, so the number of image views is actually 98. I should explain that this animated laying out of image views happens only once and, from that point on, the image views all remain in the same place, though each image itself is

Re: Toll-free bridge type at runtime

2009-04-02 Thread Ryan Joseph
On Apr 3, 2009, at 10:11 AM, Michael Ash wrote: The wrapper is simply a Pascal object that encapsulates a Cocoa object. The underlying object is exactly the same as it appears in Cocoa, except it's accessed via Objective-C runtime functions. The fact it's a wrapper is really not

Re: core data, opening a previously saved xml file... bug/glitch/unexpected behavior

2009-04-02 Thread Jerry Krinock
On 2009 Apr 02, at 07:39, ebluga...@mac.com wrote: but when I save the file, close it and re-open it... it appears to be empty. ... my arrayControllers IGNORE THEM Select one of your array controllers in Interface Builder, in Inspector Attributes, see if the Prepares Content box is

Re: Toll-free bridge type at runtime

2009-04-02 Thread Chris Hanson
On Apr 2, 2009, at 7:38 PM, Ryan Joseph wrote: I think I need explain what exactly I need this for. I'm making a Pascal bridge to Cocoa and it would be convenient if I could pass a CF type or a Pascal wrapper indiscriminately and decide at runtime how they should handled. It's still not

Re: Toll-free bridge type at runtime

2009-04-02 Thread Ryan Joseph
It's almost stupid this generated so much talk considering how trivial it is. Below is the Pascal code explaining. // We pass dragTypes directly because it's interchangeable and using it with Objective-C runtime will not cause errors. dragTypes := CFArrayCreate(nil, nil, 0,

Linking the document edited flag to the Undo menu item state

2009-04-02 Thread Huibert Aalbers
Hi everyone, I am writing an application that offers support for Undo/Redo. Everything works fine, except for a small detail that bothers me. Since I set the document edited flag manually, using the [theWindow setDocumentEdited:YES] instruction each time the document is modified, I have

Re: Linking the document edited flag to the Undo menu item state

2009-04-02 Thread Graham Cox
On 03/04/2009, at 2:57 PM, Huibert Aalbers wrote: The solution would be to set the document edited flag based on the status of the Undo menu item state. Is there a simple way to do this? Yes: leave it alone entirely. The Undo manager will manage this flag automatically. --Graham

Re: NSDate with Format?

2009-04-02 Thread Dave DeLong
NSDateFormatter is your friend. =) You use it like this: NSDateFormatter * f = [[NSDateFormatter alloc] init]; [f setDateFormat:@-mm-dd]; NSLog([f stringFromDate:aDate]); [f release]; There's also a really handy dateFromString method that will parse a string according to the format

NSDate with Format?

2009-04-02 Thread Pierce Freeman
Hi everyone. I am looking into a way to change the format of what a NSDate instance shows to the user. I am aware there is a way to do this with NSCalendarDate, but since its documentation says that it may be deprecated in Snow Leopard - I would rather not take a chance. Also, I need some way

Re: Linking the document edited flag to the Undo menu item state

2009-04-02 Thread Huibert Aalbers
Wow, That certainly qualified as a simple solution :-) However, it didn't work. Maybe that is because my application is not document-based. Any additional suggestions? Regards, Huibert On 02/04/2009, at 09:59 p.m., Graham Cox wrote: On 03/04/2009, at 2:57 PM, Huibert Aalbers wrote:

Re: Linking the document edited flag to the Undo menu item state

2009-04-02 Thread Graham Cox
On 03/04/2009, at 3:15 PM, Huibert Aalbers wrote: Wow, That certainly qualified as a simple solution :-) However, it didn't work. Maybe that is because my application is not document-based. Any additional suggestions? Hrrm, well, you didn't actually mention that rather important

Re: isnan

2009-04-02 Thread Greg Parker
On Apr 2, 2009, at 9:19 PM, Development wrote: I'm trying to detect if an entry in a uitextfield is a number or not but isnan does not seem to work. NSString * bLong = [NSString stringWithFormat:@%@,maLong.text]; NSString * bLat = [NSString stringWithFormat:@%@,maLat.text];

isnan

2009-04-02 Thread Development
I'm trying to detect if an entry in a uitextfield is a number or not but isnan does not seem to work. NSString * bLong = [NSString stringWithFormat:@%@,maLong.text]; NSString * bLat = [NSString stringWithFormat:@%@,maLat.text]; if(isnan([bLat floatValue]) ||

Re: Bindings and MenuItems

2009-04-02 Thread Ben Lachman
No. That was what my original message outlined. Say you have a table view selected and hit cmd-p. NSView has a default implementation of print: so it will print the table view. In my case and in many others what you really want to print is the detail view or some representation of it

Re: Toll-free bridge type at runtime

2009-04-02 Thread Marcel Weiher
On Apr 2, 2009, at 17:54 , Chris Suter wrote: On Fri, Apr 3, 2009 at 11:06 AM, Marcel Weiher marcel.wei...@gmail.com wrote: As I explained, Did you? Yes. it is trivially possible, because the only Objective-C class that is the same as its underlying CFType is NSCFArray. So a simple

Re: Toll-free bridge type at runtime

2009-04-02 Thread Bill Bumgarner
On Apr 2, 2009, at 8:40 PM, Ryan Joseph wrote: // We must use the Handle which is the Objective-C object because dragTypes is a NSArray wrapper and passing a Pascal object to Objective-C runtime WILL cause errors dragTypes := NSArray.array_; view.registerForDraggedTypes(dragTypes.Handle);