NSAppleScript returns wrong result on multiple Safari windows, applescript editor work

2009-01-09 Thread Jot Kali
Hello, Still working on this problem. I need to get Safari most current URL. NSAppleScript does not work since it returns the wrong result, or it needs to activate Safari which isn't a solution. I'm now trying osascript called via an NSTask. This works in Terminal : /usr/bin/osascript -e '

Re: Recording video from a QCView to .mov

2009-01-09 Thread Jonathan Selander
Does using QTKit mean that everything in my quartz composition will be recorded, or only the input from the camera? 8 jan 2009 kl. 18.48 skrev David Duncan: On Jan 8, 2009, at 1:47 AM, Jonathan Selander wrote: I'm trying to record video form a webcam input to a .mov file. I've made a simp

Re: Hyperlinks

2009-01-09 Thread Matthew Morton
Thank you both for this. Much appreciated. On 9 Jan 2009, at 03:15, Sean McBride wrote: Matthew Morton (mattmor...@me.com) on 2009-01-08 7:02 AM said: have bound the value of the NSTextField to an NSAttributedString in a custom class and set attributes for NSLinkAtributeName, NSForegroundCo

NSDistributedNotificationCenter and Launchd

2009-01-09 Thread Aaron Scott
I have a background process that when started manually talks correctly with the GUI app using NSDistributedNotificationCenter. However, once I use launchd to start it as a LaunchDaemon I get no receiving of notifications from either the daemon or the GUI app. Is there a way to get the notif

Re: Help

2009-01-09 Thread Jean-Daniel Dupas
Maybe this can be a good starting point: http://www.catb.org/~esr/faqs/smart-questions.html Le 9 janv. 09 à 03:11, Parker Logan a écrit : I am new to all this so if any one can help please do. Thank you From: LIL PLO ___

Re: NSDistributedNotificationCenter and Launchd

2009-01-09 Thread Kyle Sluder
On Fri, Jan 9, 2009 at 3:58 AM, Aaron Scott wrote: > However, once I use launchd to start it as a LaunchDaemon I get no receiving > of notifications from either the daemon or the GUI app. Is there a way to > get the notifications to come through or is it near impossible? Have you read TN2083, "Da

Re: NSDecimalNumber seen as NSCFNumber; a bug? (not solved)

2009-01-09 Thread Davide Benini
Upon this suggestion, I investigated further with the debugger. Now I am more than sure than the value is not released, not in the passages I describe here. This is the scenario. I have a UITableViewController. Rows is selected. willSelect or didSelect methods (I tried both) do this LineIte

NSTextView bindings; value path

2009-01-09 Thread Matthew Morton
Hi all, The documentation concerning the valuePath at http://developer.apple.com/documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSTextView.html says An NSString that specifies the full path of the content to display in the NSTextView. What should be at the path referred to by t

Re: Help

2009-01-09 Thread Chunk 1978
here's a tread on starter books: http://www.cocoabuilder.com/archive/message/cocoa/2003/7/9/76391 not sure if any of the following books are listed, as i didn't read the tread, but you could start with these from amazon (amazon has very affordable prices!) 1. Absolute Beginner's Guide To C 2. P

Re: Custom tracking in a NSTextFieldCell

2009-01-09 Thread Alastair Houghton
On 8 Jan 2009, at 21:19, Eric Gorr wrote: Well, I was finally able to spot the delegate method: -outlineView:shouldTrackCell:forTableColumn:item: and simply return YES. This caused trackMouse & startTrackingAt to be called, but this isn't useful until stopTracking is called. For some reason

Problem with setting fonts in NSTextView

2009-01-09 Thread rethish
Hi all, In my sample application I use a textview and popupbutton(in which all the available fonts a shown at runtime). For this, i use the code: NSArray *path=[[NSFontManager alloc] availableFonts]; [popup addItemsWithTitles:path]; We can set the font in the textview Using:

Re: CALayer not displaying masked CGImage properly

