Having issues using NSAttribute strings with link Attribute ..

2009-01-19 Thread Arjun SM
Hi all, i am novice in cocoa so please bear with me .. I have created an URL link in one my custom applications About box as described below NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"Cocoa Inc"]; NSRange selectedRange = NSMakeRange(0, 10); NSURL *li

Re: Having issues using NSAttribute strings with link Attribute ..

2009-01-19 Thread Ron Fleckner
On 19/01/2009, at 9:33 PM, Arjun SM wrote: Hi all, i am novice in cocoa so please bear with me .. I have created an URL link in one my custom applications About box as described below NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"Cocoa Inc"]; NSR

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread Graham Cox
On 19 Jan 2009, at 6:49 pm, Kyle Sluder wrote: Well it sounds like there are a number of issues here: 1) You're throwing exceptions in drawing code. Even if you catch them so they don't screw up the draw stack, this will be extremely slow and have adverse effects on the drawing. My understa

SIGPIPE with sockets

2009-01-19 Thread malcom
Hello guys, I'm using blackhole netsocket class in an app of mine. Today I've received a report regarding this error "broken pipe abnormal exit". I've taken a look a mailing list and it seems to be an error related to sockets (cannot write, closed before write). Anyone can tell me how to solve

Re: Check URL Status

2009-01-19 Thread Mike Abdullah
Create a NSURLConnection for the HD URL. It will receive an NSHTTPURLResponse object with -statusCode 404. Mike. On 19 Jan 2009, at 01: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

Re: SIGPIPE with sockets

2009-01-19 Thread Jeremy Pereira
On 19 Jan 2009, at 10:51, malcom wrote: Hello guys, I'm using blackhole netsocket class in an app of mine. Today I've received a report regarding this error "broken pipe abnormal exit". I've taken a look a mailing list and it seems to be an error related to sockets (cannot write, closed bef

Re: Yo

2009-01-19 Thread Scott Anguish
On 18-Jan-09, at 10:42 AM, Scott Ribe wrote: 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

Re: CALayer removeFromSupeLayer crashes

2009-01-19 Thread Dennis Christopher
Men, I was to find an over-release of the layer's delegate object using Instruments. Removing this solved the crash. Thanks for all your suggestions. Dennis Christopher On Jan 10, 2009, at 12:43 PM, David Duncan wrote: On Jan 9, 2009, at 12:19 PM, Dennis Christopher wrote: NSArray *theL

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

2009-01-19 Thread julius
On 19 Jan 2009, at 00:21, Stuart Malin wrote: 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 NSDecimalNu

Re: bindings and sub array modification notification.

2009-01-19 Thread Sandro Noel
mmalc. after looking at the example page you sent me it gave me some answers about controllers that I was getting ready to ask, so thank you! Sandro Noel. On 18-Jan-09, at 8:36 PM, mmalc Crawford wrote: On Jan 18, 2009, at 5:02 PM, Sandro Noel wrote: How could I possibly observe the chan

Re: .DMG Keeps Getting Bigger After Converting?

2009-01-19 Thread Alastair Houghton
On 17 Jan 2009, at 21:02, Markus Spoettl wrote: Totally agreed, scripting the entire process would be wonderful. But: How does one go about scripting a template DMG creation that should open in a certain view mode in Finder (e.g. icon) using a defined icon size and defined icon locations, b

Re: NSOutlineView, tracking in a custom NSTextFieldCell, & Shift&Cmd Keys

