UIPickerView Caching Items

2009-03-13 Thread James Heggs
Hi all, I am doing a bit of prototype testing and have coded a small iPhone app that browses Bonjour services. On the interface I have currently just added a UIPickerView which dynamically at runtime gets items added to it as and when my NSNetServiceBrowser finds services. When the browser f

Re: NSWorkspaceWillPowerOffNotification from a daemon

2009-03-13 Thread Dave Keck
It seems your situation is similar to this: http://lists.apple.com/archives/macnetworkprog/2007/Aug/msg00017.html I just tested, and a normal (non-daemon) Cocoa app _does_ receive the power-off event. It sounds like daemons in particular have an issue receiving it. It appears that IOKit has some

Re: Getting the front process path

2009-03-13 Thread Dave Keck
Try: NSDictionary *frontAppInfo = [[NSWorkspace sharedWorkspace] activeApplication]; NSString *pathToActiveApp = [frontAppInfo objectForKey: @"NSApplicationPath"]; NSLog(@"%@", pathToActiveApp); ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Pl

NSManagedObject validateForDelete problem

2009-03-13 Thread Ward Ruth
I'm attempting to use NSManagedObject validateForDelete in order to provide timely feedback to delete actions by users. But the relationship delete rules don't seem to be getting applied as I would expect. As a toy example I created a simple CoreData app with two entities, Department and

Re: Performance problem with GC enabled

2009-03-13 Thread Marcel Weiher
On Mar 12, 2009, at 8:39 AM, Bill Bumgarner wrote: On Mar 12, 2009, at 6:04 AM, John Engelhart wrote: [ way too many words deleted ... please try to succinctly state issues in the future ] You have created a micro benchmark that demonstrates a significant bit of overhead from

Re: TXT Records with NSImages

2009-03-13 Thread Alexander Spohr
Just got recently into that pit myself. Read the docs _very_ carefully for this one. (And file a complaint at the bottom of the doc’s page) dictionaryFromTXTRecordData: Return Value A dictionary representing txtData. The dictionary’s keys are NSStringobjects using UTF8 encoding. The _va

RE: NSTableView live resizing glitch

2009-03-13 Thread Ulai Beekam
Corbin, Please take a look at the bug with ID 6677201 and also feel free to check out the email I sent you yesterday. Stay in touch. Meanwhile, I rather like Chris' approach because it works :) Thanks, U > From: corb...@apple.com > Date: Thu, 12 Mar 20

Re: Performance problem with GC enabled

2009-03-13 Thread Marcel Weiher
On Mar 12, 2009, at 10:54 AM, Bill Bumgarner wrote: On Mar 12, 2009, at 10:29 AM, John Engelhart wrote: Actually, this isn't a "micro-benchmark". If you aren't displaying the results, responding to user events, keeping an application state up to date and otherwise doing all of the things

re: NSManagedObject validateForDelete problem

2009-03-13 Thread Ben Trumbull
I'm attempting to use NSManagedObject validateForDelete in order to provide timely feedback to delete actions by users. But the relationship delete rules don't seem to be getting applied as I would expect. -validateForDelete: is intended as a potential delegate hook for subclasses of NSManaged

Re: Performance problem with GC enabled

2009-03-13 Thread Paul Sanders
Bill said something in passing on this issue which I think is important. To paraphrase: If you care about performance, don't use the Cocoa RegEx stuff to parse large amounts of data. I think this observation is true whether you use GC or not. GC just makes it worse. I'd like to see a pure-C ben

Singleton Help ...

2009-03-13 Thread Mic Pringle
Hi, I've been looking into creating a singleton class to manage some objects that I have that I'd like to be globally available. I've been reading through http://www.cocoadev.com/index.pl?SingletonDesignPattern and all looks well except I now have the following question ... I'd like my singleton

[CA] zPosition + mask + animation = no animation

2009-03-13 Thread Paul Arthur Henrion
Hi list's readers, I'm encountering a weird issue by using a masked, animated, z-positionned layer within an animated context: the layer's animation does run only when the context's animation does. The thing is when I deactivate the layer's mask, it works; when I delete the z-position setting of

Re: Singleton Help ...

