Re: odd problem with NSMutableDictionary and initWithContentsOfFile

2008-05-29 Thread Jason Coco
On May 29, 2008, at 10:47 , Jens Alfke wrote: On 29 May '08, at 6:41 AM, Leslie Smith wrote: I found out what I was doing wrong: rather than [SimParamnames initWithContentsOfFile: aFile]; I should have had SimParamnames = [SimParamnames initWithContentsOfFile: aFile]; No. As two people

Re: CoreData file format stability

2008-06-03 Thread Jason Coco
On Jun 3, 2008, at 23:03 , Michael Ash wrote: On Wed, Jun 4, 2008 at 12:48 AM, Kyle Sluder <[EMAIL PROTECTED]> wrote: This is extremely unlikely to occur in practice. Apple is sensible enough to, in these sorts of circumstances, make these changes depending on which SDK you're compiling agai

Re: Where to start looking to fix hang?

2008-06-04 Thread Jason Coco
You can use the Spin Control application (/Developer/Applications/ Performance Tools/Spin Control.app) to start... that will let you know what's going on when it starts to hang (this application profiles everything, so just start it before you launch your application, launch your app and rep

Re: warning: return makes pointer from integer without cast

2008-06-10 Thread Jason Coco
Hey Steve, In this case, you are returning a regular integer (count returns just a regular, scalar type). But you've declared your return value as id, which is a typedef for a type of pointer. You either have to return an actual integer, or wrap the return of count in an object like NSNumbe

Re: Confused about AuthorizationExecuteWithPrivileges and suid

2008-06-11 Thread Jason Coco
The documentation is talking about using AuthorizationExecuteWithPrivleges() to repair a setuid tool that you may have already created. It is also suggesting that you use the setuid tool method rather than using AuthorizationExecuteWithPrivleges(). In this way, the setuid tool can limit i

Re: argument checks

2008-06-11 Thread Jason Coco
#include /* ... */ NSNumber *myNum = nil; // Lots of code where you've forgotten to actually do anything with myNum assert( myNum != nil ); results = [myClass someCalculationUsing: myNum]; // lots more code to remove the assertion in the release build, compile with -DNDEBUG HTH, /jason

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 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: argument checks

2008-06-13 Thread Jason Coco
port", 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 /* ... */ ___

Re: looking for a crc code

2008-06-15 Thread Jason Coco
There is: uLong crc32(uLong crc, const Bytef *buf, uInt len); On Jun 14, 2008, at 20:04 , Michael Vannorsdel wrote: I thought I saw a CRC32 implementation in zlib at one time. On Jun 14, 2008, at 9:25 AM, Jens Alfke wrote: On 14 Jun '08, at 4:59 AM, Ilan Volow wrote: No mention at all I c

Re: Agent tutorial help needed.

2008-06-16 Thread Jason Coco
Have you read this Technical Article yet? http://developer.apple.com/technotes/tn2005/tn2083.html It's very good and has some code examples as well as many references to other material... On Jun 16, 2008, at 15:40 , christian giacomi wrote: Hi all,I am new to Cocoa and Objective-C so I hop

Re: SSCrypto Framework

2008-06-20 Thread Jason Coco
You could use the keychain for this... I think it would be the easiest way to support your application. Either install your certificate into the system keychain or provide a keychain file that your application accesses exclusively. On Jun 20, 2008, at 11:45 , Trygve Inda wrote: I am consi

Re: SSCrypto Framework

2008-06-20 Thread Jason Coco
Yeah, I understand that... you don't need to actually buy a certificate for that. You can just install your certificate that you generate yourself and then use it internally to check the integrity of your data files or whatever else you'd like to do with it. On Jun 20, 2008, at 12:04 , Tryg

Re: SSCrypto Framework

2008-06-20 Thread Jason Coco
There would be a couple of ways that you could do it... you could place your certificate in the System keychain and then add it so that it can be read by your application anytime. This should work okay and if you do this during installation, the user should only have to authenticate then. B

Re: zlib in 10.4 and 10.5

2008-06-22 Thread Jason Coco
Yes... everything since OS X 10.4.3 uses zlib 1.2.3... but even before that, everything used 1.2.x. zlib has been very stable for a very long time so you won't really run into any issues... /j On Jun 22, 2008, at 06:41 , Trygve Inda wrote: No. The library will return Z_VERSION_ERROR if y

Re: Interesting Problem Code worked in 10.4 but not in 10.5

