Re: Create App both for Tiger and Leopard

2009-01-18 Thread Rob Keniger
On 18/01/2009, at 5:50 PM, Vitaly Ovchinnikov wrote: When I try to compile the code against 10.4 SDK - I receive a lot of errors because there is no NSPredicateEditor on Tiger. I switched target platform version to 10.5 and now it compiles and links without a problem. I also set Deployment Targ

Re: Create App both for Tiger and Leopard

2009-01-18 Thread Vitaly Ovchinnikov
There are many common words, but no answer on my question. The question is simple: can I include some Leopard-only code that will never be executed on Tiger? Will Tiger run such app or, like Windows, it will try to load all referred classes first? On Sun, Jan 18, 2009 at 11:12 AM, Rob Keniger wro

Re: Create App both for Tiger and Leopard

2009-01-18 Thread Vitaly Ovchinnikov
Well, after reading your link one more time, I found this: http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/Using/chapter_3_section_4.html#//apple_ref/doc/uid/20002000-1114537 So, I am right for Tiger and Leo, that OSX uses lazy loading and if I never call NSPre

Re: Cocoa and the need for a dynamic language

2009-01-18 Thread Ian Joyner
On 18/01/2009, at 1:51 PM, Erik Buck wrote: Both Objective-C message sending and C++ virtual function calls commonly prevent in-lining because the _compiler_ can not determine which code will actually be called. If you use Objective-C message sending or C++ virtual member functions, you f

Re: Create App both for Tiger and Leopard

2009-01-18 Thread Ken Thomases
On Jan 18, 2009, at 4:15 AM, Vitaly Ovchinnikov wrote: Well, after reading your link one more time, I found this: http://developer.apple.com/documentation/DeveloperTools/Conceptual/cross_development/Using/chapter_3_section_4.html#/ /apple_ref/doc/uid/20002000-1114537 So, I am right for Tiger

Re: real noob question

2009-01-18 Thread I. Savant
On Jan 17, 2009, at 8:18 PM, Darren Stuart wrote: Hi there, sorry for the real noobish question but I can't figure this out or find an answer. I have a variable called myMoney and its a NSDecimalNumber and I want to set init it with the value of 23.30. ... If this is the wrong place to p

this class is not key value coding-compliant ...

2009-01-18 Thread Ken Tozier
Hi I'm getting the runtime error "this class is not key value coding- compliant for the key rootArray." for my app controller class, despite the fact that the controller absolutely, positively does have a "rootArray" accessor and that accessor is defined in both the interface and implement

Re: this class is not key value coding-compliant ...

2009-01-18 Thread Mike Abdullah
I would guess that your binding is to the the model ket "rootArray" and the controller key "selection" (or similar). The result is a combined keypath of "selection.rootArray", not "rootArray" as you expect. In IB, you should be able to just delete the controller key and solve the problem.

Re: this class is not key value coding-compliant ...

2009-01-18 Thread glenn andreas
On Jan 18, 2009, at 9:02 AM, Ken Tozier wrote: Hi I'm getting the runtime error "this class is not key value coding- compliant for the key rootArray." for my app controller class [snip] Here are the bindings: The content of an NSArrayController inside the "PMXAdmin.nib" is bound to Ap

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Scott Ribe
Good grief, no. I'm not just talking about accessors. Try re-reading: > In addition, in many cases where Objective-C would have one or more method > dispatches in innermost performance-critical regions, with C++/STL you will > have NO FUNCTION CALL AT ALL, but rather direct pointer-based data acce

Re: Yo

2009-01-18 Thread Scott Ribe
> Hmm, seems like I might have hit the nail on the head, I just received > a delightfully abusive email from this character offlist. I've > notified the admins. Since the mods seem to be missing for the weekend (imagine that!) let me just point out that they unsubscribed this guy a week or so ago

Re: real noob question

2009-01-18 Thread Scott Ribe
> You wanted to work with NSDecimalNumber, so you should definitely > have searched the documentation for that term. Better yet, right- (or control-) click it in your code and choose "Find Selected Text in API Reference". -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303

Re: Cocoa and the need for a dynamic language

2009-01-18 Thread Scott Ribe
> Therefore, I take issue with Scott Ribe because I don't think Cocoa > can be implemented as we know it in C++. Eh? That was my point: ...just as you can't "rewrite Cocoa in C++"... -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___

Re: this class is not key value coding-compliant ...