2009-01-09 Thread Rob Boellaard
Hi, I took a .png image with alpha channel that I found on the web, loaded it as an CGImageRef in my app, and then passed it to both the normal NSView and the layer-backed view. This one gets displayed as I expected in both cases, ie. I see the View's background colour through the tr

Re: Problem with setting fonts in NSTextView

2009-01-09 Thread Graham Cox
On 9 Jan 2009, at 10:07 pm, rethish wrote: NSArray *path=[[NSFontManager alloc] availableFonts]; I take it this is merely a typo; you surely mean: [[NSFontManager sharedFontManager] availableFonts]; Using: [textview setFont:fontobj]; Where fontobj is an object of nsfont. But the

PDF Problem

2009-01-09 Thread Devon Govett
Hello everyone, Sorry about the double post, but the link to the images did not make it. I have developed an application that converts a PDF to a bitmap image. The program creates an image in which all of the pages in the PDF are stacked - one on top of the other. But I have a problem. When

[XCode] Generating method stubs

2009-01-09 Thread Martijn van Exel
Hi all, Coming from a .NET/Visual Studio environment, I got used to some conveniences that I do not find in XCode. For example, when you define a class that should conform to a certain protocol, isn't there a way to generate stubs for all the methods defined in that protocol? Thanks, -- martijn

Re: [XCode] Generating method stubs

2009-01-09 Thread Alastair Houghton
On 9 Jan 2009, at 12:10, Martijn van Exel wrote: Coming from a .NET/Visual Studio environment, I got used to some conveniences that I do not find in XCode. For example, when you define a class that should conform to a certain protocol, isn't there a way to generate stubs for all the methods d

Re: Help

2009-01-09 Thread Jens Bauer
First, you should install XCode (either from your System Installation DVD or by downloading it from connect.apple.com - you'd need to register as a developer then). When installed, you should get familiar with XCode, copy one of the example-projects to your desktop from /Developer/Examples

Re: PDF Problem

2009-01-09 Thread Jens Bauer
Hi Devon, Perhaps you're looking in the wrong direction. Try checking if the image type on Leopard is the same as the image type on Tiger. If the image type on Tiger is 8 bit (or monochrome), and the image type on Leopard is 24-bit color, it might be the image itself, which forces your out

Re: [XCode] Generating method stubs

2009-01-09 Thread Graham Cox
On 9 Jan 2009, at 11:10 pm, Martijn van Exel wrote: Hi all, Coming from a .NET/Visual Studio environment, I got used to some conveniences that I do not find in XCode. For example, when you define a class that should conform to a certain protocol, isn't there a way to generate stubs for all

NSOperation and NSOperationQueue cancellation and ordering questions

2009-01-09 Thread Karan, Cem (Civ, ARL/CISD)
I am currently using NSOperation (actually, NSInvocationOperation) and NSOperationQueue to decouple my GUI from some long running operations. Some operations are dependent on one another, in a purely linear fashion, so I've been treating them in the same way I'd treat a singly linked list, keep

NSImage resizing

2009-01-09 Thread Parimal Das
hi in my application i need to resize a .jpg image through a command line my code is NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:filePath]; // get icon from the file at filePath destination NSSize imageSize; imageSize.width = 384.0; // in points (384 pts = 512 px ) imageSize.he

A Question on estimating +arrayWithCapacity

2009-01-09 Thread Steve Cronin
Folks; Under some circumstances I'm not sure how big a mutable object might need be. So is there any guidance on coming up with a value for capacity? Assume for these cases that reasonable guesses range from say 2 - 5000... I assume it's wasteful to just do a land grab with +arrayWithCapa

Re: Best way to handle this

2009-01-09 Thread development2
On Jan 8, 2009, at 11:58 PM, Ken Thomases wrote: On Jan 8, 2009, at 7:49 PM, Nathan Kinsinger wrote: On Jan 8, 2009, at 4:20 PM, development2 wrote: I am hoping someone can help me figure out the best way to handle this, I am sure someone out there has some experience with this. I have s

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Graham Cox
On 10 Jan 2009, at 1:07 am, Steve Cronin wrote: Folks; Under some circumstances I'm not sure how big a mutable object might need be. So is there any guidance on coming up with a value for capacity? Assume for these cases that reasonable guesses range from say 2 - 5000... I assume it's

