Plugin Information

2008-04-14 Thread Rick Langschultz
Hello everyone, My application uses plugins from a support folder in /Library/ Application Support/AppName/Plugins/. The application searches this folder for all the plugins and loads them. But here is my dilemma: i want to put the plugin class name as the bundle identifier so that i can

Re: Accessing Directory.app shared contacts

2008-04-14 Thread Kyle Sluder
On Sat, Apr 12, 2008 at 11:02 AM, Tito Ciuro [EMAIL PROTECTED] wrote: The data is stored in the OpenDirectory respository. Shared Contacts are stored under 'People'. You'll probably need to use the Directory Services API to manipulate the data. That's what I feared. Unfortunately the schema

Re: Plugin Information

2008-04-14 Thread Kyle Sluder
On Mon, Apr 14, 2008 at 2:30 AM, Rick Langschultz [EMAIL PROTECTED] wrote: My code uses NSString *bundlePath, and NSBundle *bundle. I want to have something like *bundlePathA, *bundlePathB, etc; and *bundleA, *bundleB, *bundleC. Is there a simple way that I can do this? What exactly are you

Re: Plugin Information

2008-04-14 Thread Uli Kusterer
Am 14.04.2008 um 08:30 schrieb Rick Langschultz: My application uses plugins from a support folder in /Library/ Application Support/AppName/Plugins/. The application searches this folder for all the plugins and loads them. But here is my dilemma: i want to put the plugin class name as the

RE: A question about Tabviews and tabview items

2008-04-14 Thread Francisco Tolmasky
Take a look at drawLabel:inRect and sizeOfLabel: in NSTabViewItem If however, you want do something more complex, consider putting the tabview in borderless mode, making your own UI around it, and just calling selectTabViewItem: appropriately. Francisco

Re: Window moved when dock appears.

2008-04-14 Thread Uli Kusterer
Am 13.04.2008 um 19:56 schrieb Mohsan Khan: I have a window (NSBorderlessWindowMask), this window gets pushed away when my Dock appears from being hidden. How can I bypass this behaviour for my window? I think you should override: - (NSRect)constrainFrameRect:(NSRect)frameRect

Re: Window moved when dock appears.

2008-04-14 Thread Kyle Sluder
On Sun, Apr 13, 2008 at 1:56 PM, Mohsan Khan [EMAIL PROTECTED] wrote: How can I bypass this behaviour for my window? First, unless your window does not need to be clickable or visible at all, don't do this. Pro Tools doesn't move when the dock pref is changed, and it annoys the hell out of me,

Re: Cocoa-dev Digest, Vol 5, Issue 604

2008-04-14 Thread Julian James
Hi, Sounds good to me if it means I save money! How does it work when I go on holiday, as I will in May for 2 weeks or when I'm between contracts and have no income? Julian On Monday, April 14, 2008, at 10:01AM, [EMAIL PROTECTED] wrote: Send Cocoa-dev mailing list submissions to

Re: Accessing Directory.app shared contacts