2009-01-18 Thread Ken Tozier
On Jan 18, 2009, at 10:24 AM, glenn andreas wrote: You're binding to the Application (i.e., NSApp) and not your app controller instance? Yep. That was the problem. Thanks ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not pos

Re: Create App both for Tiger and Leopard

2009-01-18 Thread Vitaly Ovchinnikov
Yes, that's what I do. I call NSClassFromString(@"NSPredicateEditor") and create one of two classes depending of call's result. Each class loads its own NIB and this should guarantee me that I never call unsupported code. Thanks for the explanation. On Sun, Jan 18, 2009 at 3:23 PM, Ken Thomases

NSPredicateEditorRowTemplate for NSDate

2009-01-18 Thread Vitaly Ovchinnikov
Hello list, When I add a row template that edits date to predicate editor, it allows to perform simple comparisons. Like less or greater or equal etc. Smart folders in Finder allow to add clauses like "Date is within last X weeks". I can't find a simple way to do the same. It seems that the only w

Re: After Hillegass

2009-01-18 Thread Chunk 1978
"Programming In Objective-C 2.0" was just published this year (2009)... i just got my copy from Amazon... lots of stuff in this book... certainly can't hurt: http://www.amazon.ca/gp/reader/0321566157/ref=sib_dp_pt#reader-link On Sun, Jan 18, 2009 at 2:14 AM, Quincey Morris wrote: > On Jan 17, 200

Load a nib file from a unit tests

2009-01-18 Thread Guillaume Cerquant
Hi, Tired of messing up with the bindings of my UI objects when tweaking the interface, I decided to unit test them. I'm trying to load a NIB file from a unit testing target file, so I can check the bindings configuration of a few items. So far I have the method below, in a subclass of Se

Localized Title Of Applications Folder As Alias?