2009-01-19 Thread Eric Gorr
On Jan 16, 2009, at 5:12 PM, Corbin Dunn wrote: On Jan 16, 2009, at 11:34 AM, Eric Gorr wrote: Note that for my custom cell class I have: + (BOOL)prefersTrackingUntilMouseUp { // NSCell returns NO for this by default. // If you want to have trackMouse:inRect:ofView:untilMous

Re: SIGPIPE with sockets

2009-01-19 Thread Scott Ribe
Any decent library probably ought to set up the socket to not throw the signal, like so: err = setsockopt( mSocket, SOL_SOCKET, SO_NOSIGPIPE, &flg, sizeof flg ); So that the library can return the error EPIPE and let the application deal gracefully with the condition without having to muck around

Re: Cocoa and the need for a dynamic language

2009-01-19 Thread Sean McBride
On 1/17/09 9:51 PM, Erik Buck said: >As far as I know, there is still no compiler in >the world that completely implements the ANSI/ISO C++ standard which >was ratified in 1998. If the standard hasn't been implemented in a >decade, something is amiss. I agree C++ is an overly complex beast... bu

Re: Cocoa and the need for a dynamic language

2009-01-19 Thread Robert Claeson
On 19 Jan 2009, at 15:41, Sean McBride wrote: On 1/17/09 9:51 PM, Erik Buck said: As far as I know, there is still no compiler in the world that completely implements the ANSI/ISO C++ standard which was ratified in 1998. If the standard hasn't been implemented in a decade, something is amiss

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

2009-01-19 Thread mmalc Crawford
On Jan 19, 2009, at 6:10 AM, julius wrote: I too followed up on the example link which took me to the top of the NSDecimalNumber Class reference document. Scrolling down the first thing I came accross under Tasks was "Creating a Decimal Number" and just beneath that a link to + decimalNum

Re: .DMG Keeps Getting Bigger After Converting?

2009-01-19 Thread Chunk 1978
i'm really a big fan of DMG Canvas, and i'm surprised the developer is offering it as donationware, but unfortunately i can't use it... there seems to be a bug that will automatically set off "internet enabled" option (even if it's unchecked) when the .DMG is downloaded from my server, and there's

Re: File association

2009-01-19 Thread Sean McBride
On 1/19/09 10:19 AM, Mahaboob said: >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. That's a 'dynamic UTI', you can google it. And if you try the same for other extensions? Maybe d

Re: Memory allocation issues with NSObject and NSString

2009-01-19 Thread Michael Ash
On Mon, Jan 19, 2009 at 2:36 AM, Bill Bumgarner wrote: > 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

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread Michael Ash
On Mon, Jan 19, 2009 at 6:07 AM, Graham Cox wrote: > What does appear to help a lot is saving the current context at the top of > the drawing stack and putting it back explicitly at the end (as per my > previously posted code snippet). If the save/restores are balanced, > effectively this is a no-

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread Paul Bruneau
On Jan 19, 2009, at 2:49 AM, Kyle Sluder wrote: 3) You've over-architected your drawing code. Typically the fewer objects that are responsible for drawing (i.e. view objects) the better. Situations like the one you're describing often arise from making model objects responsible for their own d

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread Shawn Erickson
On Mon, Jan 19, 2009 at 9:57 AM, Paul Bruneau wrote: > On Jan 19, 2009, at 2:49 AM, Kyle Sluder wrote: > >> 3) You've over-architected your drawing code. Typically the fewer >> objects that are responsible for drawing (i.e. view objects) the >> better. Situations like the one you're describing o

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread I. Savant
On Jan 19, 2009, at 12:57 PM, Paul Bruneau wrote: I'm confused by it, since I have been directed in the past by people who know that The Cocoa Way is to have objects know how to draw themselves--via a category if desired. Is there differing opinion on this? (apparently there is...) This

Re: CALayer unwanted blurring