A Data Object in Cocoa

2009-01-09 Thread nik heger
I am trying to define a pure data object in Cocoa. This object doesn't do anything, it should just act as a container for three strings. This is generally a good design pattern, at least in Java. In Cocoa, I am running into a lot of resistance. The constructor is rather complicated. And t

Re: Custom tracking in a NSTextFieldCell

2009-01-09 Thread Eric Gorr
On Jan 9, 2009, at 5:59 AM, Alastair Houghton wrote: On 8 Jan 2009, at 21:19, Eric Gorr wrote: Well, I was finally able to spot the delegate method: -outlineView:shouldTrackCell:forTableColumn:item: and simply return YES. This caused trackMouse & startTrackingAt to be called, but this is

Re: Best way to handle this

2009-01-09 Thread Graham Cox
On 10 Jan 2009, at 1:08 am, development2 wrote: But I am curious about something. I am using NSTask to actually handle the external program, so what asynchronous notifications are you talking about then? I'm guessing it would be NSTaskDidTerminateNotification, as it's the only one it de

Re: SetWindowModality Replacement

2009-01-09 Thread Dong Feng
I think, for the modaless, you need simply invoke [NSWindow makeKeyAndOrderFront:]. On Mac OS X, SystemModal and AppModal are the same and it should work with runModalForWindow. I'm not sure the behavior of kWindowModalityWindowModal. 2009/1/8 Russ : > I'm still looking for a Cocoa replacement

QCView to fullscreen

2009-01-09 Thread Jonathan Selander
Hi, I've loaded a QC into a QCView and i want to make it go full screen. Googling told me to do something like: - (void) awakeFromNib { if (![self loadCompositionFromFile:[[NSBundle mainBundle] pathForResource:@"Introduction" ofType:@"qtz"]]) { NSLog(@"Could not load compo

Re: A Data Object in Cocoa