2008-06-22 Thread Jason Coco
There should be crash reports in ~/Library/Logs/CrashReporter – that should give you the register state, thread stack, and information on which thread crashed. On Jun 22, 2008, at 18:38 , Clayton Leitch wrote: Well, the only thing I get from the debugger is: [Session started at 2008-06-22 1

Re: Interesting Problem Code worked in 10.4 but not in 10.5

2008-06-22 Thread Jason Coco
Is it possible that your NSDecimalNumber is no longer a valid object reference? On Jun 22, 2008, at 19:08 , Clayton Leitch wrote: Well, thanks to the list I now have a back trace below: #0 0x96cd5564 in NSDecimalCopy () #1 0x96d854f9 in NSDecimalSubtract () #2 0x96dadad8 in -[NSDecimalNumb

Re: Working with Notifications and NSFileHandle

2008-06-27 Thread Jason Coco
On Jun 27, 2008, at 20:11 , Ken Thomases wrote: On Jun 27, 2008, at 3:32 PM, Wan, Nathan (CIV) wrote: I'm new to Objective-C and Cocoa and I am having trouble with the notifications system. This I thought was just a small project to write a native mac program to continuously read and writ

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Jason Coco
You could also use /usr/bin/open -- then you wouldn't have to know where safari lives. execl("/usr/bin/open", "/usr/bin/open", "-a", "Safari", 0); On Jul 1, 2008, at 11:19 , Kristopher Matthews wrote: Try executing "/Applications/Safari.app/Contents/MacOS/Safari". /Applications/Safari.app i

Re: exec(uting) Safari - How (newbie)

2008-07-01 Thread Jason Coco
What env pollution? I agree that exec* isn't really the way to go, but that's what the OP was using... I just suggested that /usr/bin/open is a better option than hard-coding the path to some arbitrary application. It's also a lot easier to use than the LaunchServices API... although if I w

Re: exec(uting) Safari - How (newbie)

2008-07-02 Thread Jason Coco
than Launch Services" ? extern char **environ; char *args[] = { "-a", "Safari", NULL}; execve("/usr/bin/open", args, environ); versus: FSRef app; if (noErr == LSFindApplicationForInfo(kLSUnknownCreator, NULL, CFSTR("Safari"), &app, NULL))

Re: exec(uting) Safari - How (newbie)

2008-07-02 Thread Jason Coco
On Jul 2, 2008, at 11:36 , Jean-Daniel Dupas wrote: Le 2 juil. 08 à 16:58, Jason Coco a écrit : Yeah, to me it is... although I still agree that it's not an ideal solution for a Cocoa application... By the way, assuming you change char *args[] = { "-a", "Safari"

Re: exec(uting) Safari - How (newbie)

2008-07-02 Thread Jason Coco
On Jul 2, 2008, at 11:38 , Clark Cox wrote: On 7/2/08, Jason Coco <[EMAIL PROTECTED]> wrote: Yeah, to me it is... although I still agree that it's not an ideal solution for a Cocoa application... By the way, assuming you change char *args[] = { "-a", "Safa

Re: Learning How to Program in Objective-C

2008-07-11 Thread Jason Coco
Also, if you do choose to get Hillegass's book, keep in mind that the current edition (3rd Edition) is for Xcode 3.x/Obj-C 2.0... so if you're sticking to 2.5, I suggest trying to find a copy of the 2nd edition somewhere. If you print out the Obj-C 2.0 reference as was suggested, note that

Re: starting external program at runtime

2008-07-11 Thread Jason Coco
If your helper application is a console app, however, you should keep it with your main application bundle and use NSTask to run it and interact with it. (By console app I simply mean something that doesn't interact directly with the user). On Jul 11, 2008, at 11:19 , Abernathy, Joshua wrot

Re: I don't understand why this is leaking...

2008-08-12 Thread Jason Coco
On Aug 12, 2008, at 07:49 , Phil wrote: On Tue, Aug 12, 2008 at 10:25 PM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: Yes, I have. 1. Simple Test: In IB create new window, add NSTextField with content "$null" (without the quotes) save in 10.2 or later format. Close. Open again. Look at

Re: Determine who ran an application

2008-08-12 Thread Jason Coco
On Aug 12, 2008, at 12:01 , GARRISON, TRAVIS J. wrote: I am new to Cocoa and Xcode, so please bear with me. I am editing an existing application that we have. The application is set to run when the user logs into the machine through a loginHook. We have to pass the %USER% variable as an argu

Re: I don't understand why this is leaking...

2008-08-12 Thread Jason Coco
On Aug 12, 2008, at 12:50 , Klaus Backert wrote: About $Null: It it were a reserved word, it would be documented so. The "Archives and Serializations Programming Guide for Cocoa" says: Keyed Archives ... Naming Values ... You should avoid using “$” as a prefix for your keys. The keyed

Re: Accessing memory of another application?

2008-08-12 Thread Jason Coco
On Aug 13, 2008, at 01:51 , Graham Cox wrote: On 13 Aug 2008, at 3:22 am, Josh wrote: You have to be able to do this - I have seen applications do it - you just have to type in your root password when you start the application. LOL, thanks for the light entertainment :) Basically like

Re: Accessing memory of another application?

2008-08-13 Thread Jason Coco
On Aug 13, 2008, at 09:27 , Kyle Sluder wrote: On Tue, Aug 12, 2008 at 10:14 PM, Steve Byan <[EMAIL PROTECTED]> wrote: Actually, the man-page is incomplete and doesn't tell you how to read and write another process's memory. The manpage also fails to mention the undocumented PT_DENY_ATTACH

Re: How to include a .c file in a loadable bundle?

2008-08-13 Thread Jason Coco
You can't use Foundation in a C file... it's an Objective-C framework. Use CoreFoundation instead... you're getting these errors because Foundation/Foundation.h includes many Object-C statements which won't compile in C. HTH, Jason On Aug 13, 2008, at 13:05 , Jesse Grosjean wrote: Feeling

Question about directory for Application Caches

2008-08-15 Thread Jason Coco
Hello All, I'm a little unclear about this... maybe one of you has some ideas? Currently, the call to NSSearchPathForDirectoriesInDomain(NSCachesDirectory, NSUserDomainMask, NO); returns the path ~/Library/Caches. The FSFindFolder(...) call also returns the same thing. I noticed, however

Re: Question about directory for Application Caches

2008-08-15 Thread Jason Coco
On Aug 15, 2008, at 11:11 , Jeff Johnson wrote: Jason, See the following threads for some discussion of these issues: http://lists.apple.com/archives/Macnetworkprog/2008/Apr/msg00033.html http://lists.apple.com/archives/Xcode-users/2008/Jul/msg00283.html Interesting... thanks, Jeff. So I g

Re: Question about directory for Application Caches

2008-08-15 Thread Jason Coco
On Aug 15, 2008, at 12:21 , Jeff Johnson wrote: On Aug 15, 2008, at 10:33 AM, Jason Coco wrote: On Aug 15, 2008, at 11:11 , Jeff Johnson wrote: Jason, See the following threads for some discussion of these issues: http://lists.apple.com/archives/Macnetworkprog/2008/Apr/ msg00033.html

Re: creating files to write data to?

2008-08-15 Thread Jason Coco
On Aug 15, 2008, at 18:10 , FTB Accounts wrote: Devon, thanks for your response. However, your suggestion still does not make the code work. No data is written to the file. /* WRITE DATA TO FILE: THIS IS A TEST */ [fh writeData:@"THIS IS A TEST"]; [fh closeFile]; I simply

Re: creating files to write data to?

2008-08-16 Thread Jason Coco
On Aug 15, 2008, at 19:35 , Andy Lee wrote: On Aug 15, 2008, at 6:43 PM, Jason Coco wrote: Adding the @ just makes it an NSString constant... but writeData still requires (NSData *), not (NSString *). Argh! Or perhaps, given the nature of this error, which I missed, I should say &quo

Re: creating files to write data to?

2008-08-17 Thread Jason Coco
ode I am running: /* START CODE */ #import int main(int argc, char *argv[]) { NSData *fname = "file:///Users/cknorr/mytest/MYTEST/data.txt"; NSFileHandle *fh=[NSFileHandle fileHandleForWritingAtPath:fname]; [fh writeData:@"THIS IS A TEST"]; [f

Re: What is Core Foundation, and other terminology/history questions.

2008-08-17 Thread Jason Coco
On Aug 18, 2008, at 01:09 , Sumner Trammell wrote: Hi, can someone explain to me the philosophy/principles behind Core Foundation? I'm just having a hard time seeing the overall relationship between Carbon, Core Foundation, and Cocoa. It's basically a C-language version of the Foundation Fram

Re: CF Network memory leak? Or false positive in Leaks?

2008-08-18 Thread Jason Coco
On Aug 17, 2008, at 22:40 , Lawrence Johnston wrote: Hey everybody, I've got a situation I'm kind of puzzling over. If I run my program though leaks, I'm getting a leak at a certain point, but where it's coming from is really confusing me. I've pulled the urlRequest entirely out into a n

Re: Hex representation of NSString

2008-08-18 Thread Jason Coco
On Aug 18, 2008, at 07:18 , Robert Černý wrote: Actually,I'm trying to debug some weird problems with clipboard. My problem is that data copied into clipboard from legacy java application doesn't match data pasted into Cocoa application. I've got data with accented characters which gets con

Re: Hex representation of NSString

2008-08-18 Thread Jason Coco
On Aug 18, 2008, at 10:18 , Clark Cox wrote: On Mon, Aug 18, 2008 at 5:38 AM, Jason Coco <[EMAIL PROTECTED]> wrote: On Aug 18, 2008, at 07:18 , Robert Černý wrote: Actually,I'm trying to debug some weird problems with clipboard. My problem is that data copied into clipboard

Re: Hex representation of NSString

2008-08-18 Thread Jason Coco
On Aug 18, 2008, at 11:38 , Clark Cox wrote: On Mon, Aug 18, 2008 at 7:38 AM, Jason Coco <[EMAIL PROTECTED]> wrote: On Aug 18, 2008, at 10:18 , Clark Cox wrote: On Mon, Aug 18, 2008 at 5:38 AM, Jason Coco <[EMAIL PROTECTED]> wrote: On Aug 18, 2008, at 07:18 , Robert

Re: Clearing a Memory Buffer?

2008-08-18 Thread Jason Coco
On Aug 18, 2008, at 09:19 , Dave wrote: Hi All, I'm fairly new to Cocoa and was wondering if there are OS functions to Copy and Clear/Fill Memory available? I've tried searching for obvious names like MemoryZero, ZeroMemory, CopyMemory etc. but can't seem to find anything. bzero(3), bc

Re: NSString Question

2008-08-18 Thread Jason Coco
On Aug 18, 2008, at 10:54 , Dave wrote: Hi, I'm tring to create an NSString object from data contained within a file. The following code attempts to do this. The data is read from the file OK and all the size information etc. is OK. Here is a code snippet: myOSStatus = [self ReadUInt32L

Re: Problem with fileAttributesAtPath

2008-08-18 Thread Jason Coco
If you're using 10.5 you can try the method: -(NSDictionary *)attributesOfItemAtPath:(NSString *)path error: (NSError **)error This way you will get a description of what is failing from the NSError object. You can use it like this: NSError *theError; NSDictionary *fileAttributes = [manage

Re: NSString Question

2008-08-18 Thread Jason Coco
On Aug 18, 2008, at 15:49 , Ken Thomases wrote: On Aug 18, 2008, at 12:28 PM, Jason Coco wrote: [[thePropertiesInfoPtr->mNameString alloc] initWithCharacters:myStringBufferPtr length:myStringSize]; Um, that's nonsensical. I think you meant: thePropertiesInfoPtr->mNameString =

Re: Including frameworks in your app bundle

2008-08-18 Thread Jason Coco
On Aug 18, 2008, at 19:59 , Nick Pilch wrote: I've been searching, but I can't find the documentation explaining how to include frameworks in your app bundle (third-party frameworks, for example), so that your user does not have to install these frameworks. Could someone point me at the co

Re: Best Way to Handle Properties?

2008-08-19 Thread Jason Coco
On Aug 19, 2008, at 13:02 , Dave wrote: My specific questions are: Is the NSString allocation and initWithCharacters code the best way to do this? If so, what would the setter look like in this case? If not what is a better way of doing it? Hey Dave, I don't think that initWithCharacter

Re: Preventing windows from being dragged

2008-08-21 Thread Jason Coco
Wow, I hope not :) Why would you want to do this? On Aug 21, 2008, at 21:10 , Mike wrote: Is there any way to prevent a Cocoa window from being dragged while it is onscreen? Thanks, Mike ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Ple

