Re: UTI Example

2008-08-22 Thread Adam R. Maxwell
On Aug 22, 2008, at 10:42 PM, Adam Thorsen wrote: Are there any examples of using the UTI API to determine the UTI given a path to a file? On 10.4 and later, use LSCopyItemAttribute: FSRef fileRef; /* assuming valid fileRef */ CFStringRef theUTI; LSCopyItemAttribute(&fileRef, kLSRolesAll, k

UTI Example

2008-08-22 Thread Adam Thorsen
Are there any examples of using the UTI API to determine the UTI given a path to a file? Thanks, -Adam ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators

Re: Incorrect instance of custom view loading after unarchiving

2008-08-22 Thread Quincey Morris
On Aug 22, 2008, at 20:45, Sam Krishna wrote: OK, I've read all the email from the past month about Aaron's challenge in Ch. 18 of Cocoa Programming. I've got a custom view (OvalView) where the magic happens. I've got Undo working, but I can't get the app to load a saved document b/c it kee

Re: !foo vs foo == nil

2008-08-22 Thread Todd Blanchard
Wow, I'm simply blown away at the level of confusion. I've been doing C for a long long time. Prior to C99 there was no boolean type in C. I have never missed it. I have never ever seen a bug introduced by doing code like if(foo) or if(!foo) I have seen a large number of bugs introduced b

Incorrect instance of custom view loading after unarchiving

2008-08-22 Thread Sam Krishna
Hi all, OK, I've read all the email from the past month about Aaron's challenge in Ch. 18 of Cocoa Programming. I've got a custom view (OvalView) where the magic happens. I've got Undo working, but I can't get the app to load a saved document b/c it keeps loading the wrong instance of Ova

Re: ObjC 2.0, properties, KVC, special _ hacks etc.

2008-08-22 Thread Ian Joyner
On 22/08/2008, at 12:59 PM, Thomas Engelmeier wrote: Am 22.08.2008 um 00:59 schrieb Dave MacLachlan: Also, are the _ in front of member variables for Apple only (so we don't stomp on each other with member var names) or are they using them for the readability reason mentioned above? There i

Re: NSMenuItem - setHidden

2008-08-22 Thread Jonathan Hess
On Aug 22, 2008, at 6:15 PM, Graham Cox wrote: On 23 Aug 2008, at 5:30 am, chaitanya pandit wrote: [itemToBeHidden setAutoEnablesItems:NO]; Don't call setAutoEnblesItems on the item you want to hide (NSMenuItem) call it on the menu to which the item belongs (or is gonna get added

Re: NSMenuItem - setHidden

2008-08-22 Thread Graham Cox
On 23 Aug 2008, at 11:15 am, Graham Cox wrote: -setAutoEnablesItems: doesn't affect visible/hidden, it affects checked/unchecked. So it's unlikely to bear on this problem. Oops, correction - it affects greyed out/not greyed out. But not visible/hidden. Graham ___

Re: Object change to NSView update

2008-08-22 Thread Graham Cox
On 23 Aug 2008, at 3:21 am, Paul Bruneau wrote: But I do like your suggestion because it is a way that I might come up with, but I'm nervous that it isn't the Right Way. Well, it's not The Right Way™ as written because each object is shown to have a ref to a view, which you definitely don

Re: NSMenuItem - setHidden

2008-08-22 Thread Graham Cox
On 23 Aug 2008, at 5:30 am, chaitanya pandit wrote: [itemToBeHidden setAutoEnablesItems:NO]; Don't call setAutoEnblesItems on the item you want to hide (NSMenuItem) call it on the menu to which the item belongs (or is gonna get added- NSMenu class) -setAutoEnablesItems: doesn't

Re: Custom view instantiated twice?

2008-08-22 Thread Andy Lee
On Aug 22, 2008, at 7:49 PM, Nick Pilch wrote: I have an NSView subclass defined in IB. It's a custom object in my nib and it's a child of a window's content view. You answered your own question. The custom object is a separate instance from the one you created within your window. You coul

Custom view instantiated twice?

2008-08-22 Thread Nick Pilch
I have an NSView subclass defined in IB. It's a custom object in my nib and it's a child of a window's content view. I have an outlet defined in the NSView subclass that's bound to a static text field within my custom view. Upon running the app, two instances of my custom NSView class are

Getting the active web page edit field for a WebView

2008-08-22 Thread Mike
I need to get the currently active edit field on a web page in my WebView (or nil if no edit field is active). Is there an easy way to do this without having to dive into the DOM? Thanks, Mike ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: Two questions about CoreData migration

2008-08-22 Thread Quincey Morris
On Aug 22, 2008, at 12:14, Timothy Larkin wrote: The first question is a simple one. After migration, the old persistent store is renamed sourceURL~.xml, and the document is supposed to open with a new persistent store with the old url, sourceURL.xml,. However, the document window that appe

Re: File Extensions Problem

2008-08-22 Thread Thomas Engelmeier
Am 22.08.2008 um 17:23 schrieb Michael Ash: On Fri, Aug 22, 2008 at 6:23 AM, Graham Cox <[EMAIL PROTECTED]> wrote: safe to delete items in the array at or higher than the current index. By the definition of an array, removing an item only affects the indexes of objects with equal or great

Re: Displaying time

2008-08-22 Thread Ron Fleckner
On 23/08/2008, at 1:18 AM, Michael Ash wrote: On Fri, Aug 22, 2008 at 8:51 AM, Ron Fleckner <[EMAIL PROTECTED]> wrote: Is there a way to update the time without using an NSTimer? I'd like my clock to be synchronised with the menu bar clock. Maybe this isn't a Cocoa question. Thanks for

Re: Preventing windows from being dragged

2008-08-22 Thread Ricky Sharp
On Aug 22, 2008, at 2:46 PM, Charles Srstka wrote: On Aug 21, 2008, at 10:02 PM, Ricky Sharp wrote: (1) never ever ever capture the display when using AppKit. This appears to be incorrect, as Apple seems to endorse and even provides sample code for capturing the screen while using AppKit:

NSURLDownload Tiger Leopard

2008-08-22 Thread Vladimir Sokolov
Hello, I have made a software to download a file from the http server. Connection to the server require authentication. I use standard NSURLDownload and delegate method didReceiveAuthenticationChallenge to authenticate. On Leopard it works just fine. On Tiger it present authentication error.

Two questions about CoreData migration

2008-08-22 Thread Timothy Larkin
The first question is a simple one. After migration, the old persistent store is renamed sourceURL~.xml, and the document is supposed to open with a new persistent store with the old url, sourceURL.xml,. However, the document window that appears after migration has the title sourceURL~.xml,

CollectionView, PopupButton, CoreData and Bindings

2008-08-22 Thread Mark Berthold-Losleben
Hi everone, I am trying to insert a PopupButton in the prototype of my collectionView with CoreData and binding. I have the following data model: Entity "Author" with the property "name" and the to-many-relationship "books" (-> to Entity "Book") Entity "Book" with property "title" and to-o

Re: Preventing windows from being dragged

2008-08-22 Thread Ricky Sharp
On Aug 22, 2008, at 2:13 PM, Charles Srstka wrote: On Aug 21, 2008, at 10:02 PM, Ricky Sharp wrote: Creating a non-movable, non-titled window is _trivial_. Just create a tiny subclass and away you go. I do this myself, along with following the guidelines of that technote. Why would it b

Re: File Extensions Problem

2008-08-22 Thread Charles Srstka
On Aug 22, 2008, at 10:39 AM, Andrew Merenbach wrote: To build on this, doesn't fast enumeration (Leopard-only, of course) raise an exception if a value is modified while the enumeration is running? (Not tested personally by me, but building upon an earlier thread from a little while back.

Re: NSMenuItem - setHidden

2008-08-22 Thread Peter Ammon
On Aug 22, 2008, at 6:28 AM, Stuart Green wrote: Hi, I've got a menu item in my app's root menu that I want to hide. I've referenced it as an IBOutlet as per: IBOutlet id itemToBeHidden; I'm trying to hide it as per: [itemToBeHidden setHidden:YES]; Problem is, item does no

Re: Preventing windows from being dragged

2008-08-22 Thread Thomas Engelmeier
Am 22.08.2008 um 05:31 schrieb Kyle Sluder: . In my mind, I have a choice: either make the control interface a standard OS X app, allowing users the full functionality of the computer, or make a kiosk app that runs on some stripped-down Linux distribution in single-user mode. I still haven't

Re: Preventing windows from being dragged

2008-08-22 Thread Jason Coco
On Aug 22, 2008, at 15:46 , Charles Srstka wrote: On Aug 21, 2008, at 10:02 PM, Ricky Sharp wrote: (1) never ever ever capture the display when using AppKit. This appears to be incorrect, as Apple seems to endorse and even provides sample code for capturing the screen while using AppKit:

Re: failing opening socket

2008-08-22 Thread Jason Coco
On Aug 22, 2008, at 13:12 , Luca Ciciriello wrote: Hi all. I'm porting a Linux project (using sockets to implement a ping function) on Mac OS X. My problem is that the function: int sock_icmp = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); returns always -1. Where is my mistake? For me is the

Leopard crash in CFRunLoopAddObserver()

2008-08-22 Thread Rangaswamy C T
Hi All, I am sorry if I have posted to cross dev-lists. I am in a very strange situation. I am bit new to Mac. I had an existing desktop application. I wanted to run this application inside Firefox process for some requirement. So I just built my existing application as bundle and started runn

Re: Preventing windows from being dragged

2008-08-22 Thread Andy Lee
On Aug 22, 2008, at 3:13 PM, Charles Srstka wrote: On Aug 21, 2008, at 10:02 PM, Ricky Sharp wrote: Creating a non-movable, non-titled window is _trivial_. Just create a tiny subclass and away you go. I do this myself, along with following the guidelines of that technote. Why would it b

Re: Preventing windows from being dragged

2008-08-22 Thread Charles Srstka
On Aug 21, 2008, at 10:02 PM, Ricky Sharp wrote: (1) never ever ever capture the display when using AppKit. This appears to be incorrect, as Apple seems to endorse and even provides sample code for capturing the screen while using AppKit: http://developer.apple.com/documentation/Cocoa/Conc

Re: NSMenuItem - setHidden

2008-08-22 Thread chaitanya pandit
On 22-Aug-08, at 1:34 PM, Stuart Green wrote: Cheers, Tried: [itemToBeHidden setAutoEnablesItems:NO]; Don't call setAutoEnblesItems on the item you want to hide (NSMenuItem) call it on the menu to which the item belongs (or is gonna get added- NSMenu class) [itemToBeHidde

Re: Preventing windows from being dragged

2008-08-22 Thread Charles Srstka
On Aug 21, 2008, at 10:02 PM, Ricky Sharp wrote: Creating a non-movable, non-titled window is _trivial_. Just create a tiny subclass and away you go. I do this myself, along with following the guidelines of that technote. Why would it be necessary to make a subclass? Shouldn't it be possib

Cloning of cocoa screensaver to windows/linux(KDE)

2008-08-22 Thread John Musbach
It seems that finding someone who is both well versed in Cocoa and in the windows api or linux KDE screensaver API is a bit tricky. I was wondering if anyone here is capable of porting a cocoa screensaver to Windows or Linux (KDE environment)? I'd like Moire X to be ported over to both environments

Re: Object change to NSView update

2008-08-22 Thread Ken Thomases
On Aug 22, 2008, at 12:18 PM, Paul Bruneau wrote: Yes I think we agree on that part! The problem I am trying to communicate is where do I learn to make my model changes go through a controller, and how do I teach this controller to know to update the other views? As I said, I think I could

Re: failing opening socket

2008-08-22 Thread Nick Zitzmann
On Aug 22, 2008, at 11:12 AM, Luca Ciciriello wrote: int sock_icmp = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); returns always -1. Where is my mistake? For me is the very first time using socket on Mac. Is your application running as root? Attempts to create raw sockets don't work if you

Re: Tabbed preference panels

2008-08-22 Thread Matt Ball
It's also worth noting that Dave Batton has a class+tutorial on his site that takes care of this for you: http://www.mere-mortal-software.com/blog/details.php?d=2007-03-14 However, it would probably be best to roll your own implementation at least once, so you know how it works under the hood. Then

Re: NSMenuItem - setHidden

2008-08-22 Thread Andy Lee
On Aug 22, 2008, at 9:28 AM, Stuart Green wrote: I've got a menu item in my app's root menu that I want to hide. I've referenced it as an IBOutlet as per: IBOutlet id itemToBeHidden; Any reason you don't declare this as an NSMenuItem? Doing so would give you a little protection fro

Re: WebFrame stopLoading in delegate crashes app

2008-08-22 Thread Nick Zitzmann
On Aug 22, 2008, at 4:18 AM, Ewan McDougall wrote: Calling [WebFrame stopLoading] within the delegate didStartProvisionalLoadForFrame crashes the app. Is this a bug or am I doing something silly? What's the backtrace? If it's within the WebKit framework, then you should probably conside

Re: NSMenuItem - setHidden

2008-08-22 Thread Stuart Green
Cheers, Tried: [itemToBeHidden setAutoEnablesItems:NO]; [itemToBeHidden setHidden:YES]; Still doesn't work. Couldn't see any options in IB to set this. Stu On 22 Aug 2008, at 18:26, chaitanya pandit wrote: Set the menuitem's menu's setAutoEnablesItems to NO Or you may have

Re: NSMenuItem - setHidden

2008-08-22 Thread chaitanya pandit
Set the menuitem's menu's setAutoEnablesItems to NO Or you may have an option to do so in IB itself On 22-Aug-08, at 9:28 AM, Stuart Green wrote: Hi, I've got a menu item in my app's root menu that I want to hide. I've referenced it as an IBOutlet as per: IBOutlet id itemToBeHidden;

Re: Object change to NSView update

2008-08-22 Thread Paul Bruneau
On Aug 22, 2008, at 11:19 AM, Graham Cox wrote: On 23 Aug 2008, at 12:58 am, Paul Bruneau wrote: I think I could maybe (maybe!) figure out how do this for the order (the table's selection), but I am totally lost as to how I would do it for the order's great-grandchildren order steps. Dat

Re: Object change to NSView update

2008-08-22 Thread Paul Bruneau
On Aug 22, 2008, at 12:09 PM, Kyle Sluder wrote: On Fri, Aug 22, 2008 at 10:58 AM, Paul Bruneau <[EMAIL PROTECTED]> wrote: I am forcing the view to update after a change to one of the order step objects in what I am sure is The Wrong Way™ by basically chucking setNeedsDisplay into areas of my

failing opening socket

2008-08-22 Thread Luca Ciciriello
Hi all. I'm porting a Linux project (using sockets to implement a ping function) on Mac OS X. My problem is that the function: int sock_icmp = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP); returns always -1. Where is my mistake? For me is the very first time using socket on Mac. Thanks in advance

Re: Tabbed preference panels

2008-08-22 Thread Greg Titus
You may also want to take a look at OmniAppKit's OAPreferences implementation: . Hope this helps, - Greg On Aug 22, 2008, at 9:29 AM, Sumner Trammell wrote: Hi, I'm working on a preferences panel. I want to build a compound panel like the kind see

Noobie CalEvent question

2008-08-22 Thread kenbotwinick
Hi All, I'm just starting out with the intent of building a meal planning app using Core Data and the Calendar Store. Instead of having a date property for my Meal entity, I was thinking I wanted to use a CalEvent. That way I can change the date and time from my app or iCal, easily implem

NSMenuItem - setHidden

2008-08-22 Thread Stuart Green
Hi, I've got a menu item in my app's root menu that I want to hide. I've referenced it as an IBOutlet as per: IBOutlet id itemToBeHidden; I'm trying to hide it as per: [itemToBeHidden setHidden:YES]; Problem is, item does not hide. Any ideas? Thanks, Stu __

Beginners problem: setKeyEquivalent in controlTextEndEditing method (NSComboBox)

2008-08-22 Thread Nenad Milevoj
Hi, in my project I have a window with 1 combobox and 2 buttons. Buttons are 'Cancel' and 'Ok'. This is a sort of login window. Combobox uses PGresult (PostgreSQL result) as data source and has autocomplete set to YES. Button 'Ok' is disabled and is programatically enabled if criteria is me

SSDP / UPNP

2008-08-22 Thread Jeremy
Hi. I am working on a project where I need to access a UPNP device on a local network. What is the best way to discover this device using SSDP and then interact with it (shared directory on the device)? Thanks in advance. -Jeremy ___ Cocoa-dev

Re: Tabbed preference panels

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 18:29 schrieb Sumner Trammell: Hi, I'm working on a preferences panel. I want to build a compound panel like the kind seen in most mainstream apps today: a toolbar on top with "tabbed" view switching. The panel changes its appearance depending on which 32x32 toolbar icon you

Re: [moderator] Re: reusing cookies set in UIWebView

2008-08-22 Thread Scott Anguish
No, not at this time. On 22-Aug-08, at 10:48 AM, John Greene wrote: Is any information available about when that NDA will be lifted? Thanks, John Scott Anguish wrote: the reason you can't find this information is that the iPhone SDK is still under non-disclosure. You can't talk about it he

Tabbed preference panels

2008-08-22 Thread Sumner Trammell
Hi, I'm working on a preferences panel. I want to build a compound panel like the kind seen in most mainstream apps today: a toolbar on top with "tabbed" view switching. The panel changes its appearance depending on which 32x32 toolbar icon you have selected. I'm not sure where to start. Looking f

Re: NSString and special characters

2008-08-22 Thread Bill Bumgarner
On Aug 22, 2008, at 7:54 AM, Joeles Baker wrote: Just read through the book. I really wonder, what the author of the foreword (obviously an apple employee) thought, when Mac OS X was announced :-) Is this really true? Is Unix "defective by design" ? :-) Amazingly powerful tool, easy to remov

