Re: Calculate next occurrence of a NSDate

2010-12-31 Thread Tom Jones
Thanks for the help, Here is what I came up with and from my testing looks to work very well. - (NSInteger)weekDayFromDate:(NSDate *)aDate { NSCalendar *gregorianCal = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSDateComponents *components = [gregorianCal

Calculate next occurrence of a NSDate

2010-12-30 Thread Tom Jones
Hello, I'm trying to calculate next occurrence of a NSDate object. Based on a "Start Date" ( e.g. 2010-12-10, Friday ) I would like to know the date of the next Friday occurrence from today ( e.g. 2010-12-30, Thursday ). Example: StartDate = 2010-12-10 CurrentDate = 2010-12-30 Next Occurrence

Re: Ping host and port

2010-11-07 Thread Tom Jones
thanks a bunch, this is great! tom On Nov 7, 2010, at 2:40 PM, Dave Carrigan wrote: > > On Nov 7, 2010, at 2:31 PM, Kyle Sluder wrote: > >> On Nov 7, 2010, at 2:24 PM, Tom Jones wrote: >> >>> Ops, thanks! >>> >>> I have not really done mu

Re: Ping host and port

2010-11-07 Thread Tom Jones
Ops, thanks! I have not really done much with sockets. Is there an example you know of that I can learn from? Thanks, tom On Nov 7, 2010, at 2:14 PM, Dave Carrigan wrote: > On Nov 7, 2010, at 2:02 PM, Tom Jones wrote: >> Thanks, yes its a tcp port. I tried this but for some reason

Re: Ping host and port

2010-11-07 Thread Tom Jones
."); } [port release]; Thanks, tom On Nov 7, 2010, at 1:44 PM, Dave Carrigan wrote: > On Nov 7, 2010, at 1:35 PM, Tom Jones wrote: > >> I'm looking for a simple way to ping a host and a specific port on that >> host. I have SCNetworkCheckReachabilityByName working just

Ping host and port

2010-11-07 Thread Tom Jones
Hello, I'm looking for a simple way to ping a host and a specific port on that host. I have SCNetworkCheckReachabilityByName working just fine but I really need to test to see if the port is active. Thanks, tom___ Cocoa-dev mailing list (Cocoa-dev@lis

Re: NSError help

2010-10-25 Thread Tom Jones
[errorDetail setValue:@"Failed to find the requested type." forKey:NSLocalizedDescriptionKey]; *err = [NSError errorWithDomain:@"DataForType" code:1 userInfo:errorDetail]; } return nil; Thanks for the help, tom - Original Message - From: "Ken Thomases" To

NSError help

2010-10-24 Thread Tom Jones
Hello, I'm trying to understand why I'm getting thrown in to the debugger when using NSError. I have three methods and I'm overloading them and trying to pass the NSError along the way. What am I doing wrong? Thanks, tom Code: -(NSString *)getDataForType:(NSString *)aType error:(NSError **)er

Convert CFURLRef to NSURL

2010-09-12 Thread Tom Jones
Hello, I have been googling on how to convert a CFURLRef to NSURL. But it always seems to be the oposite that people are searching for. Thanks, tom ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator c

Re: Recursive file remove

2010-08-14 Thread Tom Jones
if it's a 10.4 I'm using system and on 10.5 and higher I'm using NSFileManager. Thanks, tom On Aug 14, 2010, at 2:33 PM, Charles Srstka wrote: > On Aug 14, 2010, at 4:01 PM, lbland wrote: > >> >> On Aug 14, 2010, at 2:28 PM, Tom Jones wrote: >> >&

Re: Recursive file remove

2010-08-14 Thread Tom Jones
Thanks, this helps a lot. What I'm looking to "remove" is my temp directory where I'm downloading files un-compressing them etc. Just good house keeping. I must admit having not been doing this long, and after Kyle's remark on "collected consulting fees" I'm surprised that there isn't a task a

Recursive file remove

2010-08-13 Thread Tom Jones
Hello, What is the best way to recursively remove a directory and all of it's sub directories and files, BTW I need to support 10.4 systems. Thanks, tom___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or modera

Unzip class/lib

2010-08-13 Thread Tom Jones
Hello, I have been googling for a little while now and I'm not finding the answers. Does Mac OS X have a unzip library to unzip the archives created in the GUI. I guess I could do the NSTask thing but I would rather not. I would also like to avoid a framework as well as my app is a Foundation to

Re: Global Object

2009-11-28 Thread Tom Jones
uff"];" in any of my classes. I have never really done this before. Should I just re-init it in each of my classes? Thanks, tom On Nov 27, 2009, at 11:10 PM, Jens Alfke wrote: > > On Nov 26, 2009, at 9:18 AM, Tom Jones wrote: > >> I thought I could just create a Global

Global Object

2009-11-26 Thread Tom Jones
I'm writing a Foundation tool and I want to create a global object which I can reference any where in my code. This is for logging, so I want to declare my logging object in my main method and use it in any of my classes. I thought I could just create a Global variable but that does not work. W

Writing NSArray data to file, and compression

2009-10-11 Thread Tom Jones
Hello, I'm looking to store NSDirectoryEnumerator data in a file, but it seems to create a really large file. How can I get the file size down? I have tried both of these methods to save the and while the NSKeyedArchiver reduces the size by about 1MB to 9.3MB thats still seems really big. [file

Re: Recursively get all files and folders

2009-10-11 Thread Tom Jones
Thanks, I have no idea how I missed that in the docs :-P tom - Original Message - From: "Dave Keck" To: "Tom Jones" Cc: cocoa-dev@lists.apple.com Sent: Sunday, October 11, 2009 10:57:43 AM GMT -08:00 US/Canada Pacific Subject: Re: Recursively get all fi

Recursively get all files and folders

2009-10-11 Thread Tom Jones
Hello, I'm playing with NSFileManager and I'm trying to get all of the contents of a directory. When I use "directoryContentsAtPath" it just gives me the one level. Is there an easy/good way to get all subdirectories and files as well? Thanks, tom ___

Re: Watch for a file

2009-06-24 Thread Tom Jones
Thanks Rob. This works great and if Stu is on this list great class! tom - Original Message - From: "Rob Keniger" To: "cocoa-dev Dev" Sent: Wednesday, June 24, 2009 7:57:21 PM GMT -08:00 US/Canada Pacific Subject: Re: Watch for a file On 25/06/2009, at 12:38 PM, Graham Cox wrote: >

Re: Watch for a file

2009-06-24 Thread Tom Jones
Thanks Graham. I downloaded Uli's class but I dont see any example code. By any chance do you have a quick example? Thanks, tom - Original Message - From: "Graham Cox" To: "Tom Jones" Cc: cocoa-dev@lists.apple.com Sent: Wednesday, June 24, 2009 7:38:54 PM GMT

Watch for a file

2009-06-24 Thread Tom Jones
I'm trying to use NSNotification to watch for a file but I can not seem to get it to work. Is it possible to use NSNotification to watch for a specific file on the file system? One example would be to run a method once the file shows up on the filesystem. Thanks, tom __

Re: Looking for info on creating Plugins/Modules

2008-12-13 Thread Tom Jones
This is great, thanks! I think you even covered follow up questions, now it's off to read the Apple documentation. Thanks again, tom On Dec 12, 2008, at 1:05 AM, Chris Hanson wrote: On Dec 12, 2008, at 12:16 AM, Kyle Sluder wrote: On Fri, Dec 12, 2008 at 2:58 AM, Tom Jones wrote

Looking for info on creating Plugins/Modules

2008-12-11 Thread Tom Jones
Hello, I'm hoping someone could point me in the right direction. Where would I read up on how to create modules or plugins for a Cocoa application? I'm not even sure I'm asking the right question :-) Here is kind of the idea. I would like to write a "plugin" which is loaded when the app la

Re: How to exit a thread help...

2008-10-27 Thread Tom Jones
>> I'm writing a Foundation tool and I need to run a NSTask in a >> separate thread. > An NSTask is a different thing from a thread. Since NSTask provides > asynchronous notification of its death (and NSFileHandle provides > asynchronous methods for dealing with I/O), there should be no need

How to exit a thread help...

2008-10-25 Thread Tom Jones
Hello, I'm writing a Foundation tool and I need to run a NSTask in a separate thread. I have it working but when the task completes the thread is still running. I tried issuing a [NSThread exit] but that did nothing. What am I missing? Thanks, tom This my main code #import #import "Thre

Re: JDBC Frameworks?

2008-07-10 Thread Tom Jones
atabases, like MySQL or Oracle. On Jul 10, 2008, at 10:21 PM, Tom Jones wrote: Hmm, this is really a shame. I guess I was just looking for a good framework to use to connect to a database. I think this is a big hole that Apple should really fill. It would be really cool if we could c

Re: JDBC Frameworks?

2008-07-10 Thread Tom Jones
7:35 PM, Nick Zitzmann wrote: On Jul 10, 2008, at 7:42 PM, Tom Jones wrote: I would like to write a app to be able to talk to a couple of different types of databases (MySQL, Oracle). I'm thinking that JDBC is the way to go. Does anyone know of any JDBC frameworks and examples tha

JDBC Frameworks?

2008-07-10 Thread Tom Jones
Hello, I would like to write a app to be able to talk to a couple of different types of databases (MySQL, Oracle). I'm thinking that JDBC is the way to go. Does anyone know of any JDBC frameworks and examples that you can point me towards, I cant seem to really find much. Thanks, tom _

JDBC Frameworks?

2008-07-10 Thread Tom Jones
Hello, I would like to write a app to be able to talk to a couple of different types of databases (MySQL, Oracle). I'm thinking that JDBC is the way to go. Does anyone know of any JDBC frameworks and examples that you can point me towards, I cant seem to really find much. Thanks, tom _

NSString and string contains

2008-03-02 Thread Tom Jones
Hello, I'm fairly new to Cocoa, so please excuse me if I'm not using the right terminology. I have an NSArray which contains String values and I want to loop though it and determine if any of those string contain words I'm looking for. I have tried but have been unsuccessful. Example...