What is the life of the c string returned by NSString's UTF8String method?

2009-09-18 Thread Stuart Malin
I am under the impression that the reference returned by NSString's UTF8String method is valid for the life of the NSString instance which provided the reference (and further, that the memory of the referenced C string is freed when the NSString is released). Is this correct? I have a class

Re: What is the life of the c string returned by NSString's UTF8String method?

2009-09-18 Thread Stuart Malin
On Sep 18, 2009, at 2:20 PM, Sean McBride wrote: On 9/18/09 2:04 PM, Stuart Malin said: I have a class with some (statically allocated) class variables. In the class's -initialize method, I create a retained NSString. I set one of the class variables to the value returned by -UTF8Strin

[JOB] iPhone development gig in Tampa, FL.

2009-09-23 Thread Stuart Malin
Hi John, I've got some decent Objective-C/Cocoa experience. Have only dabbled with Cocoa Touch, but can come up to speed. I'd only be interested in contract work, as I have a big project of my own, but some paying work to keep that going would be good for me. I am living down in southeas

Re: how do i make SecKeyRef object from NSData of publicKey value

2009-09-28 Thread Stuart Malin
On Sep 28, 2009, at 1:05 AM, bosco fdo wrote: Date: Mon, 28 Sep 2009 11:57:29 +0800 From: bosco fdo Subject: how do i make SecKeyRef object from NSData of publicKey value To: cocoa-dev@lists.apple.com Message-ID: <630900f20909272057o5d14eaf7ue104e9f71c8b1...@mail.gmail.com> Content-Typ

Re: NSTableView: no display until header clicked

2009-10-05 Thread Stuart Malin
On Oct 5, 2009, at 1:13 PM, David Hirsch wrote: Thanks, Volker. rearrangeObjects did work, but I don't understand why that call should be necessary. If anybody out there wants to educate me, I'd appreciate it. (More info: I have my ArrayController in IB bound to an array (phases) of File's

Help with NSURLConnection memory fault

2009-10-14 Thread Stuart Malin
I create (in an object) an NSURLConnection and start it asynchronously: mNSURLConnection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self]; [mNSURLConnection start]; I release the NSURLConnection instance after it calls back in -connectionDidFinishLoading:

[SOLVED] Re: Help with NSURLConnection memory fault

2009-10-14 Thread Stuart Malin
On Oct 14, 2009, at 7:24 PM, Jens Alfke wrote: It looks as though your object (the delegate) got dealloced too early, before the NSURLConnection finished loading. This shouldn't be possible, since the connection object retains the delegate, but you may have too many release calls to it som

NSURLConnection timeout -- what happens?

2009-10-15 Thread Stuart Malin
I have looked through the NSURLConnection class reference, the NSURLRequest class reference, the URL Loading System guide, queried Google, searched mailing list archives, and even looked through NSURLConnection.h, but can not find documentation about what happens when an NSURLConnection tim

Re: NSURLConnection timeout -- what happens?

2009-10-16 Thread Stuart Malin
On Oct 15, 2009, at 3:59 PM, Jens Alfke wrote: On Oct 15, 2009, at 11:44 AM, Stuart Malin wrote: I have looked through the NSURLConnection class reference, the NSURLRequest class reference, the URL Loading System guide, queried Google, searched mailing list archives, and even looked

Re: Curious about SSH --> actually about: Keychain

2009-10-18 Thread Stuart Malin
On Oct 18, 2009, at 3:01 PM, Brent Smith wrote: Is there a certain class or framework that people are using to store Keychain Information? A relevant subject line is always a good idea; your query was actually about Keychain, not ssh. On Oct 18, 2009, at 3:01 PM, I. Savant wrote: Apps li

Re: Curious about SSH --> actually about: Keychain --> (passive aggressive)

2009-10-19 Thread Stuart Malin
On Oct 18, 2009, at 11:13 PM, Brent Smith wrote: thanks for the help all. Theres no need to be passive aggressive What you perceived as "passive aggressive" is... I.S.'s style, which, if you were a regular reader of the list, you'd be familiar with; a style that (I suspect) ameliorates hi

Re: Compile error using @synchronized on methods that return values

2009-11-08 Thread Stuart Malin
On Nov 8, 2009, at 2:56 PM, Adam R. Maxwel wrote: On Nov 8, 2009, at 3:03 AM, Ken Tozier wrote: "Control reaches end of non-void function" I Googled for "Objective-C accessors and @synchrinized" which seemed to indicate that the following was the correct way to handle it - (id) someMeth