Re: File Extensions Problem

2008-08-22 Thread Sherm Pendley
On Fri, Aug 22, 2008 at 11:39 AM, Andrew Merenbach <[EMAIL PROTECTED]> wrote: > > To build on this, doesn't fast enumeration (Leopard-only, of course) raise > an exception if a value is modified while the enumeration is running? (Not > tested personally by me, but building upon an earlier thread f

Re: Object change to NSView update

2008-08-22 Thread Kyle Sluder
On Fri, Aug 22, 2008 at 10:58 AM, Paul Bruneau <[EMAIL PROTECTED]> wrote: > I am forcing the view to update after a change to one of the order step > objects in what I am sure is The Wrong Way™ by basically chucking > setNeedsDisplay into areas of my code such as the contextual menu handling > code

Re: Object change to NSView update

2008-08-22 Thread Paul Bruneau
On Aug 22, 2008, at 11:09 AM, Jonathan del Strother wrote: How about having the object post an NSNotification whenever it's changed? Your controller can observe the notification & call setNeedsDisplay accordingly. If you're posting a lot of notifications at the same time, you might look at coal

Re: File Extensions Problem

2008-08-22 Thread Andrew Merenbach
On Aug 22, 2008, at 8:23 AM, Michael Ash wrote: On Fri, Aug 22, 2008 at 6:23 AM, Graham Cox <[EMAIL PROTECTED]> wrote: -reverseObjectEnumerator is no different, because it "lets you access each object in the receiver, in order, from the element at the highest index down to the element at in