Re: Preventing windows from being dragged

2008-08-21 Thread Jason Coco
On Aug 21, 2008, at 22:37 , Mike wrote: For a Kiosk application. Ah, that makes sense... well, I'm not really sure about Cocoa. I think you can override the drag method in Carbon, but not really sure about that either. In case you haven't seen it yet, there is a technote about kiosk stu

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: 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

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: CFBoolean

2008-08-24 Thread Jason Coco
On Aug 24, 2008, at 21:33 , Chris Idou wrote: How do I create a property in the user defaults of type boolean? Internally it seems to use a NSCFBoolean which is an undocumented type. If I make the assumption it is the same as a CFBoolean, and overlooking the oddness of having to fall back

Re: NSAppleScript shies away from porcupines

2008-08-26 Thread Jason Coco
On Aug 26, 2008, at 04:19 , Gerriet M. Denkmann wrote: On 26 Aug 2008, at 15:04, Andrew Farmer wrote: On 26 Aug 08, at 00:39, Gerriet M. Denkmann wrote: I want to open some file: source = "tell application "SomeApp"... You're making things harder than they need to be. [[NSWorkspace shar

Re: NSAppleScript shies away from porcupines

2008-08-26 Thread Jason Coco
On Aug 26, 2008, at 16:54 , Gerriet M. Denkmann wrote: On 27 Aug 2008, at 02:09, has wrote: Gerriet M. Denkmann wrote: When I try in Script Editor: set macpath to POSIX file "/Volumes/เม่น/Users" as Unicode text and do "Compile", then this gets transformed into: set macpath to file "

