Re: argument checks

2008-06-12 Thread Jason Coco
Just a note, the NSAssert() Foundation function should only be called from inside an Objective-C method... if your code is somewhere in an Object-C class, this is fine, but if you're calling from inside a C- callback function or another C helper function (since you're creating a Library, thi

Re: argument checks

2008-06-12 Thread Chris Suter
On 12/06/2008, at 4:51 PM, Graham Cox wrote: NSNumber* myNum = nil; /* stuff */ NSAssert( myNum != nil, @"some error message"); [myClass calc:myNum]; Messages to nil are safe - it will treat your number as having a value of 0. Thus as long as you initialise it to nil, your code will

toggleToolbarShown: How do I localize the menu item strings for non-supported languages?

2008-06-12 Thread Ulf Dunkel
When I add the recommended menu items " Hide Toolbar " " Customize Toolbar... " to my app's View menu, I can give them any text I like, but the "Hide Toolbar" string will be replaced by the system when the app is launched and a document window has been opened. The Action toggleToolbarS

Re: Troubles with CollectionView and IKImageBrowserView

2008-06-12 Thread Daniel Vollmer
On Jun 12, 2008, at 00:25, Jens Alfke wrote: On 11 Jun '08, at 1:14 PM, Manuel wrote: But the IKImageBrowserView doesn't call these methods. I setup a testmethod in the MYNSCollectionViewItem like the following code, to verify that the imagebrowser outlet is set and to set again the dat

Re: argument checks

2008-06-12 Thread Graham Cox
On 12 Jun 2008, at 5:03 pm, Chris Suter wrote: In the original example, myNum was being passed as a argument rather than having a message to sent to it and it’s often not safe to pass nil objects as arguments. Hmmm... well, what's the function it's passed to going to do with it, other t

Re: argument checks

2008-06-12 Thread Jason Coco
I agree with Graham, although I misread the initial question as well... if the person is passing a garbage pointer, there's really not much you can do. All you can really do is assert that the object you expected is not nil. Why is it unsafe to pass nil? Many API in Cocoa tell you to pass n

Re: Issue with displaying URI prefixes on child elements using NSXML

2008-06-12 Thread Lawrence Johnston
It all makes sense now. Thanks. On Jun 11, 2008, at 11:48 PM, Chris Suter wrote: On 11/06/2008, at 3:19 PM, Lawrence Johnston wrote: Hey everybody, I've got an issue that I can't figure out. If I'm using this code: NSString *XMLForDisplay { NSXMLElement *root = [NSXMLNode elementWithName:

Re: argument checks

2008-06-12 Thread Chris Suter
On 12/06/2008, at 5:29 PM, Graham Cox wrote: On 12 Jun 2008, at 5:03 pm, Chris Suter wrote: In the original example, myNum was being passed as a argument rather than having a message to sent to it and it’s often not safe to pass nil objects as arguments. Hmmm... well, what's the function

Re: launchd daemon Throttling respawn log messages

2008-06-12 Thread Alexander Reichstadt
Thank you, the process needs to be running permanently, the script was just for testing. It works on both, 10.4 and 10.5 without throttling now. I had used Lingon but that doesn't create the plist the way it needed to be. Alexander On Jun 11, 2008, at 16:58 , Jens Alfke wrote: On 11 J

Re: Issue with displaying URI prefixes on child elements using NSXML

2008-06-12 Thread Nathan Kinsinger
On Jun 12, 2008, at 12:48 AM, Chris Suter wrote: The documentation says that you need to pass the qualified name in. So you need to do: NSXMLElement *child = [NSXMLNode elementWithName:@"a:child" URI:@"http://www.tempurl.com "]; You can look-up the prefix using NSXMLElement’s resolvePre

Re: NSTextView and changing the selected text's color

2008-06-12 Thread Mattias Arrelid
On Wed, Jun 11, 2008 at 6:15 PM, Mattias Arrelid <[EMAIL PROTECTED]> wrote: > Hi Douglas, > > On Wed, Jun 11, 2008 at 5:30 PM, Douglas Davidson <[EMAIL PROTECTED]> wrote: >> >> On Jun 11, 2008, at 3:24 AM, Mattias Arrelid wrote: >> >>> Haven't anyone stumbled upon something similar, or a solution t

Re: NSTextView and changing the selected text's color