Re: File Extensions Problem

2008-08-22 Thread Michael Ash
On Fri, Aug 22, 2008 at 6:23 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > -reverseObjectEnumerator is no different, because it "lets you access each > object in the receiver, in order, from the element at the highest index down > to the element at index 0". This statement will hold true for any fu

Re: Object change to NSView update

2008-08-22 Thread Graham Cox
On 23 Aug 2008, at 12:58 am, Paul Bruneau wrote: I think I could maybe (maybe!) figure out how do this for the order (the table's selection), but I am totally lost as to how I would do it for the order's great-grandchildren order steps. Data structure? Does an order keep a list of its ch

Re: Displaying time

2008-08-22 Thread Michael Ash
On Fri, Aug 22, 2008 at 8:51 AM, Ron Fleckner <[EMAIL PROTECTED]> wrote: > Is there a way to update the time without using an NSTimer? I'd like my > clock to be synchronised with the menu bar clock. Maybe this isn't a Cocoa > question. Thanks for your answers. It's pretty simple. Use a *non* re

Re: Object change to NSView update

2008-08-22 Thread Jonathan del Strother
On Fri, Aug 22, 2008 at 3:58 PM, Paul Bruneau <[EMAIL PROTECTED]> wrote: > I feel I can nearly grasp what I need to do, but not quite. I know what I > shouldn't be doing--which is what I am doing and I feel I'm a little in the > weeds. I seek a nudge in the right direction if someone can help. > >

Object change to NSView update

2008-08-22 Thread Paul Bruneau
I feel I can nearly grasp what I need to do, but not quite. I know what I shouldn't be doing--which is what I am doing and I feel I'm a little in the weeds. I seek a nudge in the right direction if someone can help. I have a master-detail setup with a normal table displaying a list of ord

Re: File Extensions Problem

2008-08-22 Thread Adam R. Maxwell
On Aug 22, 2008, at 2:27 AM, Phil wrote: On Fri, Aug 22, 2008 at 6:29 PM, Adil Saleem <[EMAIL PROTECTED]> wrote: Currently what i am doing is that i am getting the file names in an NSMutableArray using NSFileManager function directoryContentsAtPath I get the list, but the problem is that i

Re: [moderator] Re: reusing cookies set in UIWebView

2008-08-22 Thread John Greene
Is any information available about when that NDA will be lifted? Thanks, John Scott Anguish wrote: > the reason you can't find this information is that the iPhone SDK is > still under non-disclosure. > > You can't talk about it here or anywhere publicly. > > scott > [moderator] > > > On 21-Aug-0

Re: Preventing windows from being dragged

2008-08-22 Thread Steve Christensen
On Aug 21, 2008, at 8:31 PM, Kyle Sluder wrote: On Thu, Aug 21, 2008 at 11:18 PM, Steve Christensen <[EMAIL PROTECTED]> wrote: The great majority of Mac applications do not run in kiosk mode so for most cases preventing window movement *is* wrong because you take control away from the user

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 16:15 schrieb Graham Cox: On 23 Aug 2008, at 12:04 am, Negm-Awad Amin wrote: This is what a analog PLL do, when it loads/unloads a ramp. Analogue PLL design (Audio to GHz RF) were my bread-and-butter for many years, so do be careful not to teach your granny to suck e

Re: Displaying time

2008-08-22 Thread Graham Cox
On 23 Aug 2008, at 12:04 am, Negm-Awad Amin wrote: This is what a analog PLL do, when it loads/unloads a ramp. Analogue PLL design (Audio to GHz RF) were my bread-and-butter for many years, so do be careful not to teach your granny to suck eggs here ;-) If the system is busy, every tim

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Sorry for sending the responds solely to Graham: Am Fr,22.08.2008 um 15:53 schrieb Graham Cox: On 22 Aug 2008, at 11:39 pm, Negm-Awad Amin wrote: I think, that a higher event-frequency is not neccessary. He should use an interval of close to one second (something like 0.99 seconds). In hi

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 16:00 schrieb Graham Cox: On 22 Aug 2008, at 11:54 pm, Negm-Awad Amin wrote: This is not ugly, but the starting point for a software PLL. Well, there's no "loop" to phase lock here. This was the reason for me, to write: "starting point". Look to my newer answer. Th