Re: NSFileManager Help

2008-08-27 Thread Jason Coco
On Aug 27, 2008, at 20:43 , J. Todd Slack wrote: Hi All, It simply does not create the directory. This is code that I had in another project that worked. What am I missing? Does the parent directory exist already (~/Application Support/Ring- Maker)? If not, this call will fail. However,

Re: NSFileManager Help

2008-08-27 Thread Jason Coco
On Aug 27, 2008, at 21:08 , J. Todd Slack wrote: Hi Jason, It simply does not create the directory. This is code that I had in another project that worked. What am I missing? Does the parent directory exist already (~/Application Support/Ring- Maker)? If not, this call will fail. Howeve

Re: NSFileManager Help

2008-08-27 Thread Jason Coco
On Aug 27, 2008, at 21:19 , J. Todd Slack wrote: Hi Jason -(BOOL)createDirectoryAtPath:(NSString*)path withIntermediateDirectories:(BOOL)createIntermediates attributes: (NSDictionary*)attributes error:(NSError**)error; I saw this, but if I have to deploy on 10.4, will this call fail on

Re: Get current amount of available RAM

2008-08-27 Thread Jason Coco
On Aug 28, 2008, at 00:31 , Alex Kac wrote: I need to check for free RAM before performing a specific operation. I've Googled and checked in the docs and I suspect its my terminology that's just out of whack. So what is the best way to find out how much available RAM is available in a Co