2009-01-09 Thread Jens Bauer
Hi Nik, self is a pointer, so you might want to change "self." into "self->" I usually prefix arguments with an 'a' (a for Argument): - (id)initWithLabel:(NSString *)aLabel pin:(NSString *)aPin seed: (NSString *)aSeed { self = [super init]; if(self) { l

Re: A Data Object in Cocoa

2009-01-09 Thread Sandro Noel
the compiler is complaining just because they all have the same name and he is confused about witch to choose to resolve the issue, just rename the parameters of your procedure. IE: - (id)initWithLabel:(NSString *)initLabel pin:(NSString *)initPin seed:(NSString *)initSeed { or whateve

Re: QCView to fullscreen

2009-01-09 Thread Sean McBride
On 1/9/09 3:45 PM, Jonathan Selander said: >- (void)enterFullScreen:(id)sender >{ > // toggle fullscreen mode > if (self.isInFullScreenMode) > [self exitFullScreenModeWithOptions:nil]; > else > [self enterFullScreenMode:[NSScreen self] withOptions:nil]; >} You want [NS

Re: A Data Object in Cocoa

2009-01-09 Thread Thomas Davie
On 9 Jan 2009, at 15:53, Jens Bauer wrote: Hi Nik, self is a pointer, so you might want to change "self." into "self->" No need to do that – assuming that label, pin and seed are declared as properties, which, this being a container class I guess they are. This also destroys the need to

Re: A Data Object in Cocoa

2009-01-09 Thread Andy Lee
I haven't checked, but I suspect the compiler chooses the right thing, since this is only a warning. Maybe someone knows a way to disable the warning? In Java, I wouldn't be surprised if there were a way to enable a similar warning. --Andy On Jan 9, 2009, at 9:59 AM, Sandro Noel wrote:

Re: A Data Object in Cocoa

2009-01-09 Thread Thomas Davie
On 9 Jan 2009, at 16:13, Andy Lee wrote: I haven't checked, but I suspect the compiler chooses the right thing, since this is only a warning. Maybe someone knows a way to disable the warning? In Java, I wouldn't be surprised if there were a way to enable a similar warning. The compiler

Re: Problem sending notification from C callback function

2009-01-09 Thread Sandro Noel
Ken thank you. the problem was elsewhere in a dictionary key name... thank you for your help!!! Sandro Noel. On 9-Jan-09, at 2:09 AM, Ken Thomases wrote: On Jan 8, 2009, at 7:57 PM, Sandro Noel wrote: I have this callback from DiskArbritation framework and I would like to send a notificati

Re: A Data Object in Cocoa

2009-01-09 Thread glenn andreas
On Jan 9, 2009, at 9:13 AM, Andy Lee wrote: I haven't checked, but I suspect the compiler chooses the right thing, since this is only a warning. Maybe someone knows a way to disable the warning? In Java, I wouldn't be surprised if there were a way to enable a similar warning. --Andy

Re: A Data Object in Cocoa

2009-01-09 Thread Jens Bauer
You're right, it's not needed, and furthermore, I just checked, the warnings won't disappear. Everyone, disregard what I wrote about self-> I believe that prefixing the parameters is most likely the best way (and as a good example for us, the guys at Apple does it as well). Love, Jens On

Re: A Data Object in Cocoa

2009-01-09 Thread Andy Lee
On Jan 9, 2009, at 10:20 AM, glenn andreas wrote: On Jan 9, 2009, at 9:13 AM, Andy Lee wrote: I haven't checked, but I suspect the compiler chooses the right thing, since this is only a warning. Maybe someone knows a way to disable the warning? In Java, I wouldn't be surprised if there w

Re: NSImage resizing

2009-01-09 Thread Mike Abdullah
Try having a play with -[NSImage setScalesWhenResized:] On 9 Jan 2009, at 13:50, Parimal Das wrote: hi in my application i need to resize a .jpg image through a command line my code is NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:filePath]; // get icon from the file at filePa

Re: Weird problem: Application terminates unexpectedly after closing NSOpenPanel sheet

2009-01-09 Thread Corbin Dunn
On Jan 8, 2009, at 11:54 PM, Oleg Krupnov wrote: Here is my code: //- - (IBAction)scanFolder:(id)sender { NSOpenPanel* openPanel = [NSOpenPanel openPanel]; [openPanel setCanChooseDire

Re: [RESOLVED] Weird problem: Application terminates unexpectedly after closing NSOpenPanel sheet

2009-01-09 Thread Oleg Krupnov
I have found that the cause of the problem was that my XIB main window was of class NSPanel, not NSWindow. When the main window is an NSPanel, the application indeed attempts to quit and calls its NSApp delegate -applicationShouldTerminateAfterLastWindowClosed: message when the sheet gets closed.

Re: NSImage resizing

2009-01-09 Thread Steve Christensen
For a bitmap image, -setSize: effectively alters the DPI of the pixels but doesn't actually create a new bitmap of a different size. So for a 72dpi image, the NSBitmapImageRep's -width and -height methods should give you the same values as for the image's -size method. But for a 300dpi imag

Re: A custom cell in a NSOutlineView

2009-01-09 Thread Eric Gorr
Thanks for the information. It was quite useful. p.s. you have my permission to slap whomever is preventing the mention of the PhotoSearch sample code at: http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSOutlineView_Class/Reference/Reference.html in the Relat

Re: Recording video from a QCView to .mov

2009-01-09 Thread David Duncan
On Jan 9, 2009, at 12:45 AM, Jonathan Selander wrote: Does using QTKit mean that everything in my quartz composition will be recorded, or only the input from the camera? Just the camera (which was my impression of what you were recording previously!). If you want to record the entire pre

[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

Pasting into another app

2009-01-09 Thread Scott Ribe
I need my app to put data on the clipboard, then cause another app to paste it. The other app is not scriptable. Suggestions? Does this require sending a cmd-v key event to the other app, and how to do this (CGEventTap?), or is there a better way? -- Scott Ribe scott_r...@killerbytes.com http:/

Re: Pasting into another app

2009-01-09 Thread Dave DeLong
Word of caution: When posting a paste key event like that, be warned that it does not translate to international keyboard layouts, where paste can have a different shortcut (such as command-k). That being said, I don't know of another way to invoke paste in another application. Dave On

Re: Resetting the TableView

2009-01-09 Thread Mohan Parthasarathy
Hi, Thanks. I did miss the animated part. It works now. But as far as my log goes, i can only see ViewDidAppear and ViewWillAppear gets called. ViewDidDisappear and ViewDidAppear never gets called. Yes, i have animated for all four of them. I can remove all my objects and reloadData in ViewWillAp

Re: Pasting into another app

2009-01-09 Thread Scott Ribe
> When posting a paste key event like that, be warned that it does not > translate to international keyboard layouts, where paste can have a > different shortcut (such as command-k). That being said, I don't know > of another way to invoke paste in another application. Thanks. Fortunately, this w

Bonjour server with multiple clients

2009-01-09 Thread Dave DeLong
Hi everyone, I'm writing a simple voting app, where one instance of the app creates a poll and then publishes it over Bonjour. Other instances of the app on the same local network then find the publish poll, get the list of voting options, and then allow users at each computer to start s

Re: Please help

2009-01-09 Thread Parker Logan
Any more sites From: LIL PLO On Jan 9, 2009, at 4:22 AM, Parker Logan wrote: Please can any one teach me about code I just started and I want to learn. Thanks for your time Begin forwarded message: From: Parker Logan Date: January 9, 2009 4:11:52 AM GMT+02:

Re: Please help

2009-01-09 Thread Dave DeLong
http://cocoaheads.byu.edu has a very large resources section. Dave On Jan 9, 2009, at 1:30 PM, Parker Logan wrote: Any more sites ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: Please help

2009-01-09 Thread I. Savant
On Fri, Jan 9, 2009 at 3:30 PM, Parker Logan wrote: > Any more sites Seriously? http://www.google.com/ You've been handed a number of excellent resources, any one of which should keep you reading and learning for days if not months. There have been a lot of very helpful replies which are

Thanks

2009-01-09 Thread Parker Logan
From: LIL PLO ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscrip

Re: Pasting into another app

2009-01-09 Thread Michael Vannorsdel
Checkout CGEventCreateKeyboardEvent and CGEventPost to synthesize keyboard events. You have to make and post an event for the key down and then the key up. So: command key down, V key down, V key up, command key up. There's also CGPostKeyboardEvent which is easier to use but not recommen

Re: Pasting into another app

2009-01-09 Thread Dave DeLong
With the CGEvents, you don't have to post four. You can post two: One for V down and one for V up. You can use the modifierFlags on the CGEvent to specify that Command should be down on V down. Dave On Jan 9, 2009, at 2:34 PM, Michael Vannorsdel wrote: Checkout CGEventCreateKeyboardEvent

Re: Bonjour server with multiple clients

2009-01-09 Thread Jim Correia
On Jan 9, 2009, at 2:47 PM, Dave DeLong wrote: I'm writing a simple voting app, where one instance of the app creates a poll and then publishes it over Bonjour. Other instances of the app on the same local network then find the publish poll, get the list of voting options, and then allow u

[moderator] Re: Thanks

2009-01-09 Thread Scott Anguish
Please consider this over. He's unsubscribed, and I'll be more vigilant about approvals again in the future. scott ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact th

Re: NSTextView bindings; value path

2009-01-09 Thread Ken Thomases
On Jan 9, 2009, at 4:11 AM, Matthew Morton wrote: The documentation concerning the valuePath at http://developer.apple.com/documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSTextView.html says An NSString that specifies the full path of the content to display in the NSTextView.

Re: Pasting into another app

2009-01-09 Thread Scott Ribe
Michael said: > Checkout CGEventCreateKeyboardEvent and CGEventPost That's what I found, and got it working. > So: command key down, V key down, V key up, > command key up. FYI, although that's what the docs say, it doesn't work. You have to set the command key flag on the V key down event, the

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

2009-01-09 Thread I. Savant
On Jan 9, 2009, at 1:01 PM, Stuart Malin wrote: My small addition: I consider that warnings are less about what one is doing in the very moment of composing code, but about interpreting code in the future, because when when writing code so much unstated context is alive in our head, but lat

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Ken Thomases
On Jan 9, 2009, at 8:11 AM, Graham Cox wrote: On 10 Jan 2009, at 1:07 am, Steve Cronin wrote: Under some circumstances I'm not sure how big a mutable object might need be. So is there any guidance on coming up with a value for capacity? [...] It feels a little like premature optimization,

Re: A Data Object in Cocoa

2009-01-09 Thread Ken Thomases
On Jan 9, 2009, at 1:49 AM, nik heger wrote: - (id)initWithLabel:(NSString *)label pin:(NSString *)pin seed: (NSString *)seed { if (self = [super init]) { self.label = label; ///<--- compiler complains self.pin = pin; self.seed = s

Re: A Data Object in Cocoa

2009-01-09 Thread Adam Foltzer
I've noticed a pattern in some Apple code where the instance variables are all prefixed with an underscore, but the property name, and therefore the accessors, are what you'd expect. This leaves you free to use the same name for arguments. To make the property point to the right variable, use an =

Re: A Data Object in Cocoa

2009-01-09 Thread Kyle Sluder
On Fri, Jan 9, 2009 at 7:11 PM, Adam Foltzer wrote: > - (id)initWithInt:(int)foo > { >if (![super init]) >return nil; >[self setFoo:foo]; >return self; > } Do not use getters and setters in -init. You should be accessing the ivars directly. --Kyle Sluder

Re: Bonjour server with multiple clients

2009-01-09 Thread Markus Spoettl
On Jan 9, 2009, at 1:49 PM, Jim Correia wrote: I'm writing a simple voting app, where one instance of the app creates a poll and then publishes it over Bonjour. Other instances of the app on the same local network then find the publish poll, get the list of voting options, and then allow us

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Kyle Sluder
On Fri, Jan 9, 2009 at 6:39 PM, Ken Thomases wrote: > And the reason many people don't realize they can do this is that they > overlook the superclass methods when considering a subclass. A lot of > people don't even know that they can send +array to NSMutableArray! Part of the problem that was

Re: Bonjour server with multiple clients

2009-01-09 Thread Kyle Sluder
On Fri, Jan 9, 2009 at 8:22 PM, Markus Spoettl wrote: > Apple's bonjour example (Picture Sharing > http://developer.apple.com/samplecode/PictureSharing/index.html) seems to be > demoing exactly what you say it doesn't do. Whether or not it's called > "bonjour connection" or something else doesn't

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Graham Cox
On 10 Jan 2009, at 12:27 pm, Kyle Sluder wrote: Part of the problem that was addressed in the previous thread was that +array is not documented to actually give you a mutable instance. While in practice it works fine, there's no guarantee. Isn't guaranteed by the semantics of inheritance? I'

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Kyle Sluder
On Fri, Jan 9, 2009 at 8:40 PM, Graham Cox wrote: > Isn't guaranteed by the semantics of inheritance? I've specified the class: > [NSMutableArray ... and what I want it to give me... array]; And the fact > that NSMutableArray inherits NSArray ensures that anything that array can > do, NSMutableArr

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread mmalc Crawford
On Jan 9, 2009, at 5:40 PM, Graham Cox wrote: On 10 Jan 2009, at 12:27 pm, Kyle Sluder wrote: Part of the problem that was addressed in the previous thread was that +array is not documented to actually give you a mutable instance. While in practice it works fine, there's no guarantee. Isn't

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Jonathan Hess
+[NSMutableArray array] returns a mutable array. That's the reason the return type is + (id) and not + (NSArray *). When implementing connivence initializers, you should invoke [self alloc], not [ASpecificClass alloc]. Cocoa uses this pattern frequently, and you can safely depend on it. O

Re: Bonjour server with multiple clients

2009-01-09 Thread Markus Spoettl
On Jan 9, 2009, at 5:38 PM, Kyle Sluder wrote: The first thing you see when you open up PicSharingController.m in that example is the following: - - (IBAction)toggleSharing:(id)sender { uint16_t chosenPort; if(!listeningSocket) { // Here, create the socket from traditional BSD

Re: Bonjour server with multiple clients

2009-01-09 Thread Andrew Farmer
On 09 Jan 09, at 17:57, Markus Spoettl wrote: How does one go about advertising a service via bonjour like in the Picture Sharing example AND allow multiple connections instead of just one? Is it as simple as creating multiple listeningSockets? Or create a new listening socket each time you

Re: A Data Object in Cocoa

2009-01-09 Thread Adam Foltzer
I stand corrected; I've seen this many times before, and have never had problems. I'm guessing it's one of those patterns that causes problems under specific circumstances? Cheers, Adam On Fri, Jan 9, 2009 at 7:40 PM, Kyle Sluder wrote: > On Fri, Jan 9, 2009 at 7:11 PM, Adam Foltzer wrote: > >

Re: NSDistributedNotificationCenter and Launchd

2009-01-09 Thread Stephane Sudre
On Jan 9, 2009, at 12:58 AM, Aaron Scott wrote: I have a background process that when started manually talks correctly with the GUI app using NSDistributedNotificationCenter. However, once I use launchd to start it as a LaunchDaemon I get no receiving of notifications from either the daemo

Re: A Data Object in Cocoa

2009-01-09 Thread Ricky Sharp
On Jan 9, 2009, at 8:28 PM, Adam Foltzer wrote: I stand corrected; I've seen this many times before, and have never had problems. I'm guessing it's one of those patterns that causes problems under specific circumstances? Yes, only under certain situations. I've been personally calling

Re: A Data Object in Cocoa

2009-01-09 Thread Sean McBride
Adam Foltzer (acfolt...@gmail.com) on 2009-01-09 9:28 PM said: >I stand corrected; I've seen this many times before, and have never had >problems. I'm guessing it's one of those patterns that causes problems under >specific circumstances? See this thread:

Re: A Data Object in Cocoa

2009-01-09 Thread mmalc Crawford
On Jan 9, 2009, at 6:47 PM, Sean McBride wrote: See this thread: Basically, in init and dealloc, you should message ivars directly instead of using setters.

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Ashley Clark
This should apply to NSNumber and NSDecimalNumber too right? Yet the NSNumber +numberWith... methods are declared to return (NSNumber *) and when called on NSDecimalNumber they return NSDecimalNumber objects which then have to be typecast. __ Ashley On Jan 9, 2009, at 7:45 PM, mmalc Cr

Hey

2009-01-09 Thread Parker Logan
Thanks for all the help. From: LIL PLO ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscri

比乂功夫凣

2009-01-09 Thread Parker Logan
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.

changeKeyPath method documentation

2009-01-09 Thread Russell Martin
Hi. I'm completely new to the list and this is my first question. I'm working through Aaron Hillegass' "Cocoa Programming For Mac OS X (3rd Ed)" and I'm near the end of chapter 9 (pg 148) where it is shown to make use of the changeKeyPath method. I'm in the habit of right clicking on method name

CALayer removeFromSupeLayer crashes

2009-01-09 Thread Dennis Christopher
I attach a base layer to a custom view as follows: [view setWantsLayer:YES]; then I add several layers with: CALayer *layer = [CALayer layer]; layer.name = @"test"; [view.layer addSublayer:layer]; the view draws and each layer draws thru the designated drawRect and drawLayer methods, a

accessing ivars in - (id)init

2009-01-09 Thread Ron Fleckner
Hi, I read with interest the guidance in a recent thread regarding accessing ivars in -init methods. In a subclass of NSWindow I call [self setBackgroundColor:someColor] even though I don't override that method. This has worked in the wild for about two years, but I wanted to conform to

Re: Bonjour server with multiple clients

2009-01-09 Thread Jim Correia
On Jan 9, 2009, at 8:22 PM, Markus Spoettl wrote: Apple's bonjour example (Picture Sharing http://developer.apple.com/samplecode/PictureSharing/index.html) seems to be demoing exactly what you say it doesn't do. Whether or not it's called "bonjour connection" or something else doesn't reall

Re: accessing ivars in - (id)init

2009-01-09 Thread Michael Ash
On Fri, Jan 9, 2009 at 11:07 PM, Ron Fleckner wrote: > Hi, > > I read with interest the guidance in a recent thread regarding accessing > ivars in -init methods. In a subclass of NSWindow I call [self > setBackgroundColor:someColor] even though I don't override that method. This > has worked in t

Re: Bonjour server with multiple clients

2009-01-09 Thread Michael Ash
On Fri, Jan 9, 2009 at 8:22 PM, Markus Spoettl wrote: > On Jan 9, 2009, at 1:49 PM, Jim Correia wrote: >>> >>> I'm writing a simple voting app, where one instance of the app creates a >>> poll and then publishes it over Bonjour. Other instances of the app on the >>> same local network then find t

Re: accessing ivars in - (id)init

2009-01-09 Thread Ron Fleckner
On 10/01/2009, at 3:49 PM, Michael Ash wrote: On Fri, Jan 9, 2009 at 11:07 PM, Ron Fleckner wrote: Hi, I read with interest the guidance in a recent thread regarding accessing ivars in -init methods. In a subclass of NSWindow I call [self setBackgroundColor:someColor] even though I don't

Re: accessing ivars in - (id)init

2009-01-09 Thread Kyle Sluder
On Fri, Jan 9, 2009 at 11:49 PM, Michael Ash wrote: > Note that the problems, such as they are, with calling setters only > show up if your class is subclassed and the subclass does something > weird that doesn't like being called when the rest of the subclass > isn't initialized. If you're not su

Re: accessing ivars in - (id)init

2009-01-09 Thread Quincey Morris
This discussion can backwards and forwards on the issue of ivars vs accessors, but it won't get anywhere definitive, because there is no answer that covers all cases. All we've got is that Apple's currently recommended practice is to avoid accessors in initializers. Clear, but not absolute.

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

2009-01-09 Thread Andrew Farmer
On 09 Jan 09, at 15:41, I. Savant wrote: On Jan 9, 2009, at 1:01 PM, Stuart Malin wrote: My small addition: I consider that warnings are less about what one is doing in the very moment of composing code, but about interpreting code in the future, because when when writing code so much unsta

NKE Kernel extension

2009-01-09 Thread Jacob Rhoden
Hi, Anyone here ever done any Network kernel extensions? I am trying to start by doing something simple as monitoring network traffic, but the apple documentation isn't getting me very far? Anyone know any useful websites or tutorials in this area? Best regards, Jacob ___

How to show small button-style images to NSOutlineView?

2009-01-09 Thread Donnie Lee
Hi! I created 10.5 Source View using NSOutlineView and want to know how to show small button-style images in cells when you select or hover them (like in Mail.app round arrow image when you select RSS entry and so on)? A code sample would be appreciate. Donnie. ___

Re: NKE Kernel extension

2009-01-09 Thread Andrew Farmer
On 09 Jan 09, at 23:01, Jacob Rhoden wrote: Anyone here ever done any Network kernel extensions? I am trying to start by doing something simple as monitoring network traffic, but the apple documentation isn't getting me very far? Anyone know any useful websites or tutorials in this area? N