Re: Displaying time

2008-08-22 Thread Ron Fleckner
On 22/08/2008, at 11:28 PM, Graham Cox wrote: On 22 Aug 2008, at 10:55 pm, Ron Fleckner wrote: Sorry, my question was very badly put. I've already apologised to two other answerers. I should have said: Is there a better way - other than using an NSTimer - to update the clock? That is,

Re: Displaying time

2008-08-22 Thread Graham Cox
On 22 Aug 2008, at 11:54 pm, Negm-Awad Amin wrote: This is not ugly, but the starting point for a software PLL. Well, there's no "loop" to phase lock here. The PLL analogy might hold up if you used your timer to measure the interval between changes of the clock, then use that to change t

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 15:52 schrieb Thomas Davie: On 22 Aug 2008, at 15:47, Negm-Awad Amin wrote: Am Fr,22.08.2008 um 15:45 schrieb Thomas Davie: Using a timer isn't too bad. Running at two updates per second should be acceptable since you're sampling at twice the highest "event" frequ

Re: Displaying time

2008-08-22 Thread Graham Cox
On 22 Aug 2008, at 11:39 pm, Negm-Awad Amin wrote: I think, that a higher event-frequency is not neccessary. He should use an interval of close to one second (something like 0.99 seconds). In his timer method he simply waits in a loop for the "tick tack" and displays the result. So he will