2008-06-12 Thread Mattias Arrelid
On Thu, Jun 12, 2008 at 11:14 AM, Mattias Arrelid <[EMAIL PROTECTED]> wrote: > On Wed, Jun 11, 2008 at 6:15 PM, Mattias Arrelid <[EMAIL PROTECTED]> wrote: >> Hi Douglas, >> >> On Wed, Jun 11, 2008 at 5:30 PM, Douglas Davidson <[EMAIL PROTECTED]> wrote: >>> >>> On Jun 11, 2008, at 3:24 AM, Mattias A

Re: Memory not freed with CIImage

2008-06-12 Thread Fabian
>From the archives, originally posted by Rob Keniger: I had problems with this too, and I use a workaround I found somewhere where you render to a CGImageRef in the context of the current window. Here's a dump of the code: //theImage is an existing NSImage CIImage *outputImage = [CIImage imageWit

Re: Memory not freed with CIImage

2008-06-12 Thread Robert Cerny
On 12.6.2008, at 7:48, Stefano Falda wrote: On 12/giu/08, at 00:34, Nick Zitzmann wrote: It's normal for physical memory sizes to go up, and not come down until either the program is quit or the physical memory is needed elsewhere. Activity Monitor is not a memory leak detector. If you w

Re: argument checks

2008-06-12 Thread Graham Cox
On 12 Jun 2008, at 5:47 pm, Chris Suter wrote: Can you give me a counter-example? Let’s say the function your calling uses one of the following: -[NSDictionary setObject:forKey:] -[NSMutableArray addObject:] Raising an exception is a good response when a nil argument isn't appropriate,

Re: argument checks

2008-06-12 Thread Jerry Krinock
On 2008 Jun, 12, at 0:47, Chris Suter wrote: On 12/06/2008, at 5:29 PM, Graham Cox wrote: ... implicitly allowing nil, unless it is specifically documented otherwise. Can you give me a counter-example? -[NSDictionary setObject:forKey:] -[NSMutableArray addObject:] [These] raise exceptio

FSEvent- FSEventStreamEventFlags

2008-06-12 Thread santoshb
Hi All, I want to know how we can get the file close event using FSEventStreamEventFlags. I have written the code for get the event when user write, open and close the file. But we are not able to distinguish between which event is for which purpose. Shown below is the out put of functio

Re: Prevent Asynchronous operation of beginSheetModalForWindow

2008-06-12 Thread Graham Cox
Hi John, I hope you don't mind me cc'ing this to the list - I think it might be helpful to others (if not, my apologies for the noise). On 12 Jun 2008, at 9:43 pm, John Love wrote: Hi, Graham ... Graham, this is a condensed summary of my initial communication: Call it my fetish or whateve

Re: NSTextView and changing the selected text's color

2008-06-12 Thread Graham Cox
Definitely sounds like a bug - file it anyway, they can only say "behaves as expected" (and probably will... ;-) I would expect that if I set my foreground text to some pale colour, I could set a different colour for selected text so it has contrast with the background selection colour, not

Re: argument checks

2008-06-12 Thread Hamish Allan
On Thu, Jun 12, 2008 at 6:50 AM, Ashley Perrien <[EMAIL PROTECTED]> wrote: > Noob question: I'm putting together a small code library and I'm trying to > include some error checking in the methods; what I want to protect against > is the following: > > NSNumber *myNum; > > // Lots of code where I'

Re: Troubles with CollectionView and IKImageBrowserView

2008-06-12 Thread Jens Alfke
Begin forwarded message: From: Daniel Vollmer <[EMAIL PROTECTED]> Date: 12 June, 2008 12:18:41 AM PDT To: Jens Alfke <[EMAIL PROTECTED]> Subject: Re: Troubles with CollectionView and IKImageBrowserView On Jun 12, 2008, at 00:25, Jens Alfke wrote: On 11 Jun '08, at 1:14 PM, Manuel wrote:

Re: FSEvent- FSEventStreamEventFlags

2008-06-12 Thread Jens Alfke
On 12 Jun '08, at 5:57 AM, santoshb wrote: I want to know how we can get the file close event using FSEventStreamEventFlags. I have written the code for get the event when user write, open and close the file. But we are not able to distinguish between which event is for which purpose. Yo

Re: argument checks