2009-03-13 Thread Mike Abdullah
By definition, if it's a singleton, it will exist for the lifetime of the program; there is no risk of the notification centre sending messages to a now non-existent object. On 13 Mar 2009, at 10:31, Mic Pringle wrote: Hi, I've been looking into creating a singleton class to manage some ob

Re: Singleton Help ...

2009-03-13 Thread Mic Pringle
But I thought that it was best practice to remove yourself from the notification center before terminating your application, as doesn't the notification center live in the objective-c runtime and therefore is always active, regardless of whether your application is or isn't ? -Mic 2009/3/13 Mike

Re: Singleton Help ...

2009-03-13 Thread Sandy McGuffog
I'm pretty sure the run-time will sort that all out for you. But I'm a bit confused here - if you're getting an applicationDidTerminate notification, why not just remove them there anyway? Sandy On Mar 13, 2009, at 12:54 PM, Mic Pringle wrote: But I thought that it was best practice to r

Re: Singleton Help ...

2009-03-13 Thread Jean-Daniel Dupas
The Oobj runtime is a C library loaded by each ObjC application, it's not an autonome entity that lives beyond your application termination. Le 13 mars 09 à 11:54, Mic Pringle a écrit : But I thought that it was best practice to remove yourself from the notification center before terminating

Re: Singleton Help ...

2009-03-13 Thread Mic Pringle
Because it's the applicationDidTerminate notification from NSWorkspace, informing me about other applications closing, not my own. -Mic 2009/3/13 Sandy McGuffog : > I'm pretty sure the run-time will sort that all out for you. > > But I'm a bit confused here - if you're getting an applicationDidTe

why can't I see my layer?

2009-03-13 Thread Memo Akten
I have a simple setup below, but I can't see my text layer, what am I missing? (also are all of the commented lines nessecary?) view= [[[NSApplication sharedApplication] keyWindow] contentView]; rootLayer = [CALayer layer]; [rootLayer setBounds: NSRectToCGRect

Re: TXT Records with NSImages

2009-03-13 Thread Joe Turner
Actually, I am converting it to NSData, and then adding it, and it still returns nil Joe On Mar 13, 2009, at 3:27 AM, Alexander Spohr wrote: Just got recently into that pit myself. Read the docs _very_ carefully for this one. (And file a complaint at the bottom of the doc’s page) dictiona

Re: code for drawing an NSTextField to a panel window ...

2009-03-13 Thread vinai
Hi All, Thanks for your feedback. I AM coming from a non-Cocoa background, and I was hoping to keep some picture of how the GUI was interacting with my code at a fairly low level. My previous experience is with an X11+motif application that did real-time data acquisition from an A/D card, an

Re: TXT Records with NSImages

2009-03-13 Thread Michael Ash
On Fri, Mar 13, 2009 at 8:12 AM, Joe Turner wrote: > Actually, I am converting it to NSData, and then adding it, and it still > returns nil Post code. Mike ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mo

Re: code for drawing an NSTextField to a panel window ...

2009-03-13 Thread Michael Ash
On Fri, Mar 13, 2009 at 8:01 AM, vinai wrote: > > Hi All, > > Thanks for your feedback.  I AM coming from a non-Cocoa background, and I was > hoping to keep some picture of how the GUI was interacting with my code at a > fairly low level. Crawl before you walk, walk before you run. Writing you

Re: TXT Records with NSImages

2009-03-13 Thread Keith Duncan
Joe, That's a lot of data to be storing in the TXT record. I'd advise that you store it in the NULL record as iChat does for 'Bonjour' chat. Keith ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderato

Re: TXT Records with NSImages