Re: Displaying time

2008-08-22 Thread Thomas Davie
On 22 Aug 2008, at 15:47, Negm-Awad Amin wrote: Am Fr,22.08.2008 um 15:45 schrieb Thomas Davie: Using a timer isn't too bad. Running at two updates per second should be acceptable since you're sampling at twice the highest "event" frequency. You might want to go a bit faster and maybe

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 15:45 schrieb Thomas Davie: Using a timer isn't too bad. Running at two updates per second should be acceptable since you're sampling at twice the highest "event" frequency. You might want to go a bit faster and maybe at a slightly odd multiple of one second to make

Re: Displaying time

2008-08-22 Thread Thomas Davie
Using a timer isn't too bad. Running at two updates per second should be acceptable since you're sampling at twice the highest "event" frequency. You might want to go a bit faster and maybe at a slightly odd multiple of one second to make sure you don't end up with a constant half-second

Re: Displaying time

2008-08-22 Thread Negm-Awad Amin
Am Fr,22.08.2008 um 15:28 schrieb Graham Cox: On 22 Aug 2008, at 10:55 pm, Ron Fleckner wrote: Sorry, my question was very badly put. I've already apologised to two other answerers. I should have said: Is there a better way - other than using an NSTimer - to update the clock? That is,

Re: Displaying time