2009-01-19 Thread David Duncan
On Jan 17, 2009, at 4:30 PM, Joe Wildish wrote: Anyway, I did find a post on this list that mentions a similar problem (http://www.cocoabuilder.com/archive/message/cocoa/2008/12/13/225352 ). However, in my case I am not applying any transforms to the layer hierarchy, and I am also ensuring t

Cursor updates - bug or programmer ignorance?

2009-01-19 Thread Luke Evans
I was surprised by some cursor behaviour and whittled down the following code (the only code in an NSTableView subclass): - (void)updateTrackingAreas { NSLog(@"Tracking update"); for (NSTrackingArea *area in [self trackingAreas]) { if ([area owner] == self) {

"Cocoa Fundamentals Guide" Clarification

2009-01-19 Thread Mohan Parthasarathy
Hi, I am reading the section "Functions, Constants and Other C Types", in the Cocoa Fundamentals Guide ( http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/WhatIsCocoa/chapter_2_section_2.html) and a little confused about the wording in this section. The following list o

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread Quincey Morris
On Jan 19, 2009, at 10:16, Shawn Erickson wrote: On Mon, Jan 19, 2009 at 9:57 AM, Paul Bruneau wrote: On Jan 19, 2009, at 2:49 AM, Kyle Sluder wrote: 3) You've over-architected your drawing code. Typically the fewer objects that are responsible for drawing (i.e. view objects) the better. S

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread Paul Bruneau
On Jan 19, 2009, at 2:08 PM, Quincey Morris wrote: I don't get this at all (not just the quoted comments, but going all the way back to Graham's original statement). -- If a failure in the drawing code destroys the *data model* (thereby preventing it from being saved) then there's something

Re: Cursor updates - bug or programmer ignorance?

2009-01-19 Thread Quincey Morris
On Jan 19, 2009, at 11:00, Luke Evans wrote: The odd behaviour is that the cursor is reset back to the regular arrowCursor after a few seconds, with the cursor still over the view. At this point I don't know 'who' is doing this or why; nor how to stop it. The -updateTrackingAreas method

Re: "Cocoa Fundamentals Guide" Clarification

2009-01-19 Thread Mike Abdullah
Just write your code in Obj-C. When you have a finished application, then start profiling performance. If this shows that calling some methods is slowing things down, consider changing them to a function. However, note that you are rather unlikely to run into this. Message dispatch is prett

Re: CALayer unwanted blurring

2009-01-19 Thread Gustavo Pizano
Hello, I had similar problem when making a layer rotation over the z axis, so if I understood good, if I Have an even Width/Height of the layer, I should reposition it after the rotation on a pixel, and if I have an odd Width/Height, then in a half pixel?. Am I right, maybe I can apply this

Re: NSOutlineView, tracking in a custom NSTextFieldCell, & Shift&Cmd Keys

2009-01-19 Thread Eric Gorr
On Jan 19, 2009, at 10:40 AM, Eric Gorr wrote: The problem appears to be that my trackMouse code consumes the mouseUp event and that is preventing [super mouseDown:theEvent] from terminating. One possible solution is to add a method to my custom cell class to set a flag which tells the t

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

2009-01-19 Thread Brian Slick
On Jan 19, 2009, at 11:17 AM, mmalc Crawford wrote: On Jan 19, 2009, at 6:10 AM, julius wrote: But there is nothing here that looks anything like it would allow me to intialise with a numeric value like 23.30. It's not clear why, throughout, you have ignored: (a) initWithMantissa:expone

Re: "Cocoa Fundamentals Guide" Clarification

2009-01-19 Thread glenn andreas
On Jan 19, 2009, at 1:44 PM, Mike Abdullah wrote: Just write your code in Obj-C. When you have a finished application, then start profiling performance. If this shows that calling some methods is slowing things down, consider changing them to a function. However, note that you are rather u

Re: mergeChangesFromContextDidSaveNotification effects

2009-01-19 Thread Nathan Vander Wilt
I figured this out. Core Data sends out several separate ContextDidChange notifications in response to a single - mergeChangesFromContextDidSaveNotification call. I had a dumb bug in my code that resulted in me only seeing the first one. The object where I was debugging ContextDidChange noti

Binding of invisible controls: is lazy data loading possible?

2009-01-19 Thread Vitaly Ovchinnikov
Hello all, I have a grid, array controller and a property of document that returns array. Grid is bound to controller, controller uses property as -contentArray. All works fine, but grid asks for data even if it is not visible. The problem is that document's property performs a lot of work to comp

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

2009-01-19 Thread mmalc Crawford
On Jan 19, 2009, at 11:57 AM, Brian Slick wrote: On Jan 19, 2009, at 11:17 AM, mmalc Crawford wrote: On Jan 19, 2009, at 6:10 AM, julius wrote: But there is nothing here that looks anything like it would allow me to intialise with a numeric value like 23.30. It's not clear why, throughout, y

Re: NSPredicateEditorRowTemplate for NSDate

2009-01-19 Thread Vitaly Ovchinnikov
Hey, boys and girls? Am I the first, who use NSPredicateEditor? I just found that there is no default template for time values... Please somebody confirm that miracle is over and I need to code all this data/time stuff myself :( On Sun, Jan 18, 2009 at 7:22 PM, Vitaly Ovchinnikov wrote: > Hello

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

2009-01-19 Thread Gary L. Wade
On 01/19/2009 11:57 AM, "Brian Slick" wrote: > I'm not sure this is a documentation failure as much as a language > failure, at least in this case. Why isn't there an initWithInt: or > initWithFloat: like in some other cases? THAT would have resulted in > the documentation page leading to the c

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

2009-01-19 Thread julius
On 19 Jan 2009, at 16:17, mmalc Crawford wrote: On Jan 19, 2009, at 6:10 AM, julius wrote: I too followed up on the example link which took me to the top of the NSDecimalNumber Class reference document. Scrolling down the first thing I came accross under Tasks was "Creating a Decimal Nu

Re: NSPredicateEditorRowTemplate for NSDate

2009-01-19 Thread Jim Turner
The miracle is over. The out-of-the-box templates in IB only provide three-view templates (left expression, operator, right expression). You'll need to subclass NSPredicateEditorRowTemplate and provide the views and logic you want to use in your template. I did a presentation for the local CocoaH

Re: NSPredicateEditorRowTemplate for NSDate

2009-01-19 Thread Markus Spoettl
On Jan 19, 2009, at 9:13 PM, Vitaly Ovchinnikov wrote: Hey, boys and girls? Am I the first, who use NSPredicateEditor? I just found that there is no default template for time values... I basically use this code for a date value row template (simplified version not tested): NSArray *ope

Re: Binding of invisible controls: is lazy data loading possible?

2009-01-19 Thread Quincey Morris
On Jan 19, 2009, at 12:11, Vitaly Ovchinnikov wrote: I cache those data, but when I change something that affects them, I need to reset the cache. And to let everyone know that something changed, I call -will/didChangeValueForKey for my property. And controller immediately call this property eve

Re: NSPredicateEditorRowTemplate for NSDate

2009-01-19 Thread Peter Ammon
Hello Vitaly, The Cocoa frameworks do not yet have any classes for specifying a relative date, so you will have to handle this yourself with a subclass of NSPredicateEditorRowTemplate. You can leverage the superclass to do much of the work for you: your responsibility is limited to turni

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread Graham Cox
On 20 Jan 2009, at 5:24 am, I. Savant wrote: On Jan 19, 2009, at 12:57 PM, Paul Bruneau wrote: I'm confused by it, since I have been directed in the past by people who know that The Cocoa Way is to have objects know how to draw themselves--via a category if desired. Is there differing op

Re: CALayer unwanted blurring

2009-01-19 Thread Matt Long
How very interesting... I wanted to confirm this so I wrote a little code. Here's an image of the results. http://cimgf.com/files/BlurryLayer.png And here's the Xcode project: http://cimgf.com/files/BlurryLayer.zip Thanks for pointing that out David. -Matt On Jan 19, 2009, at 11:21 AM,

Re: CALayer unwanted blurring

2009-01-19 Thread Joe Wildish
Many thanks David, this seems to have solved my problem! Regards, -Joe On 19 Jan 2009, at 18:21, David Duncan wrote: Your suffering from the same problem as above. The frame origin is not what matters, but rather the layer's position (all aspects of the frame are synthesized from other prop

Re: Binding of invisible controls: is lazy data loading possible?

2009-01-19 Thread Ken Thomases
On Jan 19, 2009, at 3:27 PM, Quincey Morris wrote: 2. If some change affects which objects are cached, update the cache array KVO-compliantly. (Use standard NSMutableArray methods on [yourCacheOwner mutableArrayValueForKey: @"yourCacheArray"] instead of yourCacheArray.) This is common adv

Re: Memory allocation issues with NSObject and NSString

2009-01-19 Thread Ben Trumbull
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, that might

Crash trying to create Webarchive

2009-01-19 Thread Reza Farhad
Dear All I am trying to get a WebArchive from a webview: [[[webView mainFrame] dataSource] webArchive] For some pages I get the following Exception NSExceptionHandler has recorded the following exception: NSInvalidArgumentException -- *** -[NSCFArray insertObject:atIndex:]: attempt to insert

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread Quincey Morris
On Jan 19, 2009, at 14:54, Graham Cox wrote: Well, it's not really in an unsaveable state. The data model itself isn't damaged by exceptions thrown from the drawing code. However, the visual appearance of the document is badly upset (scrollbars suddenly disappear, rulers get drawn in the mi

Re: NSPredicateEditorRowTemplate for NSDate

2009-01-19 Thread Vitaly Ovchinnikov
Thanks to all for answers, now I need a few days to sleep with all these data. Thank you. On Tue, Jan 20, 2009 at 12:04 AM, Jim Turner wrote: > The miracle is over. The out-of-the-box templates in IB only provide > three-view templates (left expression, operator, right expression). > You'll need

Anybody using Fix and Continue and Objective-C++?

2009-01-19 Thread m
Is anyone able to use fix and continue with Objective-C++ source files? I can't get it to work. The error I get is: "Error fixing Controller.mm: Changing the type of global variable '_DefaultRuneLocale' from ' ' to 'struct $_10' is not supported." It works great if I change my source file

Re: ObjC in time-critical parts of the code

2009-01-19 Thread William Jon Shipley
Simple question: Is it better to pursue a 20%, or even 50%, improvement in drawing speed by rewriting in C++ or C than, say, preventing the 2, 3, 4, or more extra redraws that are happening prior to window flush? Don't laugh -- I have seen it happen. Often. I subscribed to this list jus

Trying to display a simple sheet

2009-01-19 Thread Harry Plate
This is a newbie question I am certain. I am experimenting with sheets with a simple application (1st cocoa app) and want to display a simple alert message as a sheet. 1) So my first mistake was to use NSRunAlertPanel(). Did its thing but gave me an independent window. 2) Further reading disclose

Re: real noob question

2009-01-19 Thread Richard Dammkoehler
Try this; On Jan 17, 2009, at 7: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. NSDecimalNumber *myMoney =

CoreData entity mutability

2009-01-19 Thread Antoine Maillard
Hi, I'm using CoreData in one of my projects and I designed an object model with 2 entities : A and B in which B inherits from A. How can I convert a NSManagedObject of type A into type B ? Thanks, Antoine ___ Cocoa-dev mailing list (Cocoa-dev@lists.ap

Test for typeName failing

2009-01-19 Thread Walker Argendeli
In my readFromURL:ofType:error: method, I'm testing to see if typeName is equal to a string representing zip, and then taking action based off of that. The problem is that even when I load a zip, the statement fails. I logged tpeName to the console to get what it was for zip, so I don't u

Re: Test for typeName failing

2009-01-19 Thread Stephen J. Butler
On Mon, Jan 19, 2009 at 6:01 PM, Walker Argendeli wrote: > In my readFromURL:ofType:error: method, I'm testing to see if typeName is > equal to a string representing zip, and then taking action based off of > that. The problem is that even when I load a zip, the statement fails. I > logged tpeNa

Re: ObjC in time-critical parts of the code

2009-01-19 Thread Kyle Sluder
On Sun, Jan 18, 2009 at 7:10 PM, Bill Bumgarner wrote: > Simple question: Is it better to pursue a 20%, or even 50%, improvement in > drawing speed by rewriting in C++ or C than, say, preventing the 2, 3, 4, or > more extra redraws that are happening prior to window flush? Don't laugh > -- I ha

Re: ObjC in time-critical parts of the code

2009-01-19 Thread Bill Bumgarner
On Jan 19, 2009, at 4:21 PM, Kyle Sluder wrote: On Sun, Jan 18, 2009 at 7:10 PM, Bill Bumgarner wrote: Simple question: Is it better to pursue a 20%, or even 50%, improvement in drawing speed by rewriting in C++ or C than, say, preventing the 2, 3, 4, or more extra redraws that are happenin

Re: Anybody using Fix and Continue and Objective-C++?

2009-01-19 Thread Scott Ribe
> Is anyone able to use fix and continue with Objective-C++ source > files? I can't get it to work. It only works with Objective-C. Known limitation... -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Coc

Re: Binding of invisible controls: is lazy data loading possible?

2009-01-19 Thread Quincey Morris
On Jan 19, 2009, at 15:11, Ken Thomases wrote: On Jan 19, 2009, at 3:27 PM, Quincey Morris wrote: 2. If some change affects which objects are cached, update the cache array KVO-compliantly. (Use standard NSMutableArray methods on [yourCacheOwner mutableArrayValueForKey: @"yourCacheArray"]

Re: Crash trying to create Webarchive

2009-01-19 Thread Corbin Dunn
On Jan 19, 2009, at 3:30 PM, Reza Farhad wrote: Dear All I am trying to get a WebArchive from a webview: [[[webView mainFrame] dataSource] webArchive] For some pages I get the following Exception NSExceptionHandler has recorded the following exception: NSInvalidArgumentException -- *** -[NS

Re: ObjC in time-critical parts of the code

2009-01-19 Thread Scott Ribe
> but the decision has *nothing* to do with non-virtual > member functions or other such oft-touted C++ speed improvements But actually, it does. The fact is that std::lower_bound is a template that specializes on the types of the iterators, so what you get is different code generated depending on

Re: ObjC in time-critical parts of the code

2009-01-19 Thread Scott Ribe
> You're not going to do better straight out of the gate, > certainly not re-writing them in straight-C. Of course not. I'm not sure anybody has suggested that (long thread, could've missed it if it happened). But some of us have suggested not being automatically averse to C++/STL. Those container

Re: Trying to display a simple sheet

2009-01-19 Thread Scott Ribe
NSApp beginSheet is the correct method, without any runModalForWindow. The modalForWindow argument is *not* the sheet window, it is the window on which to display the sheet. And of course you don't create an empty sheet to display it... I'm guessing that [sourceTableView window] is the window you

Coredate: change source Entity in IB

2009-01-19 Thread Alejandro Rodriguez
Hello, I have a source list populated with some data. Those entities children are shown on a separate table where one of the columns is the name of the source. I would like that column to use an NSComboCell with the available sources so when the user pricks one from the list then his sour

Re: "Cocoa Fundamentals Guide" Clarification

2009-01-19 Thread Scott Ribe
> Just write your code in Obj-C. When you have a finished application, > then start profiling performance. Exactly, I'd have to disagree with the advice quoted by OP. The real reason to use plain functions is to keep them out of the class's API/contract and/or global namespace if they don't need t

Re: Binding of invisible controls: is lazy data loading possible?

2009-01-19 Thread Quincey Morris
On Jan 19, 2009, at 15:11, Ken Thomases wrote: [1] The indexed to-many accessors for array properties are described here: http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/AccessorConventions.html#/ /apple_ref/doc/uid/20002174-178830-BAJEDEFB Incidentally ..

Re: Binding of invisible controls: is lazy data loading possible?

2009-01-19 Thread mmalc Crawford
On Jan 19, 2009, at 5:25 PM, Quincey Morris wrote: If anyone can find a place in any documentation or header files that *says* the indexed to-many accessors (such as insertObject:inAtIndex: and removeObjectFromAtIndex:) are KVO-compliant when used directly, you'd be doing a public service

Re: CoreData entity mutability

2009-01-19 Thread Kyle Sluder
On Mon, Jan 19, 2009 at 8:39 AM, Antoine Maillard wrote: > How can I convert a NSManagedObject of type A into type B ? How often do you do this in regular code? Is it common for a method to change the identity of the receiver before returning? Hopefully the answer is no (KVO trickery aside ;) )

Re: Using the security framework

2009-01-19 Thread Joe Turner
On Jan 6, 2009, at 10:45 AM, Nick Zitzmann wrote: On Jan 3, 2009, at 6:50 PM, Joe Turner wrote: I am making a hard drive cloner/backuper, and to do some deleting and copying, I need to use the security framework. What I need to be able to do is have the user type in their password one time

Re: Using the security framework

2009-01-19 Thread Rob Keniger
On 20/01/2009, at 12:56 PM, Joe Turner wrote: That makes sense, but then how does an app like SuperDuper! do it. You click the lock, enter your password, and then you don't need to enter your password again until you lock it again. And, it is the regular security framework password window,

NSView behaves different on 10.4 vs 10.5?

2009-01-19 Thread Adam Gerson
I am trying to help someone solve a problem with their code. I did not write the code myself. As far as I can tell they have a custom NSView subclass that has some subviews. The view represents a hand of playing cards. The subviews themselves are custom NSButton subclasses that represent individual

Re: NSView behaves different on 10.4 vs 10.5?

2009-01-19 Thread Jim Correia
On Jan 19, 2009, at 10:36 PM, Adam Gerson wrote: The cards in the hand are drawn overlapping. [...] Could anyone shed some slight on what could be occurring? Overlapping sibling views are supported on 10.5 and later. If you need to support 10.4, you'll have to use a different strategy f

NsCollectionView Selection

2009-01-19 Thread Sandro Noel
Greetings. I'm using NSCollectionView in my application. I've defined the represented object's layout in interface builder. and now everything displays nicely on screen with a couple of exceptions. When I select an element, there is no selection indicator to show the selected item. ( blue col

Re: NSView behaves different on 10.4 vs 10.5?

2009-01-19 Thread Graham Cox
On 20 Jan 2009, at 2:36 pm, Adam Gerson wrote: The cards in the hand are drawn overlapping. Could anyone shed some slight on what could be occurring? 10.4 doesn't support overlapping views. Using a separate view for each card is a bad idea anyway. Instead, just use a custom object and ge

Re: NsCollectionView Selection

2009-01-19 Thread Graham Cox
On 20 Jan 2009, at 2:42 pm, Sandro Noel wrote: When I select an element, there is no selection indicator to show the selected item. True, you have to arrange this. I've also looked at the example provided by apple, but they use and NSBox as the represented object view and the transparent

Re: NsCollectionView Selection

2009-01-19 Thread Sandro Noel
Thank you Graham, But I'm not looking for the lazy approach, I really want the app to be good looking, I like Mac apps because they are fancy, I want my app to be fancy too :) Besides I'm learning, so I might as well learn to do it the right way :) that's why i ask :)) So i hear that if i wa

Re: NsCollectionView Selection

2009-01-19 Thread Graham Cox
On 20 Jan 2009, at 3:10 pm, Sandro Noel wrote: But I'm not looking for the lazy approach, I really want the app to be good looking, I like Mac apps because they are fancy, I want my app to be fancy too :) Besides I'm learning, so I might as well learn to do it the right way :) that's why

Re: NSView behaves different on 10.4 vs 10.5?

2009-01-19 Thread Adam Gerson
"For performance reasons, Cocoa does not enforce clipping among sibling views or guarantee correct invalidation and drawing behavior when sibling views overlap." http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaViewsGuide/WorkingWithAViewHierarchy/chapter_5_section_5.html On Mon, Ja

Re: NSView behaves different on 10.4 vs 10.5?

2009-01-19 Thread Kyle Sluder
On Mon, Jan 19, 2009 at 10:45 PM, Graham Cox wrote: > Using a separate view for each card is a bad idea anyway. Instead, just use > a custom object and get the main view to draw each one. I'd recommend abstracting out the card-drawing code into a subclass of NSButtonCell and using that cell to dr

NSData release seg fault. Whoops.

2009-01-19 Thread nik heger
I figured out how to make this code "work" but I still don't know what the problem was. Can someone enlighten me? - (void)testSegFault { int size = 8; uint8_t *bytes = malloc( size * sizeof(uint8_t) ); NSData *data = [NSData dataWithBytesNoCopy:by

Re: real noob question

2009-01-19 Thread Kyle Sluder
On Sat, Jan 17, 2009 at 11:41 PM, Richard Dammkoehler wrote: > NSDecimalNumber *num = [[NSDecimalNumber alloc] initWithString:"23.30"]; 1) That's not an ObjC string, it's a C string. That will crash unless you replace it with @"23.30". 2) If the current locale isn't one that uses a period as the