2009-03-13 Thread Joe Turner
Here: NSImage *original = [NSImage imageNamed:NSImageNameComputer]; [original setSize:NSMakeSize(10.0f, 10.0f)]; NSData *image = [original TIFFRepresentation]; NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:image]; NSData *finalData = [imageR

Re Singleton Help ...

2009-03-13 Thread Peter Hudson
I had a very similar situation using a singleton and found that I needed to remove it from the notification centre before the app died - or landed up with an odd side effect (main menu items in xCode would no longer respond to the mouse ). I fixed it by getting the app delegate to respond

NSPredicate & live filtering question

2009-03-13 Thread Shamyl Zakariya
Hi, I'm belatedly dipping my toes into NSPredicate to do some array filtering. I have an array of objects which have (among other things) a boolean property. In my UI, I have three tables: 1) The first table has all the entries in the array. 2) The second table uses an NSPredicate to filter

Re: Re Singleton Help ...

2009-03-13 Thread Dave DeLong
Similarly, couldn't you have the singleton itself register to receive the applicationWillTerminate notification? I don't think it has to be done via the app's delegate. Something like: (in your singleton's accessor, or perhaps a private initializer?) [[NSNotificationCenter defaultCenter] ad

Re: Re Singleton Help ...

2009-03-13 Thread Mic Pringle
Yep. This looks like the best solution. Will give this a go. Thanks -Mic 2009/3/13 Dave DeLong : > Similarly, couldn't you have the singleton itself register to receive the > applicationWillTerminate notification?  I don't think it has to be done via > the app's delegate. > > Something like: > >

Re: code for drawing an NSTextField to a panel window ...

2009-03-13 Thread Paul Sanders
> Writing your GUI in code is a useful and educational exercise. But it > will only be useful and educational if you do it *after* you are > already proficient with the standard way of doing things. Get good > with the basics (which means using nibs), and once you're comfortable > with that, you'll

Re: why can't I see my layer?

2009-03-13 Thread Memo Akten
for others reading this on the archives, I found the problem, I need to set the bounds (or frame) for titleLayer. On 13 Mar 2009, at 12:09, Memo Akten wrote: I have a simple setup below, but I can't see my text layer, what am I missing? (also are all of the commented lines nessecary?) vi

Re: NSPredicate & live filtering question

2009-03-13 Thread Mic Pringle
I think in order for this to work you have to makesure you have a key/value compliant getter & setter for the boolean value and then in the code you have to use [someObject setValue: ForKey:]; This will then notify any observers (i.e your array controller) that the value has changed and update it

cocoa file APIs

2009-03-13 Thread Roland King
Just trying to figure out what the best APIs are to use for some pretty simple file operations. I've found NSFileHandle, NSFileManager, or I could use low-level C-apis or a combination of the two. What I want to do is create and write binary files (and I guess read them again later). I'd al

Re: cocoa file APIs

2009-03-13 Thread Graham Cox
On 14/03/2009, at 12:44 AM, Roland King wrote: I was trying to find an API which gives me the correct path for temporary files, or even a temporary filename, but haven't found one. NSTemporaryDirectory Am I looking at the right APIs and thinking about this the right way, or are there

Re: TXT Records with NSImages

2009-03-13 Thread Michael Ash
On Fri, Mar 13, 2009 at 8:45 AM, Joe Turner wrote: > Here: > > NSImage *original = [NSImage imageNamed:NSImageNameComputer]; >                [original setSize:NSMakeSize(10.0f, 10.0f)]; >                NSData *image = [original TIFFRepresentation]; >                NSBitmapImageRep *imageRep = [

Re: NSTextFieldCell text color issue in NSTableView with source list highlighting

2009-03-13 Thread jonat...@mugginsoft.com
On 12 Mar 2009, at 17:07, Corbin Dunn wrote: On Mar 12, 2009, at 3:51 AM, jonat...@mugginsoft.com wrote: The recommended way to override the text color in an NSTableView NSTextFieldCell is detailed here: http://www.cocoabuilder.com/archive/message/cocoa/2008/11/5/222008. However, there se

Re: Handling errors in -initWithCoder:

2009-03-13 Thread A.M.
On Mar 13, 2009, at 12:05 AM, Graham Cox wrote: Minor problem, I think, but I'd like to get some advice about the right way to approach this. One of my classes can sometimes fail in -initWithCoder: - it relies on certain resources being available and if it doesn't get them, I thought I c

Re: How to use MySql, which api is for that

2009-03-13 Thread Clint Shryock
SMySQL_bundled.framework is list on that page ( http://mysql-cocoa.sourceforge.net/downloads.html ) under "Binary files". it's grayed out and listed as deprecated but still available for download. I linked it into a fresh project and it complied successfully. hope that helps +Clint On Fri, Mar

Re: Handling errors in -initWithCoder:

2009-03-13 Thread Graham Cox
On 14/03/2009, at 1:17 AM, A.M. wrote: awakeAfterUsingCoder: That's a new one on me... thanks, I think that looks like the right solution here. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin request

Re: [CA] zPosition + mask + animation = no animation

2009-03-13 Thread John Harper
Hi, This sounds like a framework bug. Please file a bug report so we can make sure it gets fixed (if possible including a test case showing the issue). thanks, John On Mar 13, 2009, at 3:49 AM, Paul Arthur Henrion wrote: Hi list's readers, I'm encountering a weird issue by usin

Trying to write icon data to file

2009-03-13 Thread Kevin Walzer
I'm putting together some code that will write an icon file (obtained via NSWorkspace) to a gif. I had prototyped the code with a simple command-line tool with hard-coded values for file sources, destinations, and image sizes. However, when I try to abstract the code, I am now getting weird er

Re: Performance problem with GC enabled

2009-03-13 Thread Bill Bumgarner
On Mar 13, 2009, at 2:28 AM, Paul Sanders wrote: Having said all of which, I think the original test is not unfair and I agree with a lot of the points people have made in support of that view. It's always painful to have to step outside the Cocoa frameworks, and (off topic) it seems that GC

Re: Trying to write icon data to file

2009-03-13 Thread Adam R. Maxwell
On Mar 13, 2009, at 7:57 AM, Kevin Walzer wrote: I'm putting together some code that will write an icon file (obtained via NSWorkspace) to a gif. I had prototyped the code with a simple command-line tool with hard- coded values for file sources, destinations, and image sizes. However, whe

NSButton manual drawing

2009-03-13 Thread Yvan BARTHÉLEMY
Hi, I am drawing controls into view to use as feedback during Drag & Drop operation. I've tried to draw manually a NSButton (with NSRoundedBezelStyle) using [[button cell] drawWithFrame:frame inView:[NSView focusView]]; I obtain a button image with the correct background, but the button

Binding to selection of NSArrayController manually

2009-03-13 Thread Ivy Feraco
Hello everybody Bindings problem: I have an NSArrayController subclass and an NSPopUpButton subclass. I am trying to bind the NSPopUpButton's selected object to the selection of my array controller. I have to do this manually for reasons I won't get into here. But when I do this (self is myP

Re: Performance problem with GC enabled

2009-03-13 Thread Paul Sanders
> The most complex change is the move from -dealloc to > -finalize. Finalizers are executed in an effectively > random order whereas many people seem to want deallocs to > be executed in a fixed, dependent, order. > In reality, incurring order dependencies on -dealloc is a really bad > idea; on

Re: Binding to selection of NSArrayController manually

2009-03-13 Thread Keary Suska
On Mar 13, 2009, at 9:42 AM, Ivy Feraco wrote: Hello everybody Bindings problem: I have an NSArrayController subclass and an NSPopUpButton subclass. I am trying to bind the NSPopUpButton's selected object to the selection of my array controller. I have to do this manually for reasons I won

Re: NSTableView live resizing glitch

2009-03-13 Thread Corbin Dunn
Please do log bugs when you run into these issues. I did back in August 2005: rdar://problem/4226145. It's still open but I haven't seen it recently so it might have been fixed in Leopard. Thanks! I had looked at your bug quite a few times (I promptly replied replies to the bug logged back o

Re: NSTextFieldCell text color issue in NSTableView with source list highlighting

2009-03-13 Thread Corbin Dunn
A quick side note on this problem (which I have confirmed is a bug): - (void)tableView:(NSTableView *)aTableView willDisplayCell:(id) aCell forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger) rowIndex { // note that when the NSTableView Highlight mode is set to source list

Re: Performance problem with GC enabled

2009-03-13 Thread Louis Gerbarg
On Fri, Mar 13, 2009 at 12:04 PM, Paul Sanders wrote: > > (Off topic again): Call me old-fashioned, but I don't like autorelease pools > all that much.  I believe Cocoa could have gotten along just fine without > them, had they never been invented.  I prefer C++-style 'smart pointers' > that delet

Re: Performance problem with GC enabled

2009-03-13 Thread Paul Sanders
> #define autoscoped __attribute__((cleanup(releaseObject))) > static inline > void releaseObject(id *object) { >[*object release]; > } > - (void) demo { > autoscoped NSArray *myArray = [[NSArray alloc] init]; > //do some stuff > } > The autoscoped macro tags the lval with an attribute that

Re: NSTextFieldCell text color issue in NSTableView with source list highlighting

2009-03-13 Thread Corbin Dunn
A followup on this particular problem that Jonathan reported for people to reference: On Mar 12, 2009, at 3:51 AM, jonat...@mugginsoft.com wrote: NSTableViewSelectionHighlightStyleSourceList. The source list style attempts to add auto-formatting to the cell by setting the attributed stri

Re: Performance problem with GC enabled

2009-03-13 Thread Kyle Sluder
On Fri, Mar 13, 2009 at 1:30 PM, Paul Sanders wrote: > That's very interesting, I didn't know that attribute existed.  I imagine > that post-dates autorelease pools by some years. It's a relatively new GCC-ism. > But most objects returned > by framework functions are autoreleased which means you

Re: NSTextFieldCell text color issue in NSTableView with source list highlighting

2009-03-13 Thread Kyle Sluder
On Fri, Mar 13, 2009 at 1:34 PM, Corbin Dunn wrote: > Either solution is perfectly acceptable, and we'll increase our > documentation to help developers understand the process of displaying cells. How about instead of changing the object value to an attributed string the framework instead changes

Re: NSTextFieldCell text color issue in NSTableView with source list highlighting

2009-03-13 Thread Corbin Dunn
On Mar 13, 2009, at 10:43 AM, Kyle Sluder wrote: On Fri, Mar 13, 2009 at 1:34 PM, Corbin Dunn wrote: Either solution is perfectly acceptable, and we'll increase our documentation to help developers understand the process of displaying cells. How about instead of changing the object value

Re: Performance problem with GC enabled

2009-03-13 Thread Paul Sanders
> Without any sort of management, you'd leak memory like > crazy in situations where neither the caller or the callee can release > the object. A scheme where it is always the caller's job to release any object returned to it is perfectly viable, as any number of other computing platforms (such

Re: Singleton Help ...

2009-03-13 Thread Shawn Erickson
On Fri, Mar 13, 2009 at 3:51 AM, Mike Abdullah wrote: > By definition, if it's a singleton, it will exist for the lifetime of the > program; there is no risk of the notification centre sending messages to a > now non-existent object. As a smallish nit... "singleton" nominally implies that only on

Re: Binding to selection of NSArrayController manually

2009-03-13 Thread Stuart Malin
On Mar 13, 2009, at 9:42 AM, Ivy Feraco wrote: I have an NSArrayController subclass and an NSPopUpButton subclass. I am trying to bind the NSPopUpButton's selected object to the selection of my array controller. I have to do this manually for reasons I won't get into here. But when I do this (

Re: Binding to selection of NSArrayController manually

2009-03-13 Thread Ivy Feraco
Yes thanks I did something like this. I realize now that "selection" is just a getter method on NSObjectController so no sense binding to it without a keypath. Ivy Feraco UI Developer i...@boxstudios.com On Mar 13, 2009, at 2:34 PM, Stuart Malin wrote: On Mar 13, 2009, at 9:42 AM, Ivy Fer

Re: TXT Records with NSImages

2009-03-13 Thread Joe Turner
That's what I thought too. But how do you use the NULL record? Joe On Mar 13, 2009, at 7:36 AM, Keith Duncan wrote: Joe, That's a lot of data to be storing in the TXT record. I'd advise that you store it in the NULL record as iChat does for 'Bonjour' chat. Keith _

Re: Handling errors in -initWithCoder:

2009-03-13 Thread Sean McBride
On 3/13/09 3:05 PM, Graham Cox said: >One of my classes can sometimes fail in -initWithCoder: - it relies on >certain resources being available and if it doesn't get them, I >thought I could follow the same pattern as -init and autorelease self >and return nil. Actually, I don't think that's the

Re: NSManagedObject validateForDelete problem

2009-03-13 Thread Jerry Krinock
On 2009 Mar 13, at 01:44, Ben Trumbull wrote: -validateForDelete: is ... not intended to double as -canDelete or - isDeleteable. When I first started using Core Data I had the mistaken impression that the various -[NSManagedObject validate] methods were hooks into which I could place

iPhone color management?

2009-03-13 Thread William Jon Shipley
When we put PNG resources in our iPhone apps, what color space are they displayed under? I know PNGs are re-processed by Xcode (into illegal, but more- efficient, iPhone PNGs), are the color profiles embedded in PNGs used either at the re-processing time or at the time of drawing? As far a

setDataSource

2009-03-13 Thread David Blanton
Is it true that reloadData is synchronous while setDataSource (which makes a reload happen) is asynchronous ? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the mo

Re: setDataSource

2009-03-13 Thread Corbin Dunn
On Mar 13, 2009, at 3:14 PM, David Blanton wrote: Is it true that reloadData is synchronous while setDataSource (which makes a reload happen) is asynchronous ? What class are you referring to? NSTableView? All are synchronous, none are asynchronous. Tiling/redrawing is all lazily done.

NSProgressIndicator's setUsesThreadedAnimation only works sometimes?

2009-03-13 Thread Sean McBride
Hi all, I'm trying to make a cheap, modal, indeterminate progress dialog, but I'm having trouble animating the progress bar. (Yes, I know this is only slightly better than the spinning wheel of death. Yes, I know I should thread my long running code. Yes, I know I should not block the main thre

Re: NSProgressIndicator's setUsesThreadedAnimation only works sometimes?

2009-03-13 Thread Rob Ross
No, none at all. The main AppKit thread is the thread that will be repainting your progress bar. If it's blocked, it can't paint the new state of your progress bar. Rob On Mar 13, 2009, at 3:20 PM, Sean McBride wrote: Hi all, I'm trying to make a cheap, modal, indeterminate progress dial

Re: NSProgressIndicator's setUsesThreadedAnimation only works sometimes?

2009-03-13 Thread Sean McBride
Rob, Thanks for your reply. But what you say can't be so. As I said, sometimes my 'hint' is accepted and the progress bar animates, and I am definitely blocking the main thread with my own code at the same time. But it only works sometimes, and I'm looking to make it work all the time. But the

Re: NSProgressIndicator's setUsesThreadedAnimation only works sometimes?

2009-03-13 Thread Rob Ross
Your question was if there was a reliable way of doing it, and as you have experienced, that's the best you can hope to achieve without using a separate thread. Rob On Mar 13, 2009, at 3:29 PM, Sean McBride wrote: Rob, Thanks for your reply. But what you say can't be so. As I said, some

kvc/kvo for arrays defeated me.

2009-03-13 Thread Darren Minifie
Hi Everyone. I'm hoping to get a little help when it comes to binding a table to an array through an array controller. The table is loading the proper values which leads me to believe that my getter is working, but when i try to edit a value, I receive a runtime error. I've found good posts on h

Re: NSProgressIndicator's setUsesThreadedAnimation only works sometimes?

2009-03-13 Thread Aki Inoue
Sean, AppKit is using -[NSApplication updateWindows] for some of animation thread synchronization tasks. If you experience animation not properly starting up with blocking operations, you can kick start the animation by calling the method before going into the operation. Aki Rob, Thank

Using NSPersistentDocument without NSApp. OK?

2009-03-13 Thread Jerry Krinock
I've working on a background helper, created Xcode as a Foundation tool. It can open, edit and save Core Data NSPersistentDocuments created by my main app. It seems to work. I know from the Core Data Utility Tutorial (formerly called "Low Level") that Core Data without NSApp is OK. What

Re: Performance problem with GC enabled

2009-03-13 Thread John Engelhart
On Thu, Mar 12, 2009 at 3:17 PM, Peter Ammon wrote: > > Hi John, > > Instead of storing each string individually into the heap, try batching up, > say, 1k or so into a stack allocated buffer.  Then use > objc_memmove_collectable() to move them in bulk into the heap at the point > your stack alloca

sending rich text emails using Scripting Bridge and Mail

2009-03-13 Thread Reza Farhad
I have downloaded the Cocoa example which uses Scripting Bridge to send emails. I wanted to know is it possible to use that system to send rich text emails. That is, is there a way to get the Mail App to recognize AttributedString instead of just plain string. Thanks in advance Reza

RE: UIPickerView Caching Items

2009-03-13 Thread James Heggs
To everyone that has read this post - I am a stupid programmer and there is no caching. I wasn't changing my service object with the new name! Useless - my apologies!! Eggsy _ All your Twitter and other social updates in one plac

Re: EXC_BAD_ACCESS on NSImageView::setImage

2009-03-13 Thread Dev
On Wed, Mar 11, 2009 at 9:33 AM, Scott Ribe wrote: > Does your setImage method retain the image? > The object ExternalView is a NSImageView so the setImage is the one of NSImageView. The doc says nothing about it, but i added some debug log like this : NSLog(@"BEFORE : %d",

Re: Performance problem with GC enabled

2009-03-13 Thread Peter Ammon
On Mar 13, 2009, at 4:47 PM, John Engelhart wrote: On Thu, Mar 12, 2009 at 3:17 PM, Peter Ammon wrote: Hi John, Instead of storing each string individually into the heap, try batching up, say, 1k or so into a stack allocated buffer. Then use objc_memmove_collectable() to move them in bu

Re: TXT Records with NSImages

2009-03-13 Thread Keith Duncan
Joe, You'll need to drop below NSNetService and CFNetService to manipulate the NULL record data. Take a look at the API in dns_sd.h for the functions you need. Like a TXT record, a NULL record has a limit of 65535 bytes but unlike the TXT record it isn't segmented. Here's some sample code

Re: Performance problem with GC enabled

2009-03-13 Thread John Engelhart
On Fri, Mar 13, 2009 at 5:28 AM, Paul Sanders wrote: > Bill said something in passing on this issue which I think is important.  To > paraphrase: If you care about performance, don't use the Cocoa RegEx stuff > to parse large amounts of data. I disagree :), and I have numbers to back it up: (Reg

Re: kvc/kvo for arrays defeated me.

2009-03-13 Thread Quincey Morris
On Mar 13, 2009, at 15:34, Darren Minifie wrote: === Interface file: === @interface PerceptionController : NSWindowController { NSMutableArray* dpcm2; } @property(nonatomic, retain) NSMutableArray* dpcm2; -(void)insertObject:(id)num inDpcm2AtIndex:(unsigned)index; -(void)removeObjectFromDp

Releasing objects in Scripting Bridge

2009-03-13 Thread Reza Farhad
Exploring the example of sending emails using Scripting Bridge, I see that objects are allocated but not released: MailOutgoingMessage *emailMessage = [[[mail classForScriptingClass:@"outgoing message"] alloc] initWithProperties: [NSDictionary dictionaryWithObjectsAndKeys:@"test

Re: kvc/kvo for arrays defeated me.

2009-03-13 Thread Kyle Sluder
On Fri, Mar 13, 2009 at 9:00 PM, Quincey Morris wrote: > The problem here is that your table column must be bound to a property of > the class of the objects in the array. (That is, you specified > 'arrangedObjects' for the controller key path of the column binding, but you > specified nothing for

Re: kvc/kvo for arrays defeated me.

2009-03-13 Thread Quincey Morris
On Mar 13, 2009, at 18:00, Quincey Morris wrote: When you edit a specific row of your table column, the value you type in is set as the new value of the corresponding MySomething object. Oops, that should read: ... as the new value of the corresponding MySomething object property.

NSTask and setuid

2009-03-13 Thread Mudi Dandan
Hi All, I'm developing a setuid tool for my application and seems that NSTask doesn't respect the setuid bit and the effective uid remains 501. However when launching the tool from the terminal the effective uid is 0 as expected. What am i missing? Mudi __

Re: kvc/kvo for arrays defeated me.

2009-03-13 Thread Quincey Morris
On Mar 13, 2009, at 18:20, Kyle Sluder wrote: On Fri, Mar 13, 2009 at 9:00 PM, Quincey Morris wrote: The problem here is that your table column must be bound to a property of the class of the objects in the array. (That is, you specified 'arrangedObjects' for the controller key path of the c

Re: kvc/kvo for arrays defeated me.

2009-03-13 Thread Kyle Sluder
On Fri, Mar 13, 2009 at 9:36 PM, Quincey Morris wrote: > Or am I missing your point? No, you're not. I always bind it explicitly because I know I'll forget if my column bindings aren't all bound to keypaths off the same controller property. It's also not documented that the table view automagic

Re: kvc/kvo for arrays defeated me.

2009-03-13 Thread Darren Minifie
thank you guys so much! That makes perfect sense (now), and I'm glad I only wasted most of the day. I do think that programming guide on bindings could be improved or elaborated on a little bit. Kyle what do you mean by binding the table view's content property? I understand what you mean, but

Re: Performance problem with GC enabled

2009-03-13 Thread John Engelhart
On Fri, Mar 13, 2009 at 4:38 AM, Marcel Weiher wrote: > > On Mar 12, 2009, at 10:54 AM, Bill Bumgarner wrote: >> >> In the context of an application, such processing is likely to be on a >> secondary thread and there is likely to be synchronization of data between >> threads. >>  The overhead of t

Calling Script Objects in Applescript

2009-03-13 Thread Karen van Eck
We have a lot of code in libraries in Applescript. Now starting to look at using Cocoa to move forward, as we are really using Applescript to pretty much its limit. But it is not a short term solution to rewrite all our Applescript libraries in Objective-C. We need to be able to use Objecti

Re: kvc/kvo for arrays defeated me.

2009-03-13 Thread Kyle Sluder
On Fri, Mar 13, 2009 at 10:04 PM, Darren Minifie wrote: > Kyle what do you mean by binding > the table view's content property?  I understand what you mean, but I'm > unsure of what I should bind it to.  The array controller's array?  or the > tableView's dataSource? Well I assume you're not usin

Re: Performance problem with GC enabled

2009-03-13 Thread John Engelhart
On Fri, Mar 13, 2009 at 8:26 PM, Peter Ammon wrote: > > On Mar 13, 2009, at 4:47 PM, John Engelhart wrote: > >> On Thu, Mar 12, 2009 at 3:17 PM, Peter Ammon wrote: >>> >>> Hi John, >>> >>> Instead of storing each string individually into the heap, try batching >>> up, >>> say, 1k or so into a sta

Re: NSTask and setuid [SOLVED]

2009-03-13 Thread Mudi Dandan
It turned out that I set the setuid bit on different file from the one I launched with NSTask. This took me about 3 hours to realize, sorry :) On Mar 14, 2009, at 2:24 AM, Mudi Dandan wrote: Hi All, I'm developing a setuid tool for my application and seems that NSTask doesn't respect the

Re: Re: kvc/kvo for arrays defeated me.

2009-03-13 Thread minofifa
Oh ok I understand. Thanks! I have one last question about this stuff. In the attributes panel for an array controller, there is a field called Object Controller Class Name. The tool tip says to set this to the class that will serve to add new objects to the controller's managed array. This

Re: Performance problem with GC enabled

2009-03-13 Thread Peter Ammon
On Mar 13, 2009, at 7:59 PM, John Engelhart wrote: On Fri, Mar 13, 2009 at 8:26 PM, Peter Ammon wrote: http://c-faq.com/malloc/alloca.html for a rough idea why) The goal is for the compiler to not use individual write barriers at all, and it won't for stack allocated buffers. So my sugg

Re: Performance problem with GC enabled

2009-03-13 Thread Michael Ash
On Fri, Mar 13, 2009 at 2:03 PM, Paul Sanders wrote: >> Without any sort of management, you'd leak memory like >> crazy in situations where neither the caller or the callee can release >> the object. > > A scheme where it is always the caller's job to release any object returned > to it is perfect

Type Declaration With Protocol

2009-03-13 Thread Richard Somers
The Objective-C 2.0 Programming Language documentation indicates that a type declaration for an object including a formal protocol should look something like this. id anObject; I have been studying some sample code that does it like this. NSObject *anObject; What is the differenc

Re: Type Declaration With Protocol

2009-03-13 Thread Roland King
well the first one just says that anObject supports the protocol and it tells you NOTHING else about it at all. So the only methods you can call on it without having the compiler warn you that they may not exist (and they may not exist) are methods. Seems fine until you actually try it in

Customizing an NSToolbar to wrap it's tools.

2009-03-13 Thread Ken Tozier
Hi I would like to customize an NSToolbar to make it's tools wrap rather than overflow, but I can't see any way to control the toolbar height. Is there some way to do this? I've had a lot of practice writing wrapping views but NSToolbar seems to be locked up pretty tight as far as how it