2008-08-22 Thread Graham Cox
On 22 Aug 2008, at 10:55 pm, Ron Fleckner wrote: Sorry, my question was very badly put. I've already apologised to two other answerers. I should have said: Is there a better way - other than using an NSTimer - to update the clock? That is, how does the system clock do it? I think now

Re: NSString and special characters

2008-08-22 Thread Dave Dribin
On Aug 22, 2008, at 3:39 AM, Bill Bumgarner wrote: Have you read this book? http://tinyurl.com/6kxxgc And it's even available online, now: -Dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: Displaying time

2008-08-22 Thread Ron Fleckner
On 22/08/2008, at 10:38 PM, Gregory Weston wrote: Ron Fleckner wrote: I want to display the current time in a full screen window. I'm making my computer into a digital clock (for my own use). I've done it by using NSCalendarDate and extracting the hours, minutes, and seconds, formatting a s

Re: Displaying time

2008-08-22 Thread Ron Fleckner
On 22/08/2008, at 8:32 PM, Nathan Kinsinger wrote: On Aug 22, 2008, at 12:59 AM, Ron Fleckner wrote: Hi, I want to display the current time in a full screen window. I'm making my computer into a digital clock (for my own use). I've done it by using NSCalendarDate and extracting the ho

Re: NSString and special characters