Re: understanding conversions between CF and NS datatypes

2008-08-29 Thread Jason Coco
On Aug 29, 2008, at 13:38 , Allen Curtis wrote: The problem: I found that if you release the CFMutableArray, you also loose the NSMutableArray Question: 1. Where can I get a better understanding of the data conversion between these different frameworks? 2. Ultimately the device path names

Re: NSString/NSMutable String Concatenation

2008-09-03 Thread Jason Coco
On Sep 3, 2008, at 17:57 , Michael Stearne wrote: Hi. I'm new to OS X development and Objective C. I have a NSString (or NSMutableString if that is wiser) and I would like to add text on to the end of it. In PHP it would be something like: $myString=$myString." more stuff"; I have looked

Re: Accessing SDL Frameworks Bundled with Leopard...

2008-09-04 Thread Jason Coco
On Sep 5, 2008, at 00:04 , John Joyce wrote: Does anybody know any official or proper way to link to the SDL framework that is bundled in the root library in Leopard? /Library/Frameworks/SDL.framework is surprisingly, there! I don't have any such directory on my installation of Leopard. Ano

Re: Finding out in code how much memory my application uses

2008-09-08 Thread Jason Coco
I would suggest using the DTrace stuff... either using instruments or using DTrace scripts directly... there is tons of good information about DTrace at google. You can also look at /usr/include/mach directory for various mach calls regarding process statistics, including memory usage (all

Re: BOOL array

2008-09-09 Thread Jason Coco
On Sep 9, 2008, at 06:24 , Alex Reynolds wrote: I am currently putting 320 to 480 character long NSString * instances into an NSMutableArray. The characters are 0 or 1. I guess I could use an int array, but I'm looking to speed up my app and reduce storage. Is it possible to create a BOOL

Re: C/Obj-C API Confusion

2008-09-10 Thread Jason Coco
On Sep 10, 2008, at 17:31 , J. Todd Slack wrote: Hi Sherm, So if I have an objective C class, how can I call a .c class? and pass my arguments from the objective-c class? What kind of ".c class"? And what kind of arguments? It might help to give the prototype of some of the functions tha

Re: GDB Problems

2008-09-11 Thread Jason Coco
On Sep 12, 2008, at 00:10 , Bridger Maxwell wrote: Woops. I tried to reply to this thread a while ago, but I wasn't watching what I was doing and accidentally replied specifically to Ken. Sorry Ken! I am still having this issue though. I suspect you've recently installed a haxie, input ma

Re: App name from Bundle Identifier?

2008-09-12 Thread Jason Coco
On Sep 12, 2008, at 18:26 , Citizen wrote: On 12 Sep 2008, at 22:06, Dave DeLong wrote: I've been looking inside NSWorkspace, NSBundle, NSApplication, NSFileWrapper, etc for some way to get the display name of an application from it's bundle identifier, but I can't find anything. Is the

Re: NameAndPassword Sample Code

2008-09-14 Thread Jason Coco
On Sep 14, 2008, at 16:30 , Patrick Neave wrote: Sorry for the long post, but I have been stuck on this for a while now and not sure how to proceed. Looking forward to your replies. Hi Patrick, I haven't read this yet, so I'm not sure if it will be useful or not, but it may... assuming

Re: NSUInteger in for-loop?

2008-09-14 Thread Jason Coco
On Sep 15, 2008, at 00:44 , Alex Reynolds wrote: The %lu with casting seems to run into the same issue as %u: ... 2008-09-14 21:43:07.241 NSUIntTest[19779:10b] NSUInteger: 2 2008-09-14 21:43:07.259 NSUIntTest[19779:10b] NSUInteger: 1 2008-09-14 21:43:07.260 NSUIntTest[19779:10b] NSUInteger: 0

Re: NSUInteger in for-loop?

2008-09-14 Thread Jason Coco
On Sep 15, 2008, at 00:45 , Brett Powley wrote: On 15/09/2008, at 2:15 PM, Alex Reynolds wrote: I'm wondering if I'm using unsigned integers (specifically NSUInteger) properly or not. I was under the impression that unsigned integers run from 0 to MAX_INT, but when I use them in a "for"

Re: Getting NSTimeZone for a given NSDate

2008-09-15 Thread Jason Coco
On Sep 15, 2008, at 03:49 , Markus Spoettl wrote: Hi List, I just know it must be there but I can't see it. How can I get to the NSTimeZone for a given NSDate. When using -description: the date got a time zone, so it's stored in there but how on earth can I get to it? I only need the GM

Re: Getting NSTimeZone for a given NSDate

2008-09-15 Thread Jason Coco
On Sep 15, 2008, at 05:35 , Jean-Daniel Dupas wrote: Le 15 sept. 08 à 09:56, Jason Coco a écrit : On Sep 15, 2008, at 03:49 , Markus Spoettl wrote: Hi List, I just know it must be there but I can't see it. How can I get to the NSTimeZone for a given NSDate. When using -descri

Re: NSUInteger in for-loop?

2008-09-14 Thread Jason Coco
On Sep 15, 2008, at 00:42 , Alex Reynolds wrote: Interesting: ... 2008-09-14 21:38:56.311 NSUIntTest[19750:10b] NSUInteger: 2 2008-09-14 21:38:56.329 NSUIntTest[19750:10b] NSUInteger: 1 2008-09-14 21:38:56.341 NSUIntTest[19750:10b] NSUInteger: 0 2008-09-14 21:38:56.344 NSUIntTest[19750:10b] NS

Re: brain-dead NSThread question ...

2008-09-14 Thread Jason Coco
On Sep 14, 2008, at 19:36 , John Michael Zorko wrote: Julien et al, sleep() is just blocking the thread, so no event is processed. Use run loops instead. Try to replace sleep() with [[NSRunLoop currentRunLoop] runMode:beforeDate:] You mean the NSURLConnection callbacks are not callb

Re: async NSOperation and NSOperationQueue

2008-09-15 Thread Jason Coco
On Sep 15, 2008, at 11:02 , John Love wrote: I must be doing something terribly wrong, because when I start up the NSOperationQueue that does some time consuming calculations, I do not get back control of my application until after the lengthy calculation is complete. Here are the relevant

Re: async NSOperation and NSOperationQueue

2008-09-15 Thread Jason Coco
On Sep 15, 2008, at 14:04 , Quincey Morris wrote: On Sep 15, 2008, at 10:31, Jason Coco wrote: You /should/, however, autorelease your NSOperation since your queue will retain it when you add it and release it when it completes. This sounds plausible, but I can't find anything i

Re: MySQL?

2008-09-15 Thread Jason Coco
On Sep 15, 2008, at 18:59 , J. Todd Slack wrote: Hi All, Does anyone know what I need to connect from OS X to a MySQL DB and run a few queries? This would be from Objective-C or C++. Any examples? What should I be downloading? The MySQL C API is distributed with MySQL, so if you have d

Re: NSMutableString question

2008-09-16 Thread Jason Coco
On Sep 16, 2008, at 20:59 , Dave DeLong wrote: The general rule with convenience class methods like that is that they return an autoreleased object. What that means is that unless you retain it, it will disappear at some time in the future (whenever the current AutoreleasePool gets draine

Re: NSMutableString question

2008-09-16 Thread Jason Coco
On Sep 16, 2008, at 21:24 , Dave DeLong wrote: On 16 Sep, 2008, at 7:22 PM, Graham Cox wrote: On 17 Sep 2008, at 11:11 am, Dave DeLong wrote: because only a couple days ago I had a crash when I tried releasing an already autoreleased object Yes, because that would be an over-release.

Re: NSMutableString question

2008-09-16 Thread Jason Coco
On Sep 16, 2008, at 21:58 , Bill Bumgarner wrote: On Sep 16, 2008, at 6:29 PM, Jason Coco wrote: Is it actually retained by the pool, or does the pool just delay the final release? It doesn't really matter how it's implemented... either way, you shouldn't release it unless

Re: NSMutableString question

2008-09-16 Thread Jason Coco
On Sep 16, 2008, at 22:41 , Roland King wrote: Jason Coco wrote: NSMutableString *str = [[NSMutableString alloc] initWithCapacity:someAssumedCapacity]; /* do stuff */ [str release]; Is that actually guaranteed to release the string *right now*? I only ask because I seem to recall a

Re: NSMutableString question

2008-09-17 Thread Jason Coco
On Sep 17, 2008, at 12:08 , Roland King wrote: You'd think perhaps that alloc/init would give you an object which really has never been retained by anyone else, but as I said I remembered a post from a while ago about a complex object which was alloc/init'ed but ended up still having a reta

Re: How to get AirPort Connection Status

2008-09-18 Thread Jason Coco
On Sep 18, 2008, at 00:50 , Rashmi Vyshnavi wrote: I want to know when my computer connects/disconnects to WiFi/AirPort network. Is there a way to get the status of connection to a WiFi network. I tried using System Configuration API,but I could not get the status. Here is the snippet --

Re: NSTimer does NOT repeat, why ?

2008-09-18 Thread Jason Coco
On Sep 18, 2008, at 05:18 , Florian Soenens wrote: Hi list, anyone knows why in this simple piece of code, the method testTimer is only called once and not every 2 seconds? Yes, it is because you created a timer and then fired it manually. You need to schedule the timer with the run loop

Re: File I/O

2008-09-19 Thread Jason Coco
On Sep 19, 2008, at 17:20 , Nick Zitzmann wrote: On Sep 19, 2008, at 3:15 PM, Jordon Hirshon wrote: How can I read a file a line at a time (i.e. getline)? I'm trying to do this in a Cocoa Framework. Try using NSFileHandle to read a file until a line feed is encountered. There's no bu

Re: async NSOperation and NSOperationQueue

2008-09-19 Thread Jason Coco
On Sep 19, 2008, at 18:27 , Michael Ash wrote: On Fri, Sep 19, 2008 at 2:41 PM, John Love <[EMAIL PROTECTED]> wrote: Michael Ash wrote: Has it occurred to you that waiting for the operation to finish is rather at odds with the idea of trying to run it asynchronously to keep your program r

Re: Constant NSArray Count

2008-09-20 Thread Jason Coco
On Sep 20, 2008, at 05:05 , Alex Mills wrote: Hey, I have started looking at Key Value Observing but I'm having trouble working out how to observe the changes within an Array. Is there some place I can find example code on this to help wrap my head around it? I'm pretty sure that you c

Re: Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Jason Coco
On Sep 21, 2008, at 21:05 , Rick Mann wrote: I want to implement a simple console for my app. As it generates data, it outputs a string representation of it to an NSTextView in a window. Already this was fairly cumbersome to do, but I got it working. The part that doesn't work is that it d

Re: Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Jason Coco
On Sep 21, 2008, at 22:03 , Rick Mann wrote: Thanks! You're welcome :) On Sep 21, 2008, at 18:32:58, Jason Coco wrote: You would have to track whether or not the text view is at the end. I suggest looking at the documentation for NSTextView as well as the Scroll View Programming

Re: Programmatically inserting text into NSTextView and scrolling

2008-09-21 Thread Jason Coco
On Sep 21, 2008, at 23:02 , Rick Mann wrote: On Sep 21, 2008, at 19:38:16, Jason Coco wrote: If you look at the top of the reference document, you will see a small table. The first row is the list of object references that the object inherits from. Clicking on any of these will take you

Re: Properties and bindings

2008-09-22 Thread Jason Coco
On Sep 22, 2008, at 21:35 , D.K. Johnston wrote: I'm trying to learn how to use bindings. MyObject has an NSInteger myInt. I used @property and @synthesize to make myInt into a property. In IB I bound an NSTextField to the myInt property. Now when I do this: self.myInt = 123; wh

Re: Properties and bindings

2008-09-23 Thread Jason Coco
On Sep 22, 2008, at 23:44 , D.K. Johnston wrote: Thanks for the explanations: it does make some kind of sense now. The reason I was looking at both forms is that I want the myInt property to be read-only, but I want the MyObject instance to be able to set it. If I do this: @prope

Re: Unable to launch about panel for the 2nd time

2008-09-23 Thread Jason Coco
On Sep 23, 2008, at 02:58 , Arun wrote: Hi All, I am a newbie to cocoa programming. I have written a small program in which i will be loading a Custom About panel from another nib. This launching of the panel works well only for the first time. If i close the panel and try to launch for the

Re: Converting from Carbon Event Manager to NSTimer

2008-09-23 Thread Jason Coco
On Sep 23, 2008, at 19:20 , Dan Birns wrote: I'm trying to convert from Carbon to Cocoa for a number of reasons which I won't go into here. My application needs to set a timer that causes a function to be called at a time in the future. This is non-repeating, and sometimes has be immedi

Re: Unable to launch about panel for the 2nd time

2008-09-23 Thread Jason Coco
On Sep 23, 2008, at 02:58 , Arun wrote: Hi All, I am a newbie to cocoa programming. I have written a small program in which i will be loading a Custom About panel from another nib. This launching of the panel works well only for the first time. If i close the panel and try to launch for the

Re: Very basic Bindings question

2008-09-24 Thread Jason Coco
On Sep 24, 2008, at 04:21 , Adil Saleem wrote: Hi, I am trying to use bindings for the first time. So this is a pretty basic question. As an example what i am trying to do is that i have a NSTextField in which user enters some numeric value. I have a int type variable in my class that

Re: Unable to launch about panel for the 2nd time

2008-09-24 Thread Jason Coco
On Sep 24, 2008, at 15:16 , I. Savant wrote: On Wed, Sep 24, 2008 at 6:17 AM, Arun <[EMAIL PROTECTED]> wrote: First time i am to see the panel being launched and if i close the panel and try yo launch it one more time, the panel is not vsible. Your question was answered yesterday ... che

Re: unable to break out of runloop because timers are fired and then the loop waits

2008-09-24 Thread Jason Coco
On Sep 24, 2008, at 15:15 , Jason Bobier wrote: Hey folks, I have a runloop on a thread that looks like this: while (! _cancelled) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; [runloop runMode:NSDefaultRunLoopMode befor

Re: unable to break out of runloop because timers are fired andthen the loop waits

2008-09-24 Thread jason . coco
He said in another message that he didn't want to poll... In that case the only option is to ensure an input source fires or to use a CFRunLoop instead. Sent via BlackBerry from T-Mobile -Original Message- From: Muraviev Dmitry <[EMAIL PROTECTED]> Date: Wed, 24 Sep 2008 23:30:45 To: Ja

  1   2   >