2008-04-14 Thread Alexander Hartner
You could always use ABxLDAP (http://www.addressbookserver.com) to transfer contacts from you standard OS X Address Book to an LDAP directory. It uses the iSync API and runs in the back-ground. Have fun Alex On Sat, Apr 12, 2008 at 11:02 AM, Tito Ciuro [EMAIL PROTECTED] wrote: The data is

NSTableView memory usage

2008-04-14 Thread Valentin Dan
Hi, I have a NSTableView object with 3 columns and an average of 30 characters per cell. At 1500 rows, “ps –A -u” reports it uses 39.0% memory (there is 1GB of memory on this Mac). After the panel containing the NSTableView is closed, the app uses 1.8% (just as before opening it). The

ld: total output size exceeds 2GB (2033MB)

2008-04-14 Thread younker yang
Hi, All, This is my first post on this mailing list, I checked out cogx from SVN, and change the project settings to be xcode 3.1 compatible, but when I build the WMA.framework, I got the following error, It seems there is some error on link configuration. Can anyone help me to solve this

Re: ld: total output size exceeds 2GB (2033MB)

2008-04-14 Thread Alastair Houghton
On 14 Apr 2008, at 20:35, younker yang wrote: This is my first post on this mailing list, I checked out cogx from SVN, and change the project settings to be xcode 3.1 compatible, but when I build the WMA.framework, I got the following error, It seems there is some error on link

To write to a file

2008-04-14 Thread Nick Rogers
Hi, I have to write some data to file in sequence. what methods can I use? NSFileManager has method for creating a file but not for writing to file. Thanks, Nick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Why should we set ivars to nil in dealloc?

2008-04-14 Thread Tony Becker
OK. My $0.02 To answer the original question... We live in an Object world, where we like to re-use things. So, for example, I have an object hierarchy of view controllers. In -awakeFromNib:, I use a instantiate and use a iVar. In dealloc, I release it. However, under

hooking into another app

2008-04-14 Thread Don Arnel
Hi all, I've only been developing using Xcode for about 5 weeks now (long-time Windows programmer). I am attempting to write a Cocoa app that I would like to have hook into a text chat window from another app so that I can log the incoming messages. The other app does not belong to my app.

mouseMoved: behaving correctly when application isn't frontmost

2008-04-14 Thread Mattias Arrelid
Hi all, Our application it setup to forward all mouse moved events to our content view, regardless if our application is the frontmost one. Now, we have some areas of the content view that are to be highlighted when the mouse hovers over them. This works ok (with work, I mean it looks acceptable)

warning: Image scaling is not supported on Mac OS X versions prior to 10.5.

2008-04-14 Thread yang younker
Hi, All, I had made a simple login dialog by interface builder, but when I built this xib file in xcode, I got the following errors CompileXIB /Users/younker/Developer/Example1/English.lproj/MainMenu.xib cd /Users/younker/Developer/Example1 /Developer/usr/bin/ibtool --errors --warnings

Re: hooking into another app

2008-04-14 Thread Thomas Davie
Someone may correct me if I'm wrong, but that sounds a lot like something that has been very very deliberately left out of any API... I want to write an app that I'd like to have hook into a text box in Safari and log your IDs, passwords, and bank account status. Thanks Bob On 14 Apr

loading the universal bundle

2008-04-14 Thread anoop.varughese
Hi All, I need to run the Automator action Ask for Photos from System/Library/Automator/Ask for Photos.action on Mac OSX.4 Tiger.I did not find much supporting document using Objective-c. I added following codes for running the action. NSDictionary *dict=[NSDictionary infoDictionary];

Re: A question about Tabviews and tabview items

2008-04-14 Thread Development
You and one other both made this suggestion to me and examining it, it is certainly the easiest and most logical way to go. Which is probably why it did not occur to me. Thank you very much for your suggestion, I think this is the approach I will use. On Apr 13, 2008, at 9:26 PM, Sean

Re: A question about Tabviews and tabview items

2008-04-14 Thread Development
Thank you very much for the suggestion. This looks to me to be the best approach to use so I will forgo the very complex subclassing of NSTabView I had begun in favor of this. On Apr 14, 2008, at 1:49 AM, Francisco Tolmasky wrote: Take a look at drawLabel:inRect and sizeOfLabel: in

Re: hooking into another app

2008-04-14 Thread I. Savant
On Mon, Apr 14, 2008 at 10:00 AM, Thomas Davie [EMAIL PROTECTED] wrote: Someone may correct me if I'm wrong, but that sounds a lot like something that has been very very deliberately left out of any API... See the many discussions regarding input managers. I want to write an app that I'd

Re: hooking into another app

2008-04-14 Thread I. Savant
I want to write an app that I'd like to have hook into a text box in Safari and log your IDs, passwords, and bank account status. Well, password fields are special and are 'resistant' to key logging, but you don't have to 'hook into' any apps to log the rest. You don't even need an

[job posting] Senior OSX C++ Developer for Contract

2008-04-14 Thread Paul Wilkinson
Soma Engineering is looking to hire a seasoned OSX engineer on contract basis. The project involves porting a middleware audio product from Windows to OSX. The product is an audio system for video games. Required qualifications are (1) At least 5 years C++ professional development experience; (2)

Re: hooking into another app

2008-04-14 Thread Don Arnel
No...no...NO! Re-read my message. If it was unclear, what I want to do is be able to log (record) text being written to a chat window from another app. NOT log key strokes. For example, how could I progmatically record an AIM chat conversation from my app? On Apr 14, 2008, at 10:00 AM,

Re: Menu items vs modal sessions

2008-04-14 Thread Pierre Bernard
Thanks for the insights Keary. I did indeed expect to get some of the behavior for free, but didn't. This is probably due to the fact that I am using bindings to bind menu items to controller actions. I guess one gets the free behavior only when using target/action connections on the first

Re: hooking into another app

2008-04-14 Thread I. Savant
On Mon, Apr 14, 2008 at 10:26 AM, Don Arnel [EMAIL PROTECTED] wrote: No...no...NO! Alright. Now how about we take a few deep breaths, switch to decaf, and try our social interaction again. This time without the attitude, please. Re-read my message. If it was unclear, what I want to do is be

Re: hooking into another app

2008-04-14 Thread Keary Suska
on 4/14/08 8:26 AM, [EMAIL PROTECTED] purportedly said: Re-read my message. If it was unclear, what I want to do is be able to log (record) text being written to a chat window from another app. NOT log key strokes. For example, how could I progmatically record an AIM chat conversation from

Re: HUD-style panel controls?

2008-04-14 Thread douglas a. welton
Jacob, You may want to look at applying one or more of the numerous filters available to you when you make your controls layer backed. I did this with most of the controls in my HUD for an image editing application and it works just fine. Color Monochrome is your friend! Using filters

Re: hooking into another app

2008-04-14 Thread Florian Soenens
Maybe if the log is written to a file, you can read in that file. But that won't be real-time logging of course. Regards, Flor. On 14 Apr 2008, at 16:49, Keary Suska wrote: on 4/14/08 8:26 AM, [EMAIL PROTECTED] purportedly said: Re-read my message. If it was unclear, what I want to do is be

Re: Why should we set ivars to nil in dealloc?

2008-04-14 Thread j o a r
On Apr 14, 2008, at 5:29 AM, Tony Becker wrote: In -awakeFromNib:, I use a instantiate and use a iVar. In dealloc, I release it. However, under the covers, I DON'T call [super -awakeFrommNib:], because my parent didn't awake from his .nib. But, in dealloc, I call [super dealloc], so my

Re: NSMatrix Content Binding

2008-04-14 Thread Keary Suska
on 4/13/08 8:57 PM, [EMAIL PROTECTED] purportedly said: I have a matrix of radio buttons that I'm trying to bind-ify. The two options in the matrix should shown with the titles: Mac OS Extended Mac OS Extended Journaled The *values* of these two items should be: HFS+ Journaled HFS+

Re: Menu items vs modal sessions

2008-04-14 Thread Kyle Sluder
On Mon, Apr 14, 2008 at 10:28 AM, Pierre Bernard [EMAIL PROTECTED] wrote: This is probably due to the fact that I am using bindings to bind menu items to controller actions. I guess one gets the free behavior only when using target/action connections on the first responder. Just for kicks,

Re: NSTableView memory usage

2008-04-14 Thread j o a r
On Apr 14, 2008, at 3:15 AM, Valentin Dan wrote: At 1500 rows, “ps –A -u” reports it uses 39.0% memory (there is 1GB of memory on this Mac). After the panel containing the NSTableView is closed, the app uses 1.8% (just as before opening it). The panel in question doesn’t have anything

Re: NSMatrix Content Binding

2008-04-14 Thread Keary Suska
on 4/13/08 8:57 PM, [EMAIL PROTECTED] purportedly said: I have a matrix of radio buttons that I'm trying to bind-ify. The two options in the matrix should shown with the titles: Mac OS Extended Mac OS Extended Journaled The *values* of these two items should be: HFS+ Journaled HFS+

Re: Using Properties at Outlets

2008-04-14 Thread Randall Meadows
On Apr 13, 2008, at 10:46 PM, Steve Sheets wrote: Has anyone had any problems with creating Properties with Objective- C 2.0 that are also Outlets? I been using this inside my code, and I want to be sure there is no problems with this. I create fairly standard (readonly) and (readwrite,

Re: warning: Image scaling is not supported on Mac OS X versions prior to 10.5.

2008-04-14 Thread Nathan Vander Wilt
On Apr 14, 2008, at 6:12 AM, yang younker wrote: /* com.apple.ibtool.document.notices */ /* com.apple.ibtool.document.warnings */ /Users/younker/Developer/Example1/English.lproj/MainMenu.xib:460: warning: Image scaling is not supported on Mac OS X versions prior to 10.5.

Re: EXC_BAD_ACCESS when calling CGContextDrawLayerInRect

2008-04-14 Thread Nathan Vander Wilt
On Apr 13, 2008, at 7:15 AM, Carter R. Harrison wrote: CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; CGContextDrawLayerInRect(context, CGRectMake([self frame].origin.x, [self frame].origin.y, [self frame].size.width, [self frame].size.height), cgback); cgback

Re: NSTableView memory usage

2008-04-14 Thread John Stiles
I think Instruments could do a better job of telling you what's going wrong than we could. FWIW, the table view doesn't even know the contents of most of your 1500 rows. It asks for them from the data source as it needs them, and probably only knows the values of the currently visible cells.

Re: hooking into another app

2008-04-14 Thread Christopher Nebel
On Apr 14, 2008, at 8:24 AM, Oliver Quas wrote: Am 14.04.2008 um 16:58 schrieb Florian Soenens: on 4/14/08 8:26 AM, [EMAIL PROTECTED] purportedly said: Re-read my message. If it was unclear, what I want to do is be able to log (record) text being written to a chat window from another

Re: hooking into another app

2008-04-14 Thread Don Arnel
Sorry if that came across as having attitude, but I was a little miffed at being accused of having intentions to steal passwords or account information by writing a key logger. Anyway, thanks for giving me a starting point to research. - Don On Apr 14, 2008, at 10:40 AM, I. Savant wrote:

Re: NSDateFormatter giving different results in different programs

2008-04-14 Thread Nick Zitzmann
On Apr 13, 2008, at 11:21 PM, Derrick Bass wrote: In one program that links to this framework, the date is getting parsed correctly. But in another, the very same string is coming back as 1969-12-31 16:00:00 -0800! Using - [getObjectValue:forString:range:error:] gives the same results

Re: hooking into another app

2008-04-14 Thread Chilton Webb
Hi Don, On Monday, April 14, 2008, at 09:27AM, Don Arnel [EMAIL PROTECTED] wrote: No...no...NO! Re-read my message. If it was unclear, what I want to do is be able to log (record) text being written to a chat window from another app. NOT log key strokes. For example, how could I

Re: hooking into another app

2008-04-14 Thread Alastair Houghton
On 14 Apr 2008, at 18:01, Chilton Webb wrote: On the topic of Input Managers, it would be fine with me if Apple did away with this blatant security hole altogether. I can think of zero real reasons to have it around still, which couldn't be addressed via more secure means, or by the

Re: hooking into another app

2008-04-14 Thread I. Savant
On Mon, Apr 14, 2008 at 12:56 PM, Don Arnel [EMAIL PROTECTED] wrote: Sorry if that came across as having attitude, but I was a little miffed at being accused of having intentions to steal passwords or account information by writing a key logger. I see no 'accusation' in this thread. Chill

Re: Subclassing NSScroller

2008-04-14 Thread Jonathan Dann
On 14 Apr 2008, at 02:12, Chris Hanson wrote: On Apr 13, 2008, at 3:13 PM, [EMAIL PROTECTED] wrote: I believe this is a typo in the documentation. The method you want to override is actually spelled -drawArrow:highlightParts: In http://www.cocoabuilder.com/archive/message/cocoa/

Re: hooking into another app

2008-04-14 Thread I. Savant
They are in the process of doing just that, I think you'll find. It's just that, rather than removing them instantly, they've been deprecated and replaced with an alternative and more secure mechanism (Input Servers, if I remember rightly). In some future version of Mac OS X, I think you

Forced Refreshing of WebKit

2008-04-14 Thread KJ Walker
I have a product that uses a WebView to display HTML to the user. At times, due to activities spawned along with updating the HTML data to the WebView, response times can be a few seconds. It would be a better user experience to see the updated view displayed before other activities are

Re: EXC_BAD_ACCESS when calling CGContextDrawLayerInRect

2008-04-14 Thread Carter R. Harrison
cgback is a CGLayerRef instance variable that I setup when the view is inited. I use the following line: cgback = CGLayerCreateWithContext(context, CGSizeMake([self bounds].size.width, [self bounds].size.height), NULL); It's my understanding that I do not need to retain cgback with

Re: NSCompositeSourceOver equivalent in Quartz 2D?

2008-04-14 Thread David Duncan
On Apr 13, 2008, at 1:43 PM, Carter R. Harrison wrote: I'm trying to do some drawing in Quartz 2D. I'm trying to set the blending mode of my CGContextRef to the equivalent of NSCompositeSourceOver from NSGraphicsContext. It doesn't look like there is such a blending mode for a CGContext.

Re: Basic Core Animation question

2008-04-14 Thread David Duncan
On Apr 13, 2008, at 12:01 AM, Greg Sabo wrote: Ah! It compiled. Thank you very much! And thanks to Michael for putting together the sample project. Now to get the CALayer to draw a path. Most of the documentation I've seen suggest to do this with a delegate function, is that correct? Here

Re: hooking into another app

2008-04-14 Thread Scott Ribe
Sorry if that came across as having attitude, but I was a little miffed at being accused of having intentions to steal passwords or account information by writing a key logger. Nobody was accusing *you* of wanting to do that, just pointing out that you were asking for an OS feature which would

Re: EXC_BAD_ACCESS when calling CGContextDrawLayerInRect

2008-04-14 Thread David Duncan
On Apr 14, 2008, at 11:56 AM, Carter R. Harrison wrote: cgback is a CGLayerRef instance variable that I setup when the view is inited. I use the following line: cgback = CGLayerCreateWithContext(context, CGSizeMake([self bounds].size.width, [self bounds].size.height), NULL); It's my

Re: EXC_BAD_ACCESS when calling CGContextDrawLayerInRect

2008-04-14 Thread Carter R. Harrison
Hi David, I'm getting the reference to the context by using: CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort]; in my view's initWithFrame: method. Based upon what you said, how would you recommend I draw to a CGLayer prior to the first invocation of drawRect:

Re: NSString value mangled in NSDictionary with Garbage Collection

2008-04-14 Thread Mike R. Manzano
Can we see the rest of the code that is currently represented as comments in your example? On Apr 10, 2008, at 3:44 AM, Jason Kravitz wrote: I created a while loop where I am reading through a text file and pulling out certain words based on RegEx criteria. I want to add these words as a

Re: how should I go about downloading files

2008-04-14 Thread Laimonas Simutis
On Fri, Apr 11, 2008 at 6:01 PM, Scott Anguish [EMAIL PROTECTED] wrote: On Apr 10, 2008, at 9:04 PM, Laimonas Simutis wrote: Hey, This is my first cocoa projects so I am kind of finding my way around the framework. The question I have is maybe more related to the design practices

Re: how should I go about downloading files

2008-04-14 Thread John Stiles
Laimonas Simutis wrote: On Fri, Apr 11, 2008 at 6:01 PM, Scott Anguish [EMAIL PROTECTED] wrote: On Apr 10, 2008, at 9:04 PM, Laimonas Simutis wrote: Hey, This is my first cocoa projects so I am kind of finding my way around the framework. The question I have is maybe more related to

Re: hooking into another app

2008-04-14 Thread Kyle Sluder
On Mon, Apr 14, 2008 at 5:12 PM, Don Arnel [EMAIL PROTECTED] wrote: I've only been working with a Mac running Leopard now for about 5 weeks and am not familiar with AppleScript or the Script Editor. I ran the Script Editor and dragged the iChat.app (since you said that app had lots of

Re: hooking into another app

2008-04-14 Thread Bill Cheeseman
on 2008-04-14 8:30 AM, Don Arnel at [EMAIL PROTECTED] wrote: I am attempting to write a Cocoa app that I would like to have hook into a text chat window from another app so that I can log the incoming messages. The other app does not belong to my app. If anyone could point me to some help

NSMenuItem view bug with status bar menu

2008-04-14 Thread Kimo
I believe I have found a bug with a menu item view when used in the status bar menu. Here's how to recreate the bug. Assume the app MyApp is active and has a status bar menu, and one of the menu items has a view: 1. Bring another app to the front (such as Safari), and access the MyApp

Re: Window moved when dock appears.

2008-04-14 Thread Mohsan Khan
Thanks, this does the trick! - (void)setFrame: (NSRect)frameRect display: (BOOL)flag { #pragma unused( frameRect, flag ) [super setFrame: myRect display: YES]; } On må 14 apr 2008, at 05.00, Seth Willits wrote: On Apr 13, 2008, at 10:56 AM, Mohsan

Memory leak when re-alloc Methods

2008-04-14 Thread marioegt
Hi and sorry for my bad english. I have a nasty leak problem when i realloc several methods of the main class of my app. I have a button that initiate a series of methods of my Main Model Class for initialize and display sprites. In a NSView, when i alloc the class for the first time every

Re: NSMatrix Content Binding

2008-04-14 Thread Seth Willits
On Apr 14, 2008, at 8:07 AM, Keary Suska wrote: Is there a way to do what I want to do? If changing your array to an array of dictionaries is not acceptable, you could use a custom NSValueTransformer. An array of dictionaries wouldn't work though. Since it'd use the entire dictionary

Re: hooking into another app

2008-04-14 Thread Don Arnel
Thank you, Bill This is exactly what I was looking for! On Apr 14, 2008, at 5:39 PM, Bill Cheeseman wrote: Use the Accessibility API. It's designed to do exactly this. It's a C API, not Cocoa or Objective-C, but you can use it in a Cocoa application.

Forced Refreshing of WebKit

2008-04-14 Thread John Joyce
On Apr 14, 2008, at 2:02 PM, [EMAIL PROTECTED] wrote: Forced Refreshing of WebKit To force refresh a WebKit view, do the same thing web developers do: JavaScript...? or - reload: example from webview docs: - (IBAction)reload:(id)sender ___

Re: Basic Core Animation question

2008-04-14 Thread Greg Sabo
Thanks for the tip, I've made that function simpler (displaying a red circle): - (void)drawLayer:(CALayer *)theLayer inContext:(CGContextRef)theContext { CGRect theRect = CGRectMake(0.5, 0.5, 1, 1); CGContextSetRGBFillColor(theContext, 1, 0, 1, 1);

Re: Basic Core Animation question

2008-04-14 Thread Greg Sabo
I think I'm doing those things, see below: //Setting object as delegate for CALayer - (id) initWithFrame:(NSRect) frame { if (self = [super initWithFrame: frame]) { animateLayer = [CALayer layer]; [animateLayer setDelegate:self]; } return self; } //drawing the view

Re: hooking into another app

2008-04-14 Thread Matt Burnett
The OS is all ready wide open to this sort of attack. Criticizing the OP for asking for this feature illustrates the false sense of security Mac users have simply because there isnt a spyware problem... yet. Apple allows you to hook IOHIKeyboard's _keyboardEventTarget. On Apr 14, 2008, at

Re: hooking into another app

2008-04-14 Thread I. Savant
On Apr 14, 2008, at 8:27 PM, Matt Burnett wrote: The OS is all ready wide open to this sort of attack. Criticizing the OP for asking for this feature illustrates the false sense of security Mac users have simply because there isnt a spyware problem... yet. Apple allows you to hook

Cannot Remove Observer Error

2008-04-14 Thread Thaddeus Cooper
Starting earlier today, I started getting the following error in my software. 2008-04-14 17:59:41.535 WineCellar[4928:10b] Cannot remove an observer WineArrayController 0x25a450 for the key path wineType.name from Wine 0x6c55170, most likely because the value for the key wineType has

Re: warning: Image scaling is not supported on Mac OS X versions prior to 10.5.

2008-04-14 Thread Markus Spoettl
On Apr 14, 2008, at 9:09 AM, Nathan Vander Wilt wrote: This means your NIB/XIB has a deployment target not equal to 10.5.x, but you have some sort of button or other view whose Scaling setting is not None. If you go into Interface Builder, and go to your file's Info window, it will show a

Re: Basic Core Animation question

2008-04-14 Thread Michael Vannorsdel
In your initWithFrame: method you need to retain the layer object or the autorelease pool may deallocate it. Also, where do you set the layer to a view to be displayed? On Apr 14, 2008, at 6:26 PM, Greg Sabo wrote: I think I'm doing those things, see below: //Setting object as delegate

is this badly written code?

2008-04-14 Thread Adam Gerson
In cocoa its very tempting to write a single line of code like: NSManagedObject *selectedTreeObject = [self delegate] mainWindowController] treeController] selectedObjects] objectAtIndex:0]; or to flush it out in to individual lines: NSWindowController *mainWindow = [[self delegate]

Re: hooking into another app

2008-04-14 Thread Matt Burnett
You reply couldnt be more fanboi-ish. If that wasnt enuf you have a documented history of being a apple fanboi (http://projects.info-pull.com/moab/hallofshame/line-noise_offended-pimpdouche.txt ) Not once was it suggested that the OS isn't open to this sort of attack. You yourself said

Re: is this badly written code?

2008-04-14 Thread John Stiles
The chained approach is tempting since it's short and convenient, so if the code is not prone to failure, I'd say go for it. If you expect that you might need to see intermediate values in the debugger or there are weird edge cases where something might return nil, I'd break it out into

Re: is this badly written code?

2008-04-14 Thread Michael Vannorsdel
I don't think there's anything wrong combining messages into a chain when you only need one variable from it. With the well-worded method names common with Cocoa it's not too hard to see what the chain is doing. Sometimes having a bunch of placeholder variables on each line can look more

Re: is this badly written code?

2008-04-14 Thread Matt Burnett
Have you thought of using KVC? It makes that code alot smaller, and (im 99% sure) it deals with things like if treeController returned nil instead of a NSArray. NSManagedObject *selectedTreeObject = [self valueForKeyPath :@delegate

Re: is this badly written code?

2008-04-14 Thread John Stiles
Actually, that code isn't smaller, it just replaces ] with . in a couple of places :) As to whether it does anything special to avoid problems with nil objects, I have no idea... Matt Burnett wrote: Have you thought of using KVC? It makes that code alot smaller, and (im 99% sure) it deals

Re: is this badly written code?

2008-04-14 Thread Ferhat Ayaz
On Apr 15, 2008, at 4:53 AM, Adam Gerson wrote: In cocoa its very tempting to write a single line of code like: NSManagedObject *selectedTreeObject = [self delegate] mainWindowController] treeController] selectedObjects] objectAtIndex:0]; If you have to embed a lot of messages, you

[Moderator] Re: hooking into another app

2008-04-14 Thread Scott Anguish
None of this is relevant to this discussion or Cocoa. Nor was your earlier response. On Apr 14, 2008, at 11:04 PM, Matt Burnett wrote: You reply couldnt be more fanboi-ish. If that wasnt enuf you have a documented history of being a apple fanboi snip irrelevant URL and flame Either

Re: Subclassing NSArrayController

2008-04-14 Thread Scott Anguish
On Apr 14, 2008, at 11:53 PM, antikraft clover wrote: A very newbie-ish question: If I am subclassing NSArrayController to provide and update an array of objects, which methods do I need to implement ? you may want to provide more information, or re-check the docs. it shouldn't be necessary

NSAllocateCollectable() questions

2008-04-14 Thread Brendan Younger
Hi all, This is a re-post since I didn't receive any response on Sunday. I've been writing a library that uses NSAllocateCollectable() quite a bit and I have a few questions about proper usage. - Copying data if I am copying to a malloc'd block, I can use memmove() regardless of whether