2008-08-22 Thread Jason Coco
On Aug 22, 2008, at 05:26 , Vladimir Sokolov wrote: 2008/8/22, Bill Bumgarner <[EMAIL PROTECTED]>: On Aug 22, 2008, at 1:00 AM, Vladimir Sokolov wrote: Hello All, I am working on a command line tool. I use NSArray *params = [[NSProcessInfo processInfo] arguments] to get a list of command l

Re: Displaying time

2008-08-22 Thread Gregory Weston
Ron Fleckner wrote: I want to display the current time in a full screen window. I'm making my computer into a digital clock (for my own use). I've done it by using NSCalendarDate and extracting the hours, minutes, and seconds, formatting a string and displaying it. I use an NSTimer to update

Re: File Extensions Problem

2008-08-22 Thread Phil
On Fri, Aug 22, 2008 at 10:23 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > You shouldn't go modifying the array in general, for sure. But the special > case of modification by deleting the last item in the array is safe, and > always will be. In fact deleting any item with a higher index than curren

Object networks

2008-08-22 Thread Jason Wiggins
Hi everyone, I've been reading Object-Oriented Programming with Objective-C, Cocoa Fundamentals Guide and The Objective-C 2.0 Programming Language guide and I still have an unanswered question regarding object networks. Say I have my controller object "Controller", a model class "Model" a

Re: Displaying time

2008-08-22 Thread Graham Cox
On 22 Aug 2008, at 4:59 pm, Ron Fleckner wrote: My question is: Is there a better way to display what is essentially the same as the menu bar clock? I think only you can really answer that - after all you are the one making the clock app. What's "better" for you? Big digital 7-segment d

Re: Displaying time

2008-08-22 Thread Nathan Kinsinger
On Aug 22, 2008, at 12:59 AM, Ron Fleckner wrote: Hi, I want to display the current time in a full screen window. I'm making my computer into a digital clock (for my own use). I've done it by using NSCalendarDate and extracting the hours, minutes, and seconds, formatting a string and d

Re: File Extensions Problem