My app died in _CG_spin_lock_try and I don't know what to make of this

2009-11-11 Thread Stuart Malin
I'd appreciate some insight... alas, I don't have much good info... I was running my app from Xcode... my app's window suddenly disappeared, and GDB started up, so I opened the Debugger window. There was no textual indication of why the app had died (that is, _no_ display of something like

death in dealloc

2010-03-13 Thread Stuart Malin
I have some code that is throwing EXC_BAD_ACCESS. It does so when an object is deallocating, in its -dealloc method on a call to [super dealloc]. The object's class's superclass is NSObject. Here's the (relevant part of the) stack trace: #0 0x7fff872e016d in _class_hasCxxStructorsNoSuper #1

[SOLVED] Re: death in dealloc

2010-03-14 Thread Stuart Malin
ou release an ivar but don't set > it to nil afterwards. > > -Steven > > On Sat, Mar 13, 2010 at 12:53 PM, Stuart Malin wrote: > I have some code that is throwing EXC_BAD_ACCESS. It does so when an object > is deallocating, in its -dealloc method on a call to [supe

convert password from SecKeychainFindGenericPassword to NSString

2010-01-31 Thread Stuart Malin
I acquire a password from a keychain using SecKeychainFindGenericPassword. That provides a non null terminated c string and a length. I had been using [NSString stringWithCString: length:] to get an NSString instance of the password. However, the +stringWithCString:length: method was deprecated

Re: convert password from SecKeychainFindGenericPassword to NSString