Re: NSData release seg fault. Whoops.

2009-01-19 Thread Kyle Sluder
On Mon, Jan 19, 2009 at 11:39 PM, nik heger wrote: > I figured out how to make this code "work" but I still don't know what the > problem was. Can someone enlighten me? +dataWithBytesNoCopy:length: is not +alloc. Therefore you don't own it. If you turn around and release it, you are violating t

Custom Cocoa Component/Control

2009-01-19 Thread Paul Franz
I know this is a noob question but I do not know where to look. I come for a Java background. So I know what to do there, but I look at Cocoa and I have no clue where to start since the object model is quite a bit different. Should I create a sub-class of NSControl or do something else? I want

Problem setting up custom toolbar item in IB

2009-01-19 Thread Graham Cox
I'm having trouble setting up a custom toolbar item. It looks like it should work and appears in IB OK but doesn't come up correctly at runtime. I must be doing something wrong: The toolbar item consists of a pair of NSTextFields and some labels. They must be grouped together as a single t

Search Fields, Array Controllers and Multiple NIBs

2009-01-19 Thread Brad Gibbs
I'm having a fundamental disagreement with Cocoa and I'm really hoping someone can help me see it her way... I have a Core Data app with a container view controller and multiple subviews, each with a view controller and a separate NIB. Subview switching is done via a segmented control. Th

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