2008-06-12 Thread Jens Alfke
On 11 Jun '08, at 10:50 PM, Ashley Perrien wrote: NSNumber *myNum; // Lots of code where I've forgotten to actually do anything with myNum results = [myClass someCalculationUsing: myNum]; Turn on the "Uninitialized Automatic Variables" warning in your project's build settings. (Actuall

Re: NSTreeController's arrangedObjects returning _NSControllerTreeProxy for KVC path?

2008-06-12 Thread Danny Price
> > In general, you should not treat NSController-derived classes as holders of > data. They are specifically for binding to. > Since the "shapeTreeController" gets its content by binding to something > else, why don't you just directly access that something instead of trying to > go through the c

Re: NSTreeController's arrangedObjects returning _NSControllerTreeProxy for KVC path?

2008-06-12 Thread Danny Price
> I'm not sure what you mean by shadow-object problem. I'm referring to the 'brick' object returned by the tree controller in 10.4 which required hacks via a category and the private 'observedObject' function. In Leopard, [treeController arrangedObjects] returns a proxy object (the > same way th

Authentication and NSURLConnection sendSynchronousRequest

2008-06-12 Thread Paul E. Robichaux
I¹m writing a simple demo application showing how to use some Exchange Web Services (EWS) features in Cocoa. I am a total Cocoa n00b but have most of the app and UI working, thanks to a lot of google-fu and my now-worn copy of Hillegas' 3rd ed. I¹m having trouble authenticating to the actual EWS se

Re: NSTreeController's arrangedObjects returning _NSControllerTreeProxy for KVC path?

2008-06-12 Thread Danny Price
> That's what I used to think, too, until someone on this list pointed out to > me that this snippet is in the header for NSTreeController: > > // proxy for the root tree node responds to -childNodes and > -descendantNodeAtIndexPath:(NSIndexPath *)indexPath > - (id)arrangedObjects; > > So whereas p

Re: NSTextView and changing the selected text's color

2008-06-12 Thread Douglas Davidson
On Jun 12, 2008, at 2:47 AM, Mattias Arrelid wrote: It turns out that if you set the NSForegroundColorAttributeName of the attributed string in NSTextView's text storage, the call to setSelectedTextAttributes: doesn't have any effect when called as described below: File a bug and we'll look i

how to prevent sleep mode when app is running

2008-06-12 Thread Nick Rogers
Hi, When the computer goes into sleep mode my app also seems to be taking forever in doing the current task. So how can I prevent the computer from going into sleep mode when my app is running? Wishes, Nick ___ Cocoa-dev mailing list (Cocoa-dev@l

Re: NSTreeController's arrangedObjects returning _NSControllerTreeProxy for KVC path?

2008-06-12 Thread Hamish Allan
On Thu, Jun 12, 2008 at 4:35 PM, Danny Price <[EMAIL PROTECTED]> wrote: > What I don't understand is why the same binding returns a different object > in two cases? Why don't get this proxy object when I bind the view directly > to the controller? Good question. I would guess that not everything

Re: NSTextView and changing the selected text's color

2008-06-12 Thread Mattias Arrelid
On Thu, Jun 12, 2008 at 5:40 PM, Douglas Davidson <[EMAIL PROTECTED]> wrote: > > On Jun 12, 2008, at 2:47 AM, Mattias Arrelid wrote: > >> It turns out that if you set the NSForegroundColorAttributeName of the >> attributed string in NSTextView's text storage, the call to >> setSelectedTextAttribute

Re: how to prevent sleep mode when app is running

2008-06-12 Thread Hank Heijink (Mailinglists)
Look into UpdateSystemActivity(). It's in the CoreServices framework. If you call it with UsrActivity every 25 seconds or so, the display won't dim and the computer won't go to sleep (unless it's forced to. You can't prevent that). What is your app doing that you want to resort to something

Re: Authentication and NSURLConnection sendSynchronousRequest

2008-06-12 Thread Jens Alfke
On 12 Jun '08, at 8:35 AM, Paul E. Robichaux wrote: @implementation NSURLRequest(NSHTTPURLRequest) + (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host { return YES; } @end At the end of one of my .m files, the code builds, though I get warnings that some other methods aren't impleme

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

2008-06-12 Thread Ashley Perrien
In the original example, myNum was being passed as a argument rather than having a message to sent to it and it’s often not safe to pass nil objects as arguments. Hmmm... well, what's the function it's passed to going to do with it, other than call a method on it? If it's doing anything else, it

Accessors Question

2008-06-12 Thread Jeff LaMarche
Lately, I've started to see accessors of the following sort: - (NSString *)foo { return [[foo retain] autorelease]; } rather than just - (NSString *)foo { return foo; } What is the purpose or benefit of doing this? It seems to me that this would add things unnecessarily to th

Simple question - Subclassing NSView

2008-06-12 Thread Vikas
Hi, I have recently started programming on Mac using Objective-C and Cocoa. I am coming from C++/C# world. So, its a fairly basic question. Please help me understand the following code: @implementation MyView /*MyView inherits from NSView */ -(void)drawRect: (NSRect)aRect {

Re: Accessors Question

2008-06-12 Thread Jean-Daniel Dupas
Le 12 juin 08 à 19:21, Jeff LaMarche a écrit : Lately, I've started to see accessors of the following sort: - (NSString *)foo { return [[foo retain] autorelease]; } rather than just - (NSString *)foo { return foo; } What is the purpose or benefit of doing this? It seems to m

Re: Simple question - Subclassing NSView

2008-06-12 Thread Randall Meadows
On Jun 12, 2008, at 10:26 AM, Vikas wrote: I have recently started programming on Mac using Objective-C and Cocoa. I am coming from C++/C# world. So, its a fairly basic question. Please help me understand the following code: @implementation MyView /*MyView inherits from NSView */ -(v

Re: Accessors Question

2008-06-12 Thread Andy Lee
On Jun 12, 2008, at 1:21 PM, Jeff LaMarche wrote: Lately, I've started to see accessors of the following sort: - (NSString *)foo { return [[foo retain] autorelease]; } I believe this is in case of something like this: NSString *myFoo = [myObject foo]; // ... stuff that causes myObj

Re: Simple question - Subclassing NSView

2008-06-12 Thread Hamish Allan
Hi Vikas, On Thu, Jun 12, 2008 at 6:26 PM, Vikas <[EMAIL PROTECTED]> wrote: > I have recently started programming on Mac using Objective-C and Cocoa. I am > coming from C++/C# world. So, its a fairly basic question. Please help me > understand the following code: > > @implementation MyView

Re: Authentication and NSURLConnection sendSynchronousRequest

2008-06-12 Thread Paul E. Robichaux
On 6/12/08 12:44 PM, "Jens Alfke" <[EMAIL PROTECTED]> wrote: > > On 12 Jun '08, at 8:35 AM, Paul E. Robichaux wrote: > >> @implementation NSURLRequest(NSHTTPURLRequest) >> + (BOOL)allowsAnyHTTPSCertificateForHost:(NSString *)host >> { >>return YES; >> } >> @end >> >> At the end of one of my

Re: Accessors Question

2008-06-12 Thread Bill Bumgarner
On Jun 12, 2008, at 10:21 AM, Jeff LaMarche wrote: Lately, I've started to see accessors of the following sort: - (NSString *)foo { return [[foo retain] autorelease]; } rather than just - (NSString *)foo { return foo; } What is the purpose or benefit of doing this? It seems to

Re: Simple question - Subclassing NSView

2008-06-12 Thread Shawn Erickson
On Thu, Jun 12, 2008 at 10:26 AM, Vikas <[EMAIL PROTECTED]> wrote: > Hi, > > I have recently started programming on Mac using Objective-C and Cocoa. I am > coming from C++/C# world. So, its a fairly basic question. Please help me > understand the following code: > > @implementation MyView /

Re: Simple question - Subclassing NSView

2008-06-12 Thread I. Savant
> I have recently started programming on Mac using Objective-C and Cocoa. I am > coming from C++/C# world. Recant, heretic! ;-) > In first line, I was expecting something like [self setColor:[NSColor > blackColor]]; (similar to this.color = NSColor.blackColor; in C#/C++) > how NSColor ob

Re: Accessors Question

2008-06-12 Thread Andy Lee
On Jun 12, 2008, at 1:31 PM, Jean-Daniel Dupas wrote: This is mainly to prevent this kind of issue: NSString *foo = [myObject foo]; [myObject setFoo:nil]; // setter release the foo ivar => foo is no longer pointing on a valid memory location. I hadn't thought of this case. Thanks for the po

Re: Simple question - Subclassing NSView

2008-06-12 Thread Vikas
O'kay, that was helpful. I still have one doubt. The declaration of NSRectFill is as below: void NSRectFill ( NSRect aRect ); NSRectFill() is a C function, not part of any class e.g. NSView. aRect is simply a struct which specify location points (doesnt contain reference of any wind

Re: Simple question - Subclassing NSView

2008-06-12 Thread Hamish Allan
On Thu, Jun 12, 2008 at 6:54 PM, Vikas <[EMAIL PROTECTED]> wrote: > NSRectFill() is a C function, not part of any class e.g. NSView. aRect is > simply a struct which specify location points (doesnt contain reference of > any window). How the function knows about the drawing surface, in which > win

Re: Authentication and NSURLConnection sendSynchronousRequest

2008-06-12 Thread Jens Alfke
On 12 Jun '08, at 10:35 AM, Paul E. Robichaux wrote: After doing that, I now get a compiler warning that there's a duplicate interface defined for NSURLRequest(NSHTTPURLRequest), You can get around that by changing the category name (the part in parentheses) to anything different. and

Re: NSTreeController's arrangedObjects returning _NSControllerTreeProxy for KVC path?

2008-06-12 Thread Quincey Morris
On Jun 12, 2008, at 08:35, Danny Price wrote: So the object is single-level tree where each leaf is the actual item selected? What I don't understand is why the same binding returns a different object in two cases? Why don't get this proxy object when I bind the view directly to the contr

Re: Simple question - Subclassing NSView

2008-06-12 Thread I. Savant
> NSRectFill() is a C function, not part of any class e.g. NSView. aRect is > simply a struct which specify location points (doesnt contain reference of > any window). How the function knows about the drawing surface, in which > window/surface to paint? Does it implicitly make use of some self

Re: Accessors Question

2008-06-12 Thread Jens Alfke
On 12 Jun '08, at 10:41 AM, Andy Lee wrote: I hadn't thought of this case. Thanks for the pointer to the docs -- I now see there is a vulnerability in the accessors I've been writing. This is kind of a religious issue. Some people like the safer accessors. Some people see them as a very e

Re: Simple question - Subclassing NSView

2008-06-12 Thread Kyle Sluder
On Thu, Jun 12, 2008 at 1:54 PM, Vikas <[EMAIL PROTECTED]> wrote: > NSRectFill() is a C function, not part of any class e.g. NSView. aRect is > simply a struct which specify location points (doesnt contain reference of > any window). How the function knows about the drawing surface, in which >

Re: Simple question - Subclassing NSView

2008-06-12 Thread Mike Abdullah
On 12 Jun 2008, at 10:54, Vikas wrote: O'kay, that was helpful. I still have one doubt. The declaration of NSRectFill is as below: void NSRectFill ( NSRect aRect ); NSRectFill() is a C function, not part of any class e.g. NSView. aRect is simply a struct which specify location points (d

Re: Simple question - Subclassing NSView

2008-06-12 Thread Jens Alfke
On 12 Jun '08, at 10:54 AM, Vikas wrote: How the function knows about the drawing surface, in which window/ surface to paint? There's always a current graphics context; it's global to each thread. (See NSGraphicsContext if you want to look at its API; but if you're looking for the low-lev

Re: Authentication and NSURLConnection sendSynchronousRequest

2008-06-12 Thread Paul E. Robichaux
On 6/12/08 2:18 PM, "Jens Alfke" <[EMAIL PROTECTED]> wrote: > > On 12 Jun '08, at 10:35 AM, Paul E. Robichaux wrote: > >> After doing that, I now get a compiler warning that there's a >> duplicate >> interface defined for NSURLRequest(NSHTTPURLRequest), > > You can get around that by changing t

Re: Simple question - Subclassing NSView

2008-06-12 Thread Andy Lee
On Jun 12, 2008, at 2:20 PM, I. Savant wrote: NSRectFill() is a C function, not part of any class e.g. NSView. aRect is simply a struct which specify location points (doesnt contain reference of any window). How the function knows about the drawing surface, in which window/surface to paint?

Re: Accessors Question

2008-06-12 Thread Tito Ciuro
Hello, Although I prefer the safer accessors, there has been one case where I had no choice but to return the main object pointer: - (NSString *)foo { return foo; } In my app I had a method that was populating a custom cell with a few elements. Depending on the data source, I had t

[Job Posting] Openings for students and/or post-doc in medical imaging lab, Montreal Canada

2008-06-12 Thread Rick Hoge
Hi - I have openings for students and one post-doc in my lab at the University of Montreal. We develop MRI and optical imaging techniques for characterizing how the brain works, as well as a number of Cocoa- based analysis and visualization tools. We are funded by the Canadian Institute

Re: Accessors Question

2008-06-12 Thread Jeff LaMarche
Out of curiosity, does anyone know what the synthesized accessors look like when you specify retain? Are they The safe or unsafe ones? Sent from my iPhone On Jun 12, 2008, at 12:02 PM, Tito Ciuro <[EMAIL PROTECTED]> wrote: Hello, Although I prefer the safer accessors, there has been one cas

Re: Identical events on multiple calendars

2008-06-12 Thread Nick Zitzmann
On Jun 12, 2008, at 1:30 PM, Larry Hendricks wrote: I'd consider this a bug although it seems like it may be by design. Should I file it, or is there a workaround? Technically that's not a bug, but I'd suggest filing an enhacement request asking that calendars become identity properties o

Re: Accessors Question

2008-06-12 Thread mmalc crawford
On Jun 12, 2008, at 12:20 PM, Jeff LaMarche wrote: Out of curiosity, does anyone know what the synthesized accessors look like when you specify retain? Are they ' The retain/autorelease policy is dictated by the atomicity of the property. By default, object properties are returned with reta

Re: Troubles with CollectionView and IKImageBrowserView

2008-06-12 Thread Manuel
Thank you for your tips! But I didn't understand everything. Do you tried this in a sampleproject which you can send me? If I initialize the imageBrowser in my MYNSCollectionViewItem and set the datasource, the datasource methods will now be called correctly. Thank you. But it seems that th

Re: argument checks

2008-06-12 Thread Ken Thomases
On Jun 12, 2008, at 2:29 AM, Graham Cox wrote: On 12 Jun 2008, at 5:03 pm, Chris Suter wrote: In the original example, myNum was being passed as a argument rather than having a message to sent to it and it’s often not safe to pass nil objects as arguments. Hmmm... well, what's the functio

Re: removeFrameUsingName: doesn't?

2008-06-12 Thread Mike Fischer
Am 28.02.2008 um 23:17 schrieb Quincey Morris <[EMAIL PROTECTED]>: On Feb 28, 2008, at 12:25, Mike Fischer wrote: OK, nobody answered so I did a further test: ... Then I relaunched the app, used the IBAction to remove the Auto Save Name and quit the app again. The key was still there! So i

Re: Memory not freed with CIImage

2008-06-12 Thread Stefano Falda
WOW it worked! Thank you very much... Anyone filed a bug notice of this to Apple? Thanks to everybody for the suggestions Stefano On 12/giu/08, at 11:51, Fabian wrote: From the archives, originally posted by Rob Keniger: I had problems with this too, and I use a workaround I found somewhere

how do you make NIB connections for class with multiple categories (and their headers)?

2008-06-12 Thread Paul Archibald
I am trying to understand the NIB/code connection. I have a couple of windows in this project, one of which I am working on, the other I have been leaving alone. For MyWindow, I have been adding methods in my category.h file, and dragging that header to the nib, and linking up the contro

Re: how do you make NIB connections for class with multiple categories (and their headers)?

2008-06-12 Thread Jens Alfke
On 12 Jun '08, at 4:43 PM, Paul Archibald wrote: But what about a project like this, with a bunch of different header files, all of which are part of the same controller? Do I select all the header files in the Xcode project and drag all of them into the nib-instance window? And, when I do

Re: argument checks

2008-06-12 Thread William Squires
I thought ObjC used "#import", not "#include", so that multiple copies of a header wouldn't appear, but maybe that's just for Cocoa stuff, and not for "ordinary" C? On Jun 12, 2008, at 1:05 AM, Jason Coco wrote: #include /* ... */ NSNumber *myNum = nil; // Lots of code where you've forg

Re: argument checks

2008-06-12 Thread Michael Watson
You can use #import in straight C applications from within Xcode, if you like. There's also nothing stopping you from using the #include directive in Objective-C. It's just more work than #import, which handles include cycles for you. -- m-s On 12 Jun, 2008, at 21:37, William Squires wro

Attack My Code! Part 1

2008-06-12 Thread Charles Jenkins
I'm new at programming in Cocoa, and if it is not rude to post a big block of code to this list, I'd like to show you all a class I developed and ask you to tell me about all the ways I've screwed it up! BACKGROUND INFO I'm trying to learn Chinese and I have a bunch of comic books to (try

Attack My Code! Part 1 (postscript)

2008-06-12 Thread Charles Jenkins
Oops, I forgot to mention, I'm using garbage collection so that I won't have to struggle with retention! I wish I had edited my previous post a bit more for clarity, but it's late and I gotta get to bed. ___ Cocoa-dev mailing list (Cocoa-dev@lists

Have questions...

2008-06-12 Thread Rick Langschultz
Am I aloud to ask where I can submit my iPhone programming questions to? ___ 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.app

Re: Have questions...

2008-06-12 Thread Andrew Farmer
On 12 Jun 08, at 21:09, Rick Langschultz wrote: Am I aloud to ask where I can submit my iPhone programming questions to You're certainly allowed to ask. However, the answer is "nobody, for now" - sorry. Hopefully this'll change in a month or so... ___

Re: Have questions...

2008-06-12 Thread Kyle Sluder
On Fri, Jun 13, 2008 at 12:43 AM, Andrew Farmer <[EMAIL PROTECTED]> wrote: > You're certainly allowed to ask. However, the answer is "nobody, for now" - > sorry. Hopefully this'll change in a month or so... I thought the official answer was to e-mail DTS directly. Then again I'm not an iPhone dev

Re: Table View/Array Troubles

2008-06-12 Thread Kyle Sluder
On Thu, Jun 12, 2008 at 2:00 AM, Bob Warwick <[EMAIL PROTECTED]> wrote: > Calling the NSMutableArray convenience method array will return an > autoreleased object. You should do this instead: > >- (id) init >{ >[super init]; >myNotes = [[NSMutableArr

Re: Have questions...

2008-06-12 Thread Andrew Farmer
On 12 Jun 08, at 22:16, Kyle Sluder wrote: On Fri, Jun 13, 2008 at 12:43 AM, Andrew Farmer <[EMAIL PROTECTED]> wrote: You're certainly allowed to ask. However, the answer is "nobody, for now" - sorry. Hopefully this'll change in a month or so... I thought the official answer was to e-mail D

Control USB Power

2008-06-12 Thread Omar Qazi
Hey, I have a Cocoa application that controls an external USB device. I want to be able to turn the device off when the user performs some action, like click a button. Is there a way in Cocoa or IOKit to disable power to a USB Socket? The application runs on Leopard. Thanks in advance, Om

Re: Control USB Power

2008-06-12 Thread David Duncan
On Jun 12, 2008, at 10:38 PM, Omar Qazi wrote: I have a Cocoa application that controls an external USB device. I want to be able to turn the device off when the user performs some action, like click a button. Is there a way in Cocoa or IOKit to disable power to a USB Socket? The applicatio

Re: Control USB Power

2008-06-12 Thread Mike Abdullah
On 12 Jun 2008, at 23:01, David Duncan wrote: On Jun 12, 2008, at 10:38 PM, Omar Qazi wrote: I have a Cocoa application that controls an external USB device. I want to be able to turn the device off when the user performs some action, like click a button. Is there a way in Cocoa or IOKit t

Re: Control USB Power

2008-06-12 Thread Robert Douglas
I assume you are talking about an external piece of equipment, not a USB hub etc. Some pieces of equipment have USB interfaces, but I suspect many can not turn themselves on and off in response to a USB command. Macs can, but that may be rare. Even so it would be worth checking the manual

Re: Table View/Array Troubles

2008-06-12 Thread Bob Warwick
On 13-Jun-08, at 2:21 AM, Kyle Sluder wrote: On Thu, Jun 12, 2008 at 2:00 AM, Bob Warwick <[EMAIL PROTECTED]> wrote: Calling the NSMutableArray convenience method array will return an autoreleased object. You should do this instead: - (id) init { [super init];