2009-01-18 Thread Chunk 1978
i have a .DMG with an alias to Applications as well as the .DMG's own Documents folder. In order to have the .DMG's Documents folder title localize, i've simply copied the .localized file from the computer's Documents folder... this works... however, the title of the Applications folder (which is

Re: Localized Title Of Applications Folder As Alias?

2009-01-18 Thread Andrew Farmer
On 18 Jan 09, at 08:46, Chunk 1978 wrote: i have a .DMG with an alias to Applications as well as the .DMG's own Documents folder. In order to have the .DMG's Documents folder title localize, i've simply copied the .localized file from the computer's Documents folder... this works... however, the

Properties and memory management with overrides.

2009-01-18 Thread Sandro Noel
Greetings. This is probably a stupid question. if i have a property declared as @property (readwrite, copy) NSString *name; if I override the -(void) setName(NSString*)value{} The object that I get as value is it already a copy? Will the object still copy if I just instanceVariable = value;

Re: Properties and memory management with overrides.

2009-01-18 Thread Mike Abdullah
You're overriding the method, so it is up to you to implement the copying behaviour. On 18 Jan 2009, at 21:19, Sandro Noel wrote: Greetings. This is probably a stupid question. if i have a property declared as @property (readwrite, copy) NSString *name; if I override the -(void) setName(NS

bindings and sub array modification notification.

2009-01-18 Thread Sandro Noel
Greetings. I'm having a problem getting my collection view to update when i insert and element in my model. My model is like this. Host (custom class). NSString *hostName NSArray *informationElements. In interface builder I have the host collection view bound to an array c

[NOOB] Finding Information (was: real noob question)

2009-01-18 Thread Stuart Malin
On Jan 18, 2009, at 1:06 AM, Rob Keniger wrote: On 18/01/2009, at 11:18 AM, Darren Stuart wrote: Hi there, sorry for the real noobish question but I can't figure this out or find an answer. I have a variable called myMoney and its a NSDecimalNumber and I want to set init it with the value of

Re: Properties and memory management with overrides.

2009-01-18 Thread Quincey Morris
On Jan 18, 2009, at 13:52, Mike Abdullah wrote: You're overriding the method, so it is up to you to implement the copying behaviour. On 18 Jan 2009, at 21:19, Sandro Noel wrote: Greetings. This is probably a stupid question. if i have a property declared as @property (readwrite, copy) NSS

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
Michael Ash wrote: > > I would (personally) rather avoid caching selectors and debugging/ maintaining a > > program that used that behaviour when a well tested alternatives are built > > into another language's model. > > I agree that it's ugly, but it's good to have the option. Agreed. > M

Re: bindings and sub array modification notification.

2009-01-18 Thread Quincey Morris
On Jan 18, 2009, at 14:13, Sandro Noel wrote: My model is like this. Host (custom class). NSString *hostName NSArray *informationElements. In interface builder I have the host collection view bound to an array controller (arangedObjects.) who itself is bound to the :hosts: a

Re: CALayer unwanted blurring

2009-01-18 Thread Matt Long
Joe, Can you post some code? We can't really know what might be the cause without it. Thanks. -Matt On Jan 17, 2009, at 5:30 PM, Joe Wildish wrote: I am sub-classing CALayer and experiencing some strange behaviour. Sometimes the content of one of my sub-classes is blurred. I can't fig

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
John Engelhart wrote: > On Sat, Jan 17, 2009 at 7:44 PM, Scott Ribe wrote: > >> TBH (and more to the point) I strongly suspect it's true of everyone > >> who's expressed an opinion in this thread that it's not so much about > >> the suitability of the language to optimizations, but more abou

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Jean-Daniel Dupas
Le 19 janv. 09 à 00:56, Justin Carlson a écrit : John Engelhart wrote: > On Sat, Jan 17, 2009 at 7:44 PM, Scott Ribe wrote: > >> TBH (and more to the point) I strongly suspect it's true of everyone > >> who's expressed an opinion in this thread that it's not so much about > >> the suitabi

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Bill Bumgarner
I've been watching this discussion w/great interest. Thanks. A lot of the discussion seems to be focused on micro-optimizations and little focused on systemic optimizations. One point that I have yet to see mentioned is the overall performance enhancements to be had by focusing on embracin

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Michael Ash
On Sun, Jan 18, 2009 at 7:10 PM, Bill Bumgarner wrote: > I've been watching this discussion w/great interest. Thanks. > > A lot of the discussion seems to be focused on micro-optimizations and > little focused on systemic optimizations. > > One point that I have yet to see mentioned is the overal

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
Quincey Morris wrote: > TBH (and more to the point) I strongly suspect it's true of everyone who's > expressed an opinion in this thread that it's not so much about the > suitability of the language to optimizations, but more about the skill > set of the individual with regard to the langu

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Dave DeLong
All this reminds me a quote I found in an old PC Week: "Objective-C is the result of adding object facilities to C with the goal of making programmers more productive. The result differs greatly from C++, which adds objects to C without making computers less efficient: quite a different goal."

Re: Properties and memory management with overrides.

2009-01-18 Thread Ben Trumbull
And (I assume, for the same reason) that since the property is by default atomic, the override is also responsible for implementing any actual atomic behavior. That's true. Custom accessor methods should respect the property attributes or the property attributes should reflect the behavior of

Re: ObjC in time-critical parts of the code

2009-01-18 Thread mmalc Crawford
On Jan 18, 2009, at 4:10 PM, Bill Bumgarner wrote: One point that I have yet to see mentioned is the overall performance enhancements to be had by focusing on embracing the high level services of the system. And by overall performance enhancement, I specifically mean that it lets you ship

Re: bindings and sub array modification notification.

2009-01-18 Thread Sandro Noel
Quincey, thank you for replying. Are you saying that the "information collection view" is a NSCollectionView which displays a subview for each information element in the currently selected host? information collection view displays a sub-view for every element of the information array i

Re: bindings and sub array modification notification.

2009-01-18 Thread mmalc Crawford
On Jan 18, 2009, at 2:13 PM, Sandro Noel wrote: I'm having a problem getting my collection view to update when i insert and element in my model. mmalc

Re: bindings and sub array modification notification.

2009-01-18 Thread Sandro Noel
Qiuncey, Solution 1 works like a charm thank you so much !!! that raises another question. How could I possibly observe the changes in the information array or each host element? or if no possible, the currently selected host... I currently have an observer on the hosts array, and that

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
Jean-Daniel Dupas wrote: > > An additional problem is that it does not scale well. Programs mature, > > objects are used beyond their initial intent, programmers come and go > > and that source becomes a nightmare to maintain. Getting back to good > > OO style, why take the messaging overh

Re: ObjC in time-critical parts of the code

2009-01-18 Thread mmalc Crawford
On Jan 18, 2009, at 5:13 PM, Justin Carlson wrote: I would generally write: - (void)setMovie:(MyMovie *)newMovie { // make sure it is ok here In general your accessors should not perform validation; instead you should implement the appropriate KVV-conformant method.

Check URL Status

2009-01-18 Thread Mr. Gecko
Hello, I'm trying to find out how I can check a URL status in cocoa. I have two links to videos on a server one HD and one SD. sometime the HD isn't there and I need my program to check for 404 and if it has a 404 it'll revert to SD. Thanks for tips and or help, Mr. Gecko __

Re: bindings and sub array modification notification.

2009-01-18 Thread mmalc Crawford
On Jan 18, 2009, at 5:02 PM, Sandro Noel wrote: How could I possibly observe the changes in the information array or each host element? mmalc ___ Cocoa-dev mailing list (Cocoa-dev@l

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Greg Titus
On Jan 18, 2009, at 5:13 PM, Justin Carlson wrote: Jean-Daniel Dupas wrote: > > Each time you use KVC/KVO. Hi Jean-Daniel, Sorry if I misreading this, your response was short - it could mean a few things. I am inclined to think you were responding to my question "how often do your subcla

Re: Check URL Status

2009-01-18 Thread Andrew Farmer
On 18 Jan 09, at 17:20, Mr. Gecko wrote: Hello, I'm trying to find out how I can check a URL status in cocoa. I have two links to videos on a server one HD and one SD. sometime the HD isn't there and I need my program to check for 404 and if it has a 404 it'll revert to SD. What Have You T

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
>I've been watching this discussion w/great interest. Thanks. > > A lot of the discussion seems to be focused on micro-optimizations and little focused on systemic optimizations. > > One point that I have yet to see mentioned is the overall performance enhancements to be had by focusi

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Ben Trumbull
wine, wine, wine. My inline asm blocks look the same regardless of which language I use. Seriously, though, peek at /usr/include/objc/runtime.h and Behold that ObjC is ... uhm, well, C with a custom front end and some nice structs a library maintains for me. Okay, really very nice librar

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Bill Bumgarner
On Jan 18, 2009, at 6:05 PM, Justin Carlson wrote: I have also seen (unspecified) system libraries worsen considerably over time - 'faster over the course of OS releases' is not as sunny as I once believed. Believing system libraries will get faster is dangerous. You have filed bugs again

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
On Jan 18, 2009, at 7:20 PM, mmalc Crawford wrote: On Jan 18, 2009, at 5:13 PM, Justin Carlson wrote: I would generally write: - (void)setMovie:(MyMovie *)newMovie { // make sure it is ok here In general your accessors should not perform validation; instead you should implement the

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
On Jan 18, 2009, at 7:36 PM, Greg Titus wrote: On Jan 18, 2009, at 5:13 PM, Justin Carlson wrote: Jean-Daniel Dupas wrote: > > Each time you use KVC/KVO. Hi Jean-Daniel, Sorry if I misreading this, your response was short - it could mean a few things. I am inclined to think you were resp

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
On Jan 18, 2009, at 8:23 PM, Bill Bumgarner wrote: On Jan 18, 2009, at 6:05 PM, Justin Carlson wrote: I have also seen (unspecified) system libraries worsen considerably over time - 'faster over the course of OS releases' is not as sunny as I once believed. Believing system libraries will

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Chris Williams
In 25 years in the computer business, I've seen precisely one example of someone successfully re-coding around performance issues with the language or library. And that was only because they coded a tiny snippet of assembler that managed to fit into the pre-fetch cache of an 80286. Every other ti

Memory allocation issues with NSObject and NSString

2009-01-18 Thread Devraj Mukherjee
Hi all, Two quick questions 1. If I have an NSString and I simply assign it = @"" does that initialize it or do I have do go NSString *someString = [[NSString alloc] init]; 2. If I have an NSObject class and I define an init messge, do I have to do self = [super init] or is that not important wh

Re: Memory allocation issues with NSObject and NSString

2009-01-18 Thread Bill Bumgarner
On Jan 18, 2009, at 8:09 PM, Devraj Mukherjee wrote: 1. If I have an NSString and I simply assign it = @"" does that initialize it or do I have do go NSString *someString = [[NSString alloc] init]; foo = @""; // foo is a reference to the empty string foo = [[NSString alloc] init]; // foo is a r

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
Ben Trumbull, Thank you for sharing your experiences on the subject in extent! Regards, Justin ___ 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 c

Re: bindings and sub array modification notification.

2009-01-18 Thread Quincey Morris
On Jan 18, 2009, at 17:02, Sandro Noel wrote: How could I possibly observe the changes in the information array or each host element? or if no possible, the currently selected host... I currently have an observer on the hosts array, and that works when the array is changed(added/deleted), b

Re: File association

2009-01-18 Thread Mahaboob
Hi, Sorry for the late reply. When I'm trying like that I got the result as kMDItemContentType = "dyn.ah62d4rv4ge81a6xu" I didn't understand anything from this. On 1/16/09 8:32 PM, "Sean McBride" wrote: > On 1/16/09 6:01 PM, Mahaboob said: > >> I noticed that the problem is only with the "p

Re: Memory allocation issues with NSObject and NSString

2009-01-18 Thread Chris Suter
Hi Bill, On Mon, Jan 19, 2009 at 3:21 PM, Bill Bumgarner wrote: > foo = @""; // foo is a reference to the empty string > foo = [[NSString alloc] init]; // foo is a reference to the empty string > > The second is retained. The first is not. The first is a constant string > and, thus, -retain/-r

Re: bindings and sub array modification notification.

2009-01-18 Thread Sandro Noel
Quincey, Thank you for taking the time to explain. It is very appreciated. With this explanation in mind my approach to save my files when the array changes is not a good way to go. I'll change the code. Thank you very much. :) Who owns what/who is a little confusing for me at this stage in

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Michael Ash
On Sun, Jan 18, 2009 at 9:23 PM, Ben Trumbull wrote: > Several work arounds exist. The easiest is to create a static C member > function (yes, ObjC has member *functions* which most people overlook). Well no, it doesn't. ObjC has functions, by virtue of being a superset of C, but it does not hav

Re: Memory allocation issues with NSObject and NSString

2009-01-18 Thread Bill Bumgarner
On Jan 18, 2009, at 8:52 PM, Chris Suter wrote: Are you sure about that? My understanding is that the second case ends up pointing to a constant string and that retain and release are also no-ops in that case. Yah... but that is even more of an implementation detail than the first and *not* -

Re: Memory allocation issues with NSObject and NSString

2009-01-18 Thread Michael Ash
On Sun, Jan 18, 2009 at 11:21 PM, Bill Bumgarner wrote: >> 2. If I have an NSObject class and I define an init messge, do I have >> to do self = [super init] or is that not important when extending from >> NSObject. > > Yes, it is important. > > But it does next to nothing. > > For now. Someday,

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Justin Carlson
From: Chris Williams > In 25 years in the computer business, I've seen precisely one example of > someone successfully re-coding around performance issues with the language > or library. And that was only because they coded a tiny snippet of > assembler that managed to fit into the pre-fe

Re: [NOOB] Finding Information

2009-01-18 Thread Jacob Rhoden
On 19/01/2009 9:47 AM, Stuart Malin wrote: You can't find an answer - have you had a look at the documentation? It's right there. http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDecimalNumber_Class/Reference/Reference.html Sometimes to the newbie it may seem ast

Re: Dealing with exceptions in a drawing stack

2009-01-18 Thread Graham Cox
On 16 Jan 2009, at 8:33 pm, kyle.slu...@gmail.com wrote: What are you doing that could throw an exception? After all, exceptions are used to indicate programmer error, and are expensive to throw. Something tells me that you shouldn't be worrying about exceptions in your drawing code to begin

Re: Memory allocation issues with NSObject and NSString

2009-01-18 Thread Bill Bumgarner
On Jan 18, 2009, at 9:05 PM, Michael Ash wrote: For now. Someday, that might change. I sure hope not! The documentation for the method states: "The init method defined in the NSObject class does no initialization; it simply returns self." Making it do anything else would be a serious breach

Re: Migration with abstract entities

2009-01-18 Thread Samuel Strupp
Ok, i think i do the migration manually. Thanks for the reply. It seems that the automatic mapping for core data models is not as good as it could be, especially for complex data models. Sam Am 17.01.2009 um 08:13 schrieb Quincey Morris: On Jan 16, 2009, at 21:00, Sean McBride wrote: Quin

Re: ObjC in time-critical parts of the code

2009-01-18 Thread Ben Trumbull
On Sun, Jan 18, 2009 at 9:23 PM, Ben Trumbull wrote: Several work arounds exist. The easiest is to create a static C member function (yes, ObjC has member *functions* which most people overlook). Well no, it doesn't. ObjC has functions, by virtue of being a superset of C, but it does not

Re: Dealing with exceptions in a drawing stack

2009-01-18 Thread Kyle Sluder
On Mon, Jan 19, 2009 at 2:32 AM, Graham Cox wrote: > Naturally I would prefer that no exceptions can ever be thrown in this code. > But the reality of development is, that yes, sometimes they do. Very often > this is from an NSAssert message which are liberally used throughout most of > the code.