2009-01-19 Thread Michael Ash
On Mon, Jan 19, 2009 at 2:57 PM, Brian Slick wrote: > I'm not sure this is a documentation failure as much as a language failure, > at least in this case. Why isn't there an initWithInt: or initWithFloat: > like in some other cases? THAT would have resulted in the documentation > page leading to

Re: Memory allocation issues with NSObject and NSString

2009-01-19 Thread Michael Ash
On Mon, Jan 19, 2009 at 6:14 PM, Ben Trumbull wrote: >> 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 of the API contract.

Re: Binding of invisible controls: is lazy data loading possible?

2009-01-19 Thread Quincey Morris
On Jan 19, 2009, at 17:33, mmalc Crawford wrote: On Jan 19, 2009, at 5:25 PM, Quincey Morris wrote: If anyone can find a place in any documentation or header files that *says* the indexed to-many accessors (such as insertObject:inAtIndex: and removeObjectFromAtIndex:) are KVO-compliant wh

Re: ObjC in time-critical parts of the code

2009-01-19 Thread Michael Ash
On Mon, Jan 19, 2009 at 2:49 AM, Ben Trumbull wrote: >> Well no, it doesn't. ObjC has functions, by virtue of being a superset >> of C, but it does not have "member functions". You can write functions >> that are logically associated with a class, but this is a human >> construct, not one that the