2010-01-31 Thread Stuart Malin
On Jan 31, 2010, at 9:12 PM, Kyle Sluder wrote: > On Sun, Jan 31, 2010 at 5:51 PM, Stuart Malin wrote: >> I acquire a password from a keychain using SecKeychainFindGenericPassword. >> That provides a non null terminated c string and a length. I had been using >> [NSStr

Re: convert password from SecKeychainFindGenericPassword to NSString

2010-02-01 Thread Stuart Malin
acters are not allowed. > > On Jan 31, 2010, at 6:28 PM, Stuart Malin wrote: > >> >> On Jan 31, 2010, at 9:12 PM, Kyle Sluder wrote: >> >>> On Sun, Jan 31, 2010 at 5:51 PM, Stuart Malin wrote: >>>> I acquire a password from a keychain using SecK

Re: convert password from SecKeychainFindGenericPassword to NSString

2010-02-01 Thread Stuart Malin
On Jan 31, 2010, at 9:49 PM, Kyle Sluder wrote: > On Sun, Jan 31, 2010 at 6:28 PM, Stuart Malin wrote: >> If I use +dataWithBytes:length: then I need to specify a length 1 greater, >> and that additional byte must be set to 0 (to null terminate the string). >> So, I co

Determining the name of a method's caller

2010-02-04 Thread Stuart Malin
I have tried to search for a technique to do this, but perhaps my searching skills are deficient. What I want to do is be able to write an NSLog() call in a method that emits information about the method that invoked the present method. This would serve me in debugging without needing to run g

Guidance on use of Application Support folder

2010-02-12 Thread Stuart Malin
The recent post regarding "Creating an Application Support folder" made me think about that folder. My understanding is that this folder is to be used for information generically usable by the application, but not specific to a g

Re: Guidance on use of Application Support folder

2010-02-12 Thread Stuart Malin
There is some discussion of relevance here: <http://www.cocoadev.com/index.pl?ApplicationSupportFolder> On Feb 12, 2010, at 11:13 AM, Jens Alfke wrote: > > On Feb 12, 2010, at 8:05 AM, Stuart Malin wrote: > >> I am building an app that needs to store per-user data t

Re: Proper way to initialize application support file

2010-02-18 Thread Stuart Malin
On Feb 18, 2010, at 12:30 AM, Paul Johnson wrote: > I see the data I get from the internet as not in the strictest sense > 'necessary' for the program to run, just that it would be unable to do > very much without it. So using my loose definition, the Application > Support folder would be the plac

NSURLConnection Asynchronous vs. Synchronous Asymmetry

2010-03-05 Thread Stuart Malin
I haven't been able to find any documentation or relevant Web results regarding a situation I'm experiencing: I get different results for the same identical NSURLRequest when I execute the request using NSURLConnection's +sendSynchronousRequest versus when I execute using asynchronously by allo

How to detect a click on app's dock icon (when the app is active)?

2009-06-07 Thread Stuart Malin
I have a non Document based app. If the window is closed, I want to have the user be able to get it back by clicking on the dock icon. (Note that Apple's Mail does this). I have implemented NSApplication's - (void) applicationDidBecomeActive:(NSNotification *)notif but that is only inv

Re: How to detect a click on app's dock icon (when the app is active)?

2009-06-07 Thread Stuart Malin
On Jun 7, 2009, at 3:05 PM, Andy Lee wrote: On Jun 7, 2009, at 8:50 PM, Stuart Malin wrote: I have a non Document based app. If the window is closed, I want to have the user be able to get it back by clicking on the dock icon. (Note that Apple's Mail does this). I have implem

Font Panel and storing font user default

2009-06-15 Thread Stuart Malin
I would like for my app to enable the user to set a user default for a Font to be used in a certain part of the application. I have a preferences panel, and within that am able to open the NSFontPanel. However, I can't figure out how to capture the setting that is made: must I actually have

Re: Font Panel and storing font user default

2009-06-15 Thread Stuart Malin
On Jun 15, 2009, at 6:31 PM, Stuart Malin wrote: I am replying to my own posting with updated info, for the archives... I would like for my app to enable the user to set a user default for a Font to be used in a certain part of the application. I have a preferences panel, and within that am

NSLinkAttributeName: can I control the visual presentation?

2009-07-04 Thread Stuart Malin
I have a mutable attributed string that is displayed in an NSTextView. For a certain range, I set several attributes, including NSLinkAttributeName. However, the presentation shows as blue underlined text even though I have set other attributes for the font color and also have set the under

Re: NSTextView without NSScrollView

2009-07-18 Thread Stuart Malin
On Jul 17, 2009, at 5:38 PM, James Walker wrote: Is there a way to have an NSTextView that is not enclosed in an NSScrollView? IB doesn't seem to want to let me. It would be for displaying static rich text (certain things are harder, or maybe even impossible, to do with NSTextField). I know

setFrameSize called multiple times for a single size change?

2009-07-21 Thread Stuart Malin
I have a sub-classed TableView that is the document view of an ScrollView. The rows of the TableView are composited by a custom cell, and soI have overridden the -setFrameSize method of the TableView in order to determine if any rows have changed height as a consequence of the resize (if s

Re: setFrameSize called multiple times for a single size change?

2009-07-21 Thread Stuart Malin
On Jul 21, 2009, at 9:17 AM, Stuart Malin wrote: I now cache the last size given to the -setFrameSize method, and don't perform my testing for row height changes if the width hasn't changed, so I am no longer incurring that calculation cost. Question 2 --> Is there a

Re: setFrameSize called multiple times for a single size change?

2009-07-21 Thread Stuart Malin
On Jul 21, 2009, at 9:27 AM, Kyle Sluder wrote: On Tue, Jul 21, 2009 at 9:17 AM, Stuart Malin wrote: I have a sub-classed TableView that is the document view of an ScrollView. For future reference: TableView and ScrollView are not names of classes in Cocoa. NSTableView and NSScrollView

Re: I need a milder application badge (solution)

2009-07-25 Thread Stuart Malin
Jay: I hope I am on the mark here with what you are trying to achieve I have just constructed a rather tiny app that displays a custom image in the Dock. This custom view is shown in the dock for the app itself when running (not just when minimized). The app icon is *not* shown becau

SCNetworkReachability and impact of Snow Leopard

2009-08-30 Thread Stuart Malin
I am writing some code on 10.5 Leopard that uses SCNetworkReachability. The latest documentation (SysConfig.pdf dated 2009-07-30) shows the Network Reachability Flags (with names such as kSCNetworkReachabilityFlagsReachable) as being declared in SCNetworkReachability.h as of 10.6. However

Re: Cocoa et al as HCI usability problem

2008-05-18 Thread Stuart Malin
On May 18, 2008, at 3:56 PM, [EMAIL PROTECTED] wrote: On Sun, May 18, 2008 at 8:41 PM, Julius Guzy <[EMAIL PROTECTED]> wrote: Well, there is a problems with the documentation and if it does not get resolved then people will end up unable to write the code. I mean what is the point in loosin

Re: XML schema support

2008-05-18 Thread Stuart Malin
As best as I understand, the NSXML* classes are build on libxml, but even so, there isn't, to my knowledge, any schema support exposed in Cocoa by these classes. However, the good news is that you should have libxml on your machine. Todd Ditchendorf's XML Nanny performs Schema and RELAX NG

alternate pattern for object initializers

2008-05-25 Thread Stuart Malin
I am reasonably new to Cocoa. I do have the concept of a "designated initializer" understood. However, I have begun to use an alternate pattern. Before I get too far in my use of this approach, I thought it best to check with the more experienced developers here to see if my approach for do

timing of showing a window and setting display attributes of controls on that window

2008-06-03 Thread Stuart Malin
I have a window with a few NSTextFields. The window has a controller (sub class of NSWindowController). The window is loaded from a Nib. I set the stringValue of the NSTextFields using the -setStringValue. I tried doing this before showing the window:[super showWindow:self]; I moved the -sh

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

2008-06-09 Thread Stuart Malin
On Jun 9, 2008, at 9:11 PM, Adam R. Maxwell wrote: I thought I read on the Xcode users list that Xcode is using ICU for regex find-and-replace, so it's too bad the rest of us can't use it. I recall the same. And further, I am of the understanding that NSPredicate uses ICU for its pattern m

noob q: adding a button to a window programmatically

2008-06-09 Thread Stuart Malin
Until now I have created my GUIs using IB. I want a better understanding of what goes on "under the hood" of instantiating a Nib, so decided to try adding a button to a window programmatically. I can't get the button to appear, and so presume I am missing some fundamental concept. Here's

applicationWillTerminate and asynchronous orderly shutdown

2008-06-10 Thread Stuart Malin
I have an app that establishes multiple TCP connections. If the user quits the app, I'd like to shut all those connections gracefully (i.e., conduct a bit of protocol) rather than just close them abruptly. To most properly handle this, I should even wait for the servers' responses. I am cu

noob question regarding (programmatic) bindings and data type coercion

2008-06-17 Thread Stuart Malin
I'm still trying to gain a deep and thorough understanding of bindings. I've made a very small app in which I am establishing a binding programmatically. I see different behaviors depending upon how I describe the bound property. Let me first describe my rather trivial app: 0) my app ha

noob questions regarding KVC accessors for a mutable array property

2008-06-26 Thread Stuart Malin
I am trying to gain a working understanding of KVC. I have made a small app that has a class Party which has a property "attendees" that holds Person objects. The attendees property is KVC compliant for a mutable array (it has index accessors). In another part of my app, I want to find the

noob question regarding proxy object returned by -selection method of NSArrayController

2008-06-28 Thread Stuart Malin
Still pursuing my understanding of bindings: I have a table view whose columns are bound to an NSArrayController, which in turn has its contentObject that is a mutable array of Person objects. Person objects have KVC-conforming properties, which provide the values for the data in the column

[SOLVED] noob question regarding proxy object returned by -selection method of NSArrayController

2008-06-28 Thread Stuart Malin
Sorry for the post how did I miss -selectedObjects Begin forwarded message: From: Stuart Malin <[EMAIL PROTECTED]> Date: June 28, 2008 10:43:36 AM PDT To: Cocoa Developer List Subject: noob question regarding proxy object returned by -selection method of NSArrayController

Re: noob questions regarding KVC accessors for a mutable array property

2008-06-29 Thread Stuart Malin
t one engineer would would like the doc to specifically say that you should NOT have an accessor that returns an array like this. On Jun 26, 2008, at 7:54 PM, Stuart Malin wrote: Separately, I have an accessor -attendees: of the Party class, which is currently implemented as: -

Re: noob question regarding proxy object returned by -selection method of NSArrayController

2008-06-29 Thread Stuart Malin
On Jun 29, 2008, at 12:07 AM, Ken Thomases wrote: On Jun 28, 2008, at 12:43 PM, Stuart Malin wrote: I have a button in the GUI that should cause various changes to the person selected in the table. In the method that is the target of the button's action, I need to get the selected P

Re: mutableArrayForKeyValue Question (ignore other email)

2008-06-29 Thread Stuart Malin
On Jun 29, 2008, at 7:05 AM, Scot t Anguish wrote: From: Scott Anguish <[EMAIL PROTECTED]> Subject: Re: mutableArrayForKeyValue Question (ignore other email) To: "Alex Wait" <[EMAIL PROTECTED]> Cc: cocoa-dev Message-ID: <[EMAIL PROTECTED]> Content-Type: text/plain; charset=US-ASCII; format=flo

How to get an NSString from a non-terminated array of unicode chars (length is known)

2008-03-03 Thread Stuart Malin
My problem is that I receive a function call from a C library that gives me a wchar_t array and its length. The unicode array is _not_ terminated. The library defines an XML_Char type, so my code below refers to that, but XML_Char is wchar_t (which, I believe is UTF8 on a Mac). I'm very w

Re: How to get an NSString from a non-terminated array of unicode chars (length is known)

2008-03-03 Thread Stuart Malin
On Mar 3, 2008, at 9:19 PM, Karsten wrote: you can simply use: [NSString stringWithUTF8String: s]. or [NSString stringWithCharacters:s length: len]. Can't use the former because s is not terminated. The latter (with a cast): NSString *str = [NSString stringWithCharacters:(const unichar *)s

Re: (Resolved) How to get an NSString from a non-terminated array of unicode chars (length is known)

2008-03-04 Thread Stuart Malin
gth:. Deborah Goldsmith Apple Inc. [EMAIL PROTECTED] On Mar 3, 2008, at 11:44 PM, Stuart Malin wrote: Yes - thanks - that works: NSMutableData *data = [NSMutableData dataWithBytes:(void *)s length:len]; //append a NULL unicode char XML_Char nullChar = 0; XML_Char *n

How to get the name of a method at runtime?

2008-03-09 Thread Stuart Malin
I'd like to have a method determine the name of the method that invoked it -- as an NSString. For example - (void) method1 { [someObject method2]; } - (void) method2 { // here, I'd like to be able to find the name of the caller // in this example, that would be "method

Re: How to get the name of a method at runtime?

2008-03-09 Thread Stuart Malin
On Mar 8, 2008, at 11:14 PM, Sherm Pendley wrote: On Sun, Mar 9, 2008 at 4:44 AM, Stuart Malin <[EMAIL PROTECTED]> wrote: I'd like to have a method determine the name of the method that invoked it -- as an NSString. For example - (void) method1 { [someObject met

Re: How to get the name of a method at runtime?

2008-03-09 Thread Stuart Malin
Interesting approach, Tony. However, __builtin_return_address isn't an object, so stringWithFormat throws an exception when given the %@ token. It should be %u (or %U ?? - I'm not sure of the difference). So, just so I could step through the code in the debugger, I wrote: int pid

Re: MVC Design Question

2008-03-10 Thread Stuart Malin
Take a look at this work by Robbie Hanson: http://deusty.blogspot.com/2008/02/towards-open-source-xmpp-framework- for.html http://code.google.com/p/xmppframework/ I can't vouch for the style of its internal design, but there is a lot there to leverage. I'm building my own native Cocoa XMP

warning: assignment from distinct Objective-C type

2008-03-11 Thread Stuart Malin
I have a line of code: xmppStream = [[XMPPStream alloc] initWithDelegate:self]; That when compiled, receives a warning: warning: assignment from distinct Objective-C type Now, what's odd to me, is if I change the source code to this: xmppStream = [XMPPStream alloc]; [x

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Stuart Malin
On 11/03/2008, at 7:19 PM, Stuart Malin wrote: I have a line of code: xmppStream = [[XMPPStream alloc] initWithDelegate:self]; That when compiled, receives a warning: warning: assignment from distinct Objective-C type Not sure of the actual reason, but if you both forward declar

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Stuart Malin
warning was more specific before Leopard, maybe a regression. Nonetheless, good coding style should lead you to rename your method to: - (id)initXMPPStreamWithDelegate:(id)aDelegate; instead of: - (XMPPStream *)initWithDelegate:(id)aDelegate; -- Julien On Tue, Mar 11, 2008 at 9:19 A

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Stuart Malin
n Mar 11, 2008, at 1:19 AM, Stuart Malin wrote: The interface for the XMPPStream initializer is: - (XMPPStream*) initWithDelegate:(id)initialDelegate; The canonical return type of an -init method is (id). So the above should be: - (id)initWithDelegate:(id)initialDelegate

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Stuart Malin
Thanks everybody who replied. From the conversation, I now understand why the two line version didn't have the compiler warning while the one line version did: once the +alloc was assigned to an ivar, the compiler then knew which of the multiple -init methods to use. I thought I was adding v

Order of resulting selector invocations from performSelector

2008-03-14 Thread Stuart Malin
If I have my code issue multiple performSelectorOnMainThread:someSelector :waitUntilDone:NO is there any guarantee about the resulting order of execution? (please note that I passed in NO for waitUntilDone) That is, if for the same object, if performSelectoronMainThread is executed twi

Re: Convert NSString to FSRef

2008-03-15 Thread Stuart Malin
Kevin, Here's two variants that you can start to work with. Use the first one if it works. The second one is a more roundabout way of getting the NSString to bytes. Two disclaimers: 1: I have never worked with CF functions before, but have been doing a bit of string-data-bytes manipulati

Re: Convert NSString to FSRef

2008-03-16 Thread Stuart Malin
your knowledge in a clear and specific way, which I notice you do frequently, and with accuracy. Respectfully, --Stuart On Mar 16, 2008, at 5:35 AM, Jens Alfke wrote: On 15 Mar '08, at 11:49 PM, Stuart Malin wrote: 1: I have never worked with CF functions before Then, with all due re

@class causing grief

2008-03-18 Thread Stuart Malin
Scott, I notice that I get the AT_NAME compiler error when I've forgotten or mistyped a semicolon _prior_ to the place where an @ symbol is used. For instance, in the following code: @class SomeClassA @class SomeClassB; @interface test : NSObject { SomeClassA *someC

Intercepting retain/release of object

2008-03-19 Thread Stuart Malin
I am having some trouble in an app with an object and its retain counts, so I added methods to intercept -retain and -release on my affected object so I could set breakpoints to observe the value. But doing so causes some really odd behavior, such as the object receiving extra retain events

Re: Intercepting retain/release of object

2008-03-19 Thread Stuart Malin
Thanks all! On Mar 19, 2008, at 8:04 AM, Jonathan del Strother wrote: -(id)retain needs to return itself, not void. On Mar 19, 2008, at 8:09 AM, Pierre Molinaro wrote: The retain method should return self object : So it should. Changing that fixed the problem. Hmmm... the compiler never w

best practices for object instance initialization

2008-03-21 Thread Stuart Malin
I have a class (a subclass of NSObject) that requires several parameters to be properly initialized. I have a -(id) initWithParams... method defined. I can't have -init invoke -initWithParams (as a designated initializer) because the object instance wouldn't be set up properly. I am wonderi

Re: Intercepting retain/release of object

2008-03-21 Thread Stuart Malin
Thanks for all the comments. I had started this thread not because I wanted to peak under the hood, or employ non-canonical techniques, but because I had an instance become free before its time. I had though that intercepting -release (and also -retain, why not), would allow me to find the

Re: Intercepting retain/release of object

2008-03-23 Thread Stuart Malin
Thanks Jack and Shem for your counsel. For neary all of my code, I have nice, straightforward retain-release pathways. The one that had been giving me trouble is an oddball: I have a factory class that generates an instance. That instance is bounced around handlers of a state machine. Most

[OT: security] smbclient

2008-04-15 Thread Stuart Malin
[sorry to post here, but I don't know what other list might be better/ more appropriate] I run Little Snitch and it has popped up that smbclient wants to connect to some server (169.254.44.184) on port 139 (netbios-ssn). That IP doesn't resolve when I try to reverse lookup. I'm concerned a

Re: [OT: security] smbclient

2008-04-15 Thread Stuart Malin
My apologies for bothering the list. I didn't mean to raise a virus scare (and hope I haven't). I.S. -- not quite a "random building" that I've posted to -- lots of very smart people here -- and was hoping by my post here to be led to a _quality_ security related Mac mailing list or forum;

vertically resize NSTextField frame

2008-04-21 Thread Stuart Malin
I have an NSTextField into which I pour some text. I'd like to resize the text field's frame to accommodate the typeset text. I'd like to adjust only the frame's vertical size, leaving the width fixed. I'd appreciate any pointers about what methods I can use to accomplish this. _

[SOLVED] vertically resize NSTextField frame

2008-04-21 Thread Stuart Malin
nds:r]; [theTextField setFrameSize:s]; If there is a better way to be doing this, please advise. On Apr 21, 2008, at 6:06 PM, [EMAIL PROTECTED] wrote: Message: 16 Date: Mon, 21 Apr 2008 18:03:30 -1000 From: Stuart Malin <[EMAIL PROTECTED]> Subject: vertically resize NSTextField fram

Re: Programmatic "Size To Fit"

2008-05-01 Thread Stuart Malin
SizeToFit will expand horizontally. If you need to constrain horizontal width... here's some code I use resize NSTextField instances vertically while constraining the horizontal width to fit within some contained view. I believe this approach would work with other sorts of controls. Adapt

Re: Launching Cocoa Application externally

2008-05-14 Thread Stuart Malin
On May 14, 2008, at 5:55 AM, [EMAIL PROTECTED] wrote: The App runs fine in gdb and even writes the output file. Still the same error (crash and no output written) when running it with "open MyApp.app". Yann Have you built a deployment (Release) version? Unless you have done so, a Debu

What is the default type for an integer literal (as relates to its use in NSLog)?

2008-12-15 Thread Stuart Malin
I am trying to be 32/64 bit "clean" in some new code that I am writing. When I declare some integer values, say for named option values as shown here, what is the type that the compiler assigns to these values? enum { SomeOptionValue = 1, AnotherOptionValue = 2, }; The

Re: What is the default type for an integer literal (as relates to its use in NSLog)?

2008-12-15 Thread Stuart Malin
On Dec 15, 2008, at 10:00 AM, Nick Zitzmann wrote: On Dec 15, 2008, at 12:35 PM, Stuart Malin wrote: I am trying to be 32/64 bit "clean" in some new code that I am writing. When I declare some integer values, say for named option values as shown here, what is the type that th

Re: What is the default type for an integer literal (as relates to its use in NSLog)?

2008-12-15 Thread Stuart Malin
On Dec 15, 2008, at 10:50 AM, Nick Zitzmann wrote: On Dec 15, 2008, at 1:39 PM, Stuart Malin wrote: and define a method that takes the option as a parameter - (void) someMethodWithOption:(MyOptionValue)optionVlaue; Question: Should I force MyOptionValue to be an NSUInteger? If so, how

[newbie] Use of accessors versus direct access of ivars

2009-01-08 Thread Stuart Malin
I have a class with ivars for which there are accessors. I understand that the importance of using a setter method (or to use setValue:ForKey:) to set the ivar so that KVO operates. However, Is there a compelling reason to use, in the methods of a class, a getter method (or valueForKey:) ve

[commentary] The value of warnings [was: Re: A Data Object in Cocoa]

2009-01-09 Thread Stuart Malin
From time to time I see questions arise and comments made about disabling warnings. I am reposting commentary made very recently since I believe it is a powerfully stated argument in favor of having the compiler generate warnings (-Wall, etc.), and for writing code that doesn't cause the co

[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: Detecting Initialization

2009-01-28 Thread Stuart Malin
On Jan 28, 2009, at 4:46 PM, cocoa-dev-requ...@lists.apple.com wrote: On Thu, Jan 29, 2009 at 11:39:21AM +1100, Graham Cox wrote: On 29 Jan 2009, at 11:06 am, David H. Silber wrote: Is there some means of detecting if an instance has been initialized? I'm thinking not. Apple's "NSObjec

processName and Bundle Name -- the same?

2009-02-03 Thread Stuart Malin
In order to locate certain application-specific directories, I use the application's name (say, for example /Library/ Presently I am using [NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"] to get the application name. (in my info.plist, the Bundle Name is set from $(PRODUCT_N

Memory Management and @synthesized accessors

2009-02-21 Thread Stuart Malin
I've seen the idiom [[property retain] autorelease] used in getter accessors, and just re-read the Memory Management Programming Guide (MMPG) to understand this. Now I do, and see how the perhaps once canonical approach of having a setter release-then-retain (if the new value is not equal t

Re: Memory Management and @synthesized accessors

2009-02-21 Thread Stuart Malin
On Feb 21, 2009, at 9:22 AM, Ken Thomases wrote: On Feb 21, 2009, at 12:39 PM, Stuart Malin wrote: I've seen the idiom [[property retain] autorelease] used in getter accessors, and just re-read the Memory Management Programming Guide (MMPG) to understand this. Now I do, and see ho

Re: Memory Management and @synthesized accessors

2009-02-21 Thread Stuart Malin
On Feb 21, 2009, at 9:41 AM, Stuart Malin wrote: So, I am curious as to why the default (retain) behavior of @synthesize does just this? What makes you think it does? There is no concrete promise about how synthesized accessors are implemented, except that they conform to the

NSTreeController Content Array as index accessor object -- what is the ?

2009-02-21 Thread Stuart Malin
I'm confused using an NSTreeController. I have a node object that implements indexed accessors. This works. For I have an OutlineView that is bound to a nib instantiated instance of TreeController. My problem is this: First, I bound the TreeController's Content Array to an instance of MSM

Drawing a badge in an OutlineView column cell: but width changes on expanding

2009-02-24 Thread Stuart Malin
I have been reading various blogs, tried to search CocoaBuilder, and have ben looking at the code in Apple's PhotoSearch sample, but am not clear about the best way to handle this situation: I have an NSOutlineView for which I have set a custom cell (sub class of NSTextViewCell) in order to

Re: Drawing a badge in an OutlineView column cell: but width changes on expanding

2009-02-24 Thread Stuart Malin
On Feb 24, 2009, at 10:51 AM, Corbin Dunn wrote: On Feb 24, 2009, at 12:38 PM, Stuart Malin wrote: I have been reading various blogs, tried to search CocoaBuilder, and have ben looking at the code in Apple's PhotoSearch sample, but am not clear about the best way to handle this situ

Re: Drawing a badge in an OutlineView column cell: but width changes on expanding

2009-02-24 Thread Stuart Malin
On Feb 24, 2009, at 11:48 AM, Corbin Dunn wrote: I've just published a blog that has screen shots of these states: http://stuartmalin.blogspot.com/2009/02/troubles-with-cocoa-custom.html Your table column's width is changing automatically (because you have setAutoresizesOutlineColumn:YES),

Binding an OutlineView and/or its TableColumn to a TreeController

2009-02-24 Thread Stuart Malin
I have a data model that is bound to a TreeController. The TreeController manages an OutlineView. When I first implemented this, I bound the TableColumn backing the OutlineView to the TreeController (the TableColumn's Value property to the TreeController's arrangedObjects with a Model Key P

OutlineView with custom TableColumn cell doesn't redisplay when losing focus

2009-02-26 Thread Stuart Malin
I have a custom cell attached to a TableColumn of an OutlineView. My delegate for the OV implements willDisplay:cell: I need to redisplay all cells when the OV loses or gains focus, but this method seems only to be called for the highlighted row. Is there some property I need to activate

Re: NSTableView && Custom Background ...

2009-02-26 Thread Stuart Malin
On Feb 25, 2009, at 2:22 PM, Corbin Dunn wrote: On Feb 25, 2009, at 2:58 PM, Mic Pringle wrote: Hi, I've a subclass of NSTableView that draws a custom gradient background. What I'd like to do now is to draw a slightly different background when the window containing the custom NSTableView los

Re: OutlineView with custom TableColumn cell doesn't redisplay when losing focus

2009-02-26 Thread Stuart Malin
On Feb 26, 2009, at 10:33 AM, Kyle Sluder wrote: What is "focus"? Do you mean when the outline view becomes key, or when the window becomes key, or something else? --Kyle Sluder I meant that the view becomes "key." I used the term "focus" because a focus ring gets (well, may get) drawn.

Re: Why doesn't this work on my device?

2009-02-27 Thread Stuart Malin
On Feb 27, 2009, at 8:27 AM, James Cicenia wrote: ARrrgh... The database exists but it contains nothing?! I double checked it in my trusty firefox sqlite extension, and everything is there. Is there some magic "touch" I need to do to get the tables properly into the device? I have cleaned my

NSSplitView splitViewDidResizeSubviews

2009-02-27 Thread Stuart Malin
I have a Split View in my U/I. I want to update some controls *after* the user has repositioned the split view's divider. So, I implemented - (void)splitViewDidResizeSubviews:(NSNotification *)aNotification thinking it would be invoked after the user was done resizing (i.e., after the mouse

Re: Get MD5 without crashing (Mr. Gecko)

2008-11-04 Thread Stuart Malin
Mr. Gecko, In your method, because you alloc an instance of a crypto object, you must release that crypto object. The problem you are having is that you want to return a value, yet the value is derived from an object that must be released. In a sense, what you want to do is this: - (NSStr

overt and covert retain-release question (instigated by UIViewController on iPhone)

2008-11-12 Thread Stuart Malin
First: sorry if iPhone questions now belong elsewhere, but I am posting here because I want to validate my understanding of retain- release in the Cocoa context. I've just acquired the book "The iPhone Developer's Cookbook" by Erica Sadun. Her first "Hello World" example (listing 1-4, if yo

Re: Difference between "Target" and "Executable" ?

2008-11-21 Thread Stuart Malin
On Nov 20, 2008, at 5:06 PM, [EMAIL PROTECTED] wrote: Also, what exactly is the difference between "Targets" and "executables" ?? Seems like I am always editing/configuring the Target but never the executable...? What is the purpose of the executable anyway? I know there were several meaningf

  1   2   >