2008-08-22 Thread Graham Cox
On 22 Aug 2008, at 7:10 pm, Phil wrote: From the -reverseObjectEnumerator 'special considerations' section of the documentation: "When you use this method with mutable subclasses of NSArray, you must not modify the array during enumeration." You shouldn't go modifying the array in general, f

WebFrame stopLoading in delegate crashes app

2008-08-22 Thread Ewan McDougall
Hello, Using the WebKit I'd like to be able to look at the URL that a frame is loading and on some occasions stop the load. - (void)webView:(WebView *)sender didStartProvisionalLoadForFrame: (WebFrame *)frame { [frame stopLoading]; } Calling [WebFrame stopLoading] within the delegat

Re: File Extensions Problem

2008-08-22 Thread Phil
On Fri, Aug 22, 2008 at 6:29 PM, Adil Saleem <[EMAIL PROTECTED]> wrote: > Currently what i am doing is that i am getting the file names in an > NSMutableArray using NSFileManager function directoryContentsAtPath > > I get the list, but the problem is that it get all the files. I want only > those

Re: NSString and special characters

2008-08-22 Thread Vladimir Sokolov
2008/8/22, Bill Bumgarner <[EMAIL PROTECTED]>: > > On Aug 22, 2008, at 1:00 AM, Vladimir Sokolov wrote: > >> Hello All, >> >> I am working on a command line tool. I use >> NSArray *params = [[NSProcessInfo processInfo] arguments] >> to get a list of command line parameters. >> Then I use >> NSStri

Re: File Extensions Problem

2008-08-22 Thread Phil
On Fri, Aug 22, 2008 at 7:28 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > Or just use reverseObjectEnumerator. Removing the current iteration item > from the array while iterating backwards is OK. > Even going backwards, it's still not ok... >From the -reverseObjectEnumerator 'special consideratio

Re: NSString and special characters

2008-08-22 Thread Bill Bumgarner
On Aug 22, 2008, at 1:00 AM, Vladimir Sokolov wrote: Hello All, I am working on a command line tool. I use NSArray *params = [[NSProcessInfo processInfo] arguments] to get a list of command line parameters. Then I use NSString *param1 = [params objectAtIndex:1]; to get it. But when I pass for

Re: NSString and special characters

2008-08-22 Thread Michael Dautermann
On Aug 22, 2008, at 4:00 AM, Vladimir Sokolov wrote: But when I pass for example >...myapplication test$test param1 got "testest" instead of ""test$test" It means as I understand that $ is interpreted as special character. $ usually expands (or allows access to) a variable in a shell. Try

NSString and special characters

2008-08-22 Thread Vladimir Sokolov
Hello All, I am working on a command line tool. I use NSArray *params = [[NSProcessInfo processInfo] arguments] to get a list of command line parameters. Then I use NSString *param1 = [params objectAtIndex:1]; to get it. But when I pass for example >...myapplication test$test param1 got "testes

Re: !foo vs foo == nil

2008-08-22 Thread Jules Colding
On 22/08/2008, at 00.38, Andy Lee wrote: On Aug 21, 2008, at 3:42 PM, Jim Correia wrote: On Aug 21, 2008, at 3:54 AM, Jules Colding wrote: For that simple reason, I'd go for nil == foo every time. Yes, and in general you should always do "if (CONSTANT == foo)" to catch the potential "if (

Re: File Extensions Problem

2008-08-22 Thread Graham Cox
On 22 Aug 2008, at 5:22 pm, Andrew Merenbach wrote: Hi! It appears that you're removing an object from a mutable array while enumerating, so that will unfortunately not work. To modify your concept: NSMutableArray *myMutableArray = [myOriginalArray copy]; Or just use reverseObjectEnum

Re: File Extensions Problem

2008-08-22 Thread Andrew Merenbach
On Aug 22, 2008, at 12:10 AM, Michael Dautermann wrote: On Aug 22, 2008, at 2:29 AM, Adil Saleem wrote: Hi, I want to display in a tableview, list of all media files (audio, video files) present in a certain directory. Currently what i am doing is that i am getting the file names in an

Re: File Extensions Problem

2008-08-22 Thread Michael Dautermann
On Aug 22, 2008, at 2:29 AM, Adil Saleem wrote: Hi, I want to display in a tableview, list of all media files (audio, video files) present in a certain directory. Currently what i am doing is that i am getting the file names in an NSMutableArray using NSFileManager function directoryCont