Re: NsCollectionView Selection

2009-01-19 Thread Sandro Noel
Graham. I did not mean Lazy in an offensive way :) I meant it as I want to learn the real stuff and understand how it works. The documentation is hefty and sometimes confusing, so I ask for advice :) I do want a gradient semi-transparent look, it find it sleek. besides once it's designed, I

Re: NsCollectionView Selection

2009-01-19 Thread Sandro Noel
Graham. NSbox will not let me set the background color if the Box Type is not custom, If I do that I lose the rounded borders. :( and i can't set the border colors either if the box type is not custom. do you have a suggestion? Sandro Noel. On 19-Jan-09, at 11:24 PM, Graham Cox wrote: On

draw two strokes(lines) simultaneousy on NSView

2009-01-19 Thread Gami Ravi
Hi All, I want to create an application that will draws two strokes simultaneously on NSView. How can i draw two strokes simultaneously ? Any help would be appreciated. Thanks & Regards, Ravi Gami. -- _ Disclaimer: This e-mail

Re: NsCollectionView Selection

2009-01-19 Thread Graham Cox
On 20 Jan 2009, at 4:59 pm, Sandro Noel wrote: NSbox will not let me set the background color if the Box Type is not custom, If I do that I lose the rounded borders. :( and i can't set the border colors either if the box type is not custom. That's not the case - you ONLY get rounded corn

Re: draw two strokes(lines) simultaneousy on NSView

2009-01-19 Thread Graham Cox
On 20 Jan 2009, at 5:12 pm, Gami Ravi wrote: I want to create an application that will draws two strokes simultaneously on NSView. How can i draw two strokes simultaneously ? Any help would be appreciated. You don't say what you want to stroke, but let's assume a NSBezierPath. // ...set up

Re: Problem setting up custom toolbar item in IB

2009-01-19 Thread Joey Hagedorn
Graham, Hm, maybe this is an issue with the custom view in your nib. Perhaps try putting your text fields inside, say, a borderless NSBox instead? -Joey On Jan 19, 2009, at 8:55 PM, Graham Cox wrote: I'm having trouble setting up a custom toolbar item. It looks like it should work and

Re: Problem setting up custom toolbar item in IB

2009-01-19 Thread Graham Cox
On 20 Jan 2009, at 3:55 pm, Graham Cox wrote: When my controller tries to set one of the field's values I get either a EXC_BAD_ACCESS, or an exception that NSData doesn't implement -setFloatValue:, but at awakeFromNib time I can see the text field outlets are set and are indeed NSTextField

  1   2   >