Re: printing arrays

2012-11-02 Thread Greg Guerin
Gerriet M. Denkmann wrote: 2012-...] Bad Array: ( \U0e01\U0e38\U0e0d\U0e41\U0e08, \U0e04\U0e38\U0e13\U0e04\U0e48\U0e32 ) For a very long time, the -description method of NSArray (and other collection classes) has produced the old-style ASCII plist format. Since that format has

Re: Finder Info

2012-08-24 Thread Greg Guerin
koko wrote: I forgot to add that the deployment target is 10.4 … which is why I asked … Look at NSFileManager's deprecated methods, and find changeFileAttributes:atPath: . -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: How do I get memory usage numbers?

2012-08-15 Thread Greg Guerin
Charlie Dickman wrote: What I want to do is determine the ratio of inactive to free in order to determine when to execute the purge command to free up the inactive memory before the system gets into trouble. It's unnecessary to purge or free Inactive memory. Quoting from:

Re: Document Based Application

2012-07-08 Thread Greg Guerin
koko wrote: I have 29 file types and wanted to get away from the if or switch to open them and let NSDocument pick the right class for me. As I understand it, an Item in the Document types array of the plist contains and entry for an NSDocument class. And yes, each type has a unique

Re: byte orders question

2011-11-26 Thread Greg Guerin
Koen van der Drift wrote: u_int32_t value; [base64DecodedData getBytes:value range:NSMakeRange (n*4, sizeof(u_int32_t))]; u_int32_t res = CFSwapInt32HostToBig(value); float f; memcpy(f, res, sizeof(f));

Re: Calling a Cocoa library from C

2011-11-12 Thread Greg Guerin
Nathan Sims wrote: Hmm, if not a global, where would the declaration go? The C function certainly shouldn't return it, so if it is to remain persistent across calls, wouldn't the logical (the only?) place for it be as a global in the library's .m file? Why shouldn't the C function

Re: Blocks vs. life, the universe and everything

2011-10-15 Thread Greg Guerin
Quincey Morris wrote: The problem is that the documentation clearly states that exceptions must not try to escape across dispatch queue operation boundaries. AFAICT, this means that for every one of the tiny code block fragments I write, not only does my fragment need to be wrapped in a

Re: -dateWithTimeIntervalSinceNow: 64-bits may overflow

2011-10-12 Thread Greg Guerin
Jerry Krinock wrote: Not necessarily. Multiple overflows tend toward a random number generator. Doubles overflow to +INF, as do floats. Arithmetic on INFs typically yields one of the INFs (+INF or -INF). It is decidedly non-random. It would be an interesting experiment, though. --

Re: How to get mount options of a mounted volume

2011-10-11 Thread Greg Guerin
Oleg Krupnov wrote: I'd like to get the mount options of a particular volume (like rw, nobrowse, automounted etc.) of a mounted volume, like those I get when I run mount command in the Terminal. See the C function statfs(). See the include file sys/mount.h, struct statfs, member f_flags. See

Re: diskutil info -plist via Cocoa object?

2011-10-11 Thread Greg Guerin
Todd Heberlein wrote: If not, does anyone know how is diskutil getting this information? For example getfsstat(), statfs(), ...? I'm having troubles finding the equivalent of BusProtocol and Internal values in these structures. BusProtocol is probably worked out from the device

Re: creating multiple NSTimers

2011-09-29 Thread Greg Guerin
Gordon Apple wrote: There must already be an array for the table, so just iterate the array every minute or whatever (single repeating timer), compare the times to [NSDate date} and start or shut down whatever has not been started or shut down. Much easier than trying to manage

Re: Why does Xcode define IBOutlet with @synthesize?

2011-09-24 Thread Greg Guerin
Charles Srstka wrote: It’s a little disturbing that private instance variables can be altered so easily, but then I suppose the same thing could just as easily be done by a third-party monkeying with the ivar in a category. No programming language with direct memory access is ever

Re: Task dispatching

2011-09-13 Thread Greg Guerin
Jon Sigman wrote: Also, won't I need to increase shmmax in the kernel, especially if I have numerous flavors of the 1GB matrix to load? What is a flavor of a matrix? You need to explain what you're doing in terms of the data and its representation. How is the matrix data represented on

Re: Follow-up on localizing Keychain names

2011-08-12 Thread Greg Guerin
Sean Leonard wrote: Does anybody know how the display names for these keychains are localized, and how I can use this behavior for another keychain? What have you tried? Maybe it's the same way other file-system names are localized:

Re: Writing global preferences file into /Library/Preferences (OS X Lion)

2011-07-21 Thread Greg Guerin
Peter C wrote: Graham, I used to store serial number codes for all users, in this directory. Looks like I have change it to save it user library directory. The /Users/Shared/ directory is public-writable, with sticky-bit set (unless that changed in Lion, too). See 'man sticky' for an

Re: problem with dataWithContentsOfFile on Lion

2011-07-21 Thread Greg Guerin
Wilker wrote: Before Lion, it really works well and fast, even on Wifi external drive (through Airport Extreme), but now it get's really slow... I did some checks, and now its reading the entire file... instead of just read 128kb (start and end). Anyone have an ideia on why its happening

Re: Optimizing a loop

2011-07-19 Thread Greg Guerin
Eric E. Dolecki wrote: //Get the very best match there is to be found for song. if(match currentFoundValue){ currentFoundValue = match; test = [songsDictionary objectForKey:thisSong]; dis = [NSArray

Re: Adding Spotlight comment data to folder/file

2011-07-11 Thread Greg Guerin
Kevin Muldoon wrote: Well, as I indicated, it's only a bit of icing on the cake. I'm just a bit shocked such an trivial task in a scripting language requires such heavy lifting in Obj-C (or more accurately, C). The Finder's spotlight comment is stored as an xattr attached to the file.

Re: App Delegate Methods

2011-07-07 Thread Greg Guerin
koko wrote: So, is there really an NSApplicationWillFinishLaunchingNotification or is Apple just pulling my leg? From the reference doc for the NSApplicationDelegate protocol: applicationWillFinishLaunching: Sent by the default notification center immediately ***before the application

Re: Using a Soundex category...

2011-07-06 Thread Greg Guerin
Eric E. Dolecki wrote: http://www.cocoadev.com/index.pl?NSStringSoundex However, when I tried it out I get strange results... //someString is set to different strings each time tested BOOL test = [someString soundsLikeString:@Face]; NSLog(@sounds like Face: %d,test); Place = 0 Ace = 0 Mace =

Re: dealloc and scarce resources

2011-06-30 Thread Greg Guerin
James Merkel wrote: Everyone doesn't approach this stuff with the same background. We find from Kernighan and Ritchie (KR) second edition, section 8.1 that a file descriptor is a small non-negative integer that refers to a file and is maintained by the system. Wikipedia is also a useful

Re: dealloc and scarce resources

2011-06-30 Thread Greg Guerin
Jeffrey Walton wrote: Wikipedia is hardly the definitive reference. SEO comes to mind. Luckily, I didn't say Wikipedia was a definitive reference. I said useful reference. And anyone at all familiar with it knows full well that its accuracy (and usefulness) can vary widely. I, for one,

Re: tableView: objectValueForTableColumn: row: method not getting called

2011-06-23 Thread Greg Guerin
Sandeep Mohan Bhandarkar wrote: Have i missed anything else...?? All the protocol's methods are declared @optional. That means the compiler won't check whether you've spelled your implementation's method-name correctly. I have seen more than one case where it was misspelled, despite

Re: Automatically mirroring folders

2011-06-19 Thread Greg Guerin
Leonardo wrote: 2) During the period of time the stream is off, if some new files arrive within the folder /A, I lose the notification to copy it. How to workaround that? Make a directory adjacent to /A and /B to use as a staging area for copying. Only copy into the staging area.

Re: Retrieve NSTable DataSource from AppController

2011-06-18 Thread Greg Guerin
Kevin Muldoon wrote: I have an NSTable which receives its dataSource from MyTableController.m. However, my AppController.m needs the data MyTableController.m holds. Since AppController.m hasn't explicitly instantiated MyTableController (MyTableController being an NSObject within IB with

Re: Release a NSWindowController after the window is closed

2011-06-18 Thread Greg Guerin
Matt Neuburg wrote: Why are we able to do that? m. Because ARC is public knowledge: http://clang.llvm.org/docs/AutomaticReferenceCounting.html -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Re: Parent-child Design Pattern

2011-06-12 Thread Greg Guerin
Martin Hewitson wrote: What I'm unsure about is, how to deal with the children objects. I will, in principle, have a ChildView. This raises some questions: 1) Should I have a ChildViewController class? I don't think there's a single answer. Parent/child relationships can be presented

Re: Mac OS Leopard: how to spawn an child application?

2011-06-11 Thread Greg Guerin
Nick wrote: This per user idea does not let me use any advertisement-based IPCs (like user domain sockets or bonjour). I need some per user only IPC - so other user's instance of the process does not interfere with the current user's one. A Unix domain socket can be placed anywhere

Re: How disable Special Characters menu item?

2011-06-06 Thread Greg Guerin
McLaughlin, Michael P wrote: I have a Cocoa app (Xcode 3.2.6) which displays text output in a window. This is pure output not meant to be edited by the user. Accordingly, the textfield is marked as not editable or selectable in IB. Speaking as a possible user, it is often useful to be

Re: Why does NSArray count return NSUInteger?

2011-05-30 Thread Greg Guerin
julius wrote: My question is Why did Cocoa developers make NSArray count return NSUInteger? It's impossible to answer with certainty. The person or persons who made that decision are not on this list (AFAIK). Nor have they documented the rationale behind their design decisions for

Re: add crlf to UITextView

2011-05-25 Thread Greg Guerin
koko wrote: I had changed the string I was appending to @\n\nText to Add which also did not work. You need to identify whether your string is a literal string in your Objective-C source, or whether it's something loaded from somewhere else. If it's loaded from somewhere else, you need

Re: Recursive search for files

2011-05-23 Thread Greg Guerin
James Merkel wrote: I was trying to come up with a way to prevent the user from starting at the wrong place. (Putting up an Alert that says you can't start there). There's a method in the NSFileManager class called isDeletableFileAtPath. I am thinking that all of those volumes and higher

Re: Communicate Between CocoaAsyncSocket and Java Socket

2011-05-08 Thread Greg Guerin
Bing Li wrote: I believe TCP can be used between Java and iOS. However, I worry that particular serialization exists in CocoaAsyncSocket so that Java cannot deserialize successfully. Do you think the issue exists? No. If there is an issue, it's almost certainly in your code. First, I

Re: How to detect string encoding before reading a file in NSString?

2011-04-26 Thread Greg Guerin
Laurent Daudelin wrote: I've found different ways to do that (some pure Cocoa, some using Carbon) but I was wondering about the wisdom of this list as to what is the best way to detect the encoding of a file before passing it to NSString initWithContentsOfFile:encoding:error:? You might

Re: Looking for help scanning entire drives

2011-02-23 Thread Greg Guerin
Laurent Daudelin wrote: I need to write an application that will scan entire drives and compare files between the 2 drives. man rsync See the --dry-run, --stats, and --progress options in particular. rsync can also run as a daemon, which may be easier than trying to control it with

Re: inter-process locks

2011-02-19 Thread Greg Guerin
Alexander Cohen wrote: Is there anyway to do interprocess locks using cocoa ( like a Mutex in Win32 )? The best i've found is not cocoa and uses flock but the man pages say its advisory only which is kindof scary. man semget man semop man semctl They're part of the Posix IPC functions,

Re: -[NSSet containsObject:] returns NO when it should return YES

2011-02-19 Thread Greg Guerin
Michael Crawford wrote: The following gdb console output demonstrates an instance of a media-item persistent-ID property that, when queried gives a large unsigned number. When I ask again using the -longLongValue method, I get the answer I was expecting. When I look inside the set, you

Re: readInBackgroundAndNotify and rsync output

2011-01-29 Thread Greg Guerin
Robert DuToit wrote: I have been googling around and not sure how to do this - is it with NSData or NSStream perhaps? You can use standard C's stdio lib: fopen(), fread(), fseek(), etc. Objective-C is a superset of C. You can use any C library in Objective-C, exactly the same way

Re: lots of find/replace in text file

2011-01-22 Thread Greg Guerin
Jeremy Matthews wrote: I can't help but think there might be a better (and more efficient way) of handling this? How much better (and more efficient) does it have to be? It's a simple game, right? Is it currently too slow or memory- consuming? If not, why change it? If you want a

Re: sending data to a view not yet displayed

2011-01-16 Thread Greg Guerin
Shane wrote: So I guess my question is, how do I make sure my view is able to receive the data I want sent to it before it is ever displayed. I hope that makes sense. Send the data to a Model, not a View. If the View and Model are the same object, then the only way to have a Model is to

Re: NSDictionary key types

2011-01-07 Thread Greg Guerin
Jon Sigman wrote: The underlying issue I was having was how to know when different objects used as keys might be reasonably expected to match, especially if they weren't generated the same way (as with [NSNumber stringValue] and [NSString ...]). That's easy: they match when isEqual:

Re: XML to Plist

2010-12-28 Thread Greg Guerin
Sandro Noël wrote: - (NSDictionary *) plist{ NSMutableDictionary *resultDict = [[[NSMutableDictionary alloc] init] autorelease]; if ([self hasChildren]){ NSMutableArray *child = [[[NSMutableArray alloc]init] autorelease]; for (OSXMLElement *element

Re: XML to Plist

2010-12-28 Thread Greg Guerin
Sandro Noël wrote: the glitch that breaks all my current logic is when there are elements with the same name at the same level. for instance in a RSS, rss chanel item item item this breaks the logic I can apply to a NSDictionary,

Re: Encoding UIViews take long time..

2010-12-11 Thread Greg Guerin
Gustavo Pizano wrote: Any way to improve even more performance?, when I have many many BCItemView on the scene, (around 120+), it takes like 10 seconds to save. :S Measure where your code spends its time by running it in Instruments.app and using the Time Profiler. Use the

Re: label color

2010-12-05 Thread Greg Guerin
Ariel Feinerman wrote: How to get label color before 10.6? If you mean using Interface Builder, select a label, choose Attributes on the Inspector panel. Also notice the class of the label: NSTextField. Then look in NSTextField.h: - (void)setBackgroundColor:(NSColor *)color; -

Re: Releasing static variable concurrent data protection questions...

2010-11-15 Thread Greg Guerin
Frederick C. Lee wrote: 2) Static variables on stack -- I was aware of this. Static and on stack are mutually exclusive. It's impossible to have a variable that is both, so static variables on stack is nonsense. BTW, the C storage specifier for on stack is auto. You might want to

Re: instance fails in its own class

2010-11-07 Thread Greg Guerin
N!K wrote: However, exactly the same statement fails when pasted into -init of Class.m. Build yields warnings Class may not respond to -new. This message suggests you're calling an instance method, not a class method, or that's the way the compiler is interpreting it. Post your

Re: Synchronizing iOS redraw

2010-11-07 Thread Greg Guerin
Rick Mann wrote: Note that the precision of all this isn't so high as to make this hard real time. It just has to be good enough that a person watching the display and comparing it (visually) to an accurate clock would consider them to be synchronized. I'd like to do no worse than 100

Re: NSFileManager and Resource Forks

2010-10-27 Thread Greg Guerin
koko wrote: NSString *outPath = [nspath stringByAppendingString:@/..namedfork/ rsrc]; ok = [fm createFileAtPath:outPath contents:data attributes:nil]; This won't work. You must first create the file (i.e. create the data fork). Only after the file exists can you open and write to its

Re: NSFileManager and Resource Forks

2010-10-27 Thread Greg Guerin
koko wrote: although I have implemented a different solution, just to note the data fork (the file) does exist, it is nspath in the first line. I don't see nspath being used to create a data-fork file in any code you posted. It may be in the code you didn't post, or if I've missed it,

Re: fork/exec vs NSTask

2010-10-24 Thread Greg Guerin
eveningnick wrote:: Basically this is the question about using fork in MacOS. But if there are other ways to launch a process, i'd appreciate if someone shared :) Maybe setup a launchd plist specifying the target executable you want to run, then ask launchd to run it by executing the

Re: NSError help

2010-10-24 Thread Greg Guerin
Dave Carrigan wrote: This is fine, although the code in the else is useless. It won't be fine if err is nil. That's another Cocoa idiom: if the NSError** is nil, then no NSError* is returned. -- GG ___ Cocoa-dev mailing list

Re: NSDictionary allValues not mutable

2010-10-18 Thread Greg Guerin
Trygve Inda wrote: Or does NSArrayController somehow bind to a non-array property, but one that responds as if it were an array? Later in my original post, I suggested subclassing NSMutableArray, so it can bind to NSArrayController. Your new class, i.e. MyDataClass, doesn't just

Re: NSDictionary allValues not mutable

2010-10-18 Thread Greg Guerin
Trygve Inda wrote: Each dictionary (or object with properties) will need to hold roughly 9 textual strings, and there will be on the order of 10,000 objects in the array. I am guessing that dictionary will perform better than a predicate filter given the number of objects. Never guess

Re: NSDictionary allValues not mutable

2010-10-18 Thread Greg Guerin
Trygve Inda wrote: This is probably true since this is a very minor part of my app... I simply need an array to display in a table with the added functionality of being able to locate a record uniquely (each object in the array has a unique ID as one of it's properties). I recommend

Re: The dreaded UITableView won't refresh problem.

2010-10-13 Thread Greg Guerin
G S wrote: Well, this has proven to be a stumper. In case the XIB was corrupted, I deleted the whole thing and started over. Same result. It's a deal-breaker, since this is the main interface of my app. Total standstill. I don't recall seeing any of your code that calls reloadData.

Re: NSDictionary allValues not mutable

2010-10-10 Thread Greg Guerin
Trygve Inda wrote: Ultimately I have a masterDict containing a few thousand dicts (all having the same structure) which I need to convert to an array of dicts to be displayed in an NSTable. When I add to this array (quite rarely), I will actually add a new dict to the masterDict and then

Re: Making Java Calls from Objective-C !!

2010-10-08 Thread Greg Guerin
Naresh Kongara wrote: I want to know how to make java calls from Obj-C. (Java Bridge Seems to be deprecated). Is it possible with out bridge ? If yes , Can any body help me on Where to start ? Use JNI. Also see this Java-Dev message:

Re: Making Java Calls from Objective-C !!

2010-10-08 Thread Greg Guerin
Nick Zitzmann wrote: So I found this, which has an answer that is not use the bridge but I haven't tried it myself: http://stackoverflow.com/questions/ 1822549/calling-java-library-from-objective-c-on-mac One of its answers is use TCP/IP. I have done that, and it works well.

Re: Problem connecting to Oracle with app run from XCode

2010-10-06 Thread Greg Guerin
Timothy Mowlem wrote: I can run the XCode built app as well from the command line after setting LD_LIBRARY_PATH (as a non-admin user and without using sudo). If that env-var is the cause, then printf() the value of it in both cases, and manually compare them. Use the getenv() C function.

Re: Question about architecture

2010-09-09 Thread Greg Guerin
Daniel Lopes wrote: But what you think about separate custom views in diferent nibs? Is that right? Try it. See what happens. Repeat as needed. A lot of design questions can only be answered well by experience. Either you already have the experience from an earlier project, or you

Re: NSTimer not working in a multithreaded application

2010-09-03 Thread Greg Guerin
Abhijeet Singh wrote: Hi,I am working on a multithreaded software that runs on a medical instrument. The software has 2 parts. GUI and worker threads (worker threads sends commands to instrument). The GUI is developed using ObjectiveC and Cocoa. Worker threads are all in C and Carbon.It

Re: NSString / NSURL

2010-08-29 Thread Greg Guerin
Amy Heavey wrote: ... I've tried just using strings, but the applicationSupportFolder returns a string, which then is immutable so I can't add to it? There's a significant misconception lurking here. None of the NSString methods for appending or deleting actually modify the NSString they

Re: How to assure NSTask termination when parent dies

2010-08-13 Thread Greg Guerin
Process group code: // launch the task [task launch]; pid_t group = setsid(); if (group == -1) { NSLog(@setsid() == -1); group = getpgrp(); } if (setpgid([task processIdentifier], group) == -1) { NSLog(@unable to put

Re: NSCountedSet and NSString values question

2010-08-13 Thread Greg Guerin
Philip Mobley wrote: My question is basically how does NSCountedSet handle string values, are they interpreted by their string values or by their object values? If they are by object, then I need to do more work to pull the exact key object from the NSDictionary. NSCountedSet inherits

Re: NSCountedSet and NSString values question

2010-08-13 Thread Greg Guerin
Philip Mobley wrote: The author of the article is somewhat unsure whether using - isEqual: is safe, but after looking at the [NSString hash] documentation I feel confident in my current implementation. That author is confused, and should consult some reference documentation. It's really

Re: [iPhone] Data protection clarification needed.

2010-08-02 Thread Greg Guerin
Sandro Noël wrote: There is no need for that data to be backed up anywhere, as it is retrievable from the web service. the cached data is used for offline operations and later synced back to the web service. We want to control when the data becomes available in an unencrypted format. and

Re: NSInteger compare - Help Needed

2010-07-17 Thread Greg Guerin
Steve Wetzel wrote: if ([sender tag] 10) { The operator is LEFT-SHIFT. The operator is LESS-THAN. If you want to understand what your code is doing, think about what happens when the numbers 0-9 are left-shifted by 10 bits. -- GG

Re: NSStream Questions

2010-07-16 Thread Greg Guerin
Jon Loeliger wrote: I'm writing a network server that needs to accept many simultaneous client connections and keep track of them. I've written the base server parts, roughly in the style of the Apple Examples (SimpleNetworkStreamsExample). These examples, however, only allow one connected

Re: NSStream Questions

2010-07-16 Thread Greg Guerin
John MacMullin wrote: Create a dictionary with the stream as the key, access and maintain the dictionary and stream stuff with the key, (NSValue key), lock or synchronize access to the dictionary. Applies to every pass through handleEvent (and everywhere else), ie., any broadcast code.

Re: Reading in UTF-8 to Data

2010-07-15 Thread Greg Guerin
Brad Stone wrote: Yes, quoted-printable. That's precisely it but in doing my research in the documentation and on the internet it doesn't seem like it's a simple process especially for someone like me with 9 months of Cocoa development experience. There is nothing apparent in your code

Re: Live updating user defaults from a prefpane to a running app

2010-07-14 Thread Greg Guerin
Shamyl Zakariya wrote: So first off, is there some built-in way to simply 'goose' the app and cause its defaults bindings to trigger? There are any number of ways. You could send a signal with the standard C function kill(). You could send a distributed notification (see

Re: Pass-by value… warning

2010-07-07 Thread Greg Guerin
vincent habchi wrote: The analyzer does not figure out that the pt array gets initialized through the loop by copying values directly from a chunk of memory, and spits out the warning about pt [•] not being defined. Maybe I should report this to the LLVM team? That seems like a good

Re: Pass-by value… warning

2010-07-07 Thread Greg Guerin
vincent habchi wrote: That's true, the compiler cannot guarantee that dim 1, which is always the case actually. I am going to put an extra text at the beginning of the method, like: if (dim 1) return; and see what happens. If you need to guarantee dim 1, then your if statement should

Re: How to debug crash on startup of 64-bit build

2010-07-06 Thread Greg Guerin
Jeffrey J. Early wrote: - The crash does *not* occur when the application (either release or debug build) is launched within Xcode. - The crash *does* occur if I launch the app with gdb from the command line (same stack trace). Inspect and then change things about your executable's

Re: Adding secure notes to a keychain programmatically

2010-07-06 Thread Greg Guerin
Brian Marick wrote: I've not been able to find a way to add a secure note to a keychain programmatically. SecItemClass in SecKeyChainItem.h gives no item class for secure notes, which makes me wonder if they're not actually in the keychain but stored somewhere on disk, encrypted with the

Re: Run application before Login starts?

2010-07-05 Thread Greg Guerin
kirankumar wrote: How to run a application before login starts (ie, before when we enter username and password). http://developer.apple.com/mac/library/technotes/tn2005/tn2083.html -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: Capturing output from another task with elevated privilages

2010-07-02 Thread Greg Guerin
Eric Hoaglin wrote: I have the following code: http://www.pasteit4me.com/763005 I'm trying to capture the output of the task that I run. and from what I understand, if you want to do so, you pass a FILE* to AuthorizationExecuteWithPrivileges and then just read it as a normal file (which

Re: Capturing output from another task with elevated privilages

2010-07-02 Thread Greg Guerin
And you also need to identify what OS version you're running on. -- GG ___ 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

Re: Tracking multiple NSURLConnections

2010-06-29 Thread Greg Guerin
If I have lots of connections, say two dozen, or say I'm spawning connections continuously, would this be the most efficient way of doing this? I'd likely store them in an NSArray and iterate/compare until I find the right one. There could be lots of comparisons. Use NSSet instead of

Re: using UTF-32 in NSString.

2010-06-27 Thread Greg Guerin
Georg Seifert wrote: Does anyone has information on how to use Unicode code points higher than 0x. NSString is UTF-16. Use surrogate pairs. -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: autorelease: how does this work!? (if at all)

2010-06-18 Thread Greg Guerin
Jens Alfke wrote: I only saw one error: the method name “GetNSImage” should probably be “image” (method names should be lowercase unless they begin with a common acronym like “URL” or “TIFF”, and the prefix “get” is not used.) Also See These Methods Three: [[frame Camera]

Re: FSCopyObjectAsync hogging the thread?

2010-06-10 Thread Greg Guerin
Kevin Boyce wrote: Sure, it seems like it's just another dispatch from the runloop. Which would be fine if it copied like 100K bytes per invocation, or something like that. It seems instead to run off and copy vast quantities of data before returning. Copying a 4MB MP3 file actually

Re: 32bit float array to PNG thanks to NSBitmapImageRep problem

2010-06-08 Thread Greg Guerin
Pierre-Yves Aquilanti wrote: NSData * binaryData=[NSData dataWithContentsOfFile:binaryPath]; // binary is just a 32bits array full of 1500. and 3000. as described previously Does the endian-ness of the floats in the file match the endian-ness of the processor the code is running on?

Re: Off Screen bitmap drawing

2010-05-31 Thread Greg Guerin
Development wrote: What I get is a black rectangle of scrambled colors and no discernible resemblance to the page data. ... void * bitmapData = malloc(byteSize); ag IIRC, malloc() does not initialize the returned memory. Since you don't seem to do any other initialization, you

Re: posted notifications are sent twice

2010-05-30 Thread Greg Guerin
Reinhard Segeler wrote: I post notifications to interchange infos between classes. They are always posted twice, even though they are surely only posted once. Does anybody know why? Make sure you haven't registered two listeners, or a single listener twice. -- GG

Re: Stealing settings from Mail.app

2010-05-28 Thread Greg Guerin
Chris Idou wrote: I've got an app that needs to send out emails. I'm trying to import mail settings from Mail.app. For some reason my keychain has passwords for smtp.gmail.com, but not for smtp.me.com. AFAIK, there is only the one MobileMe password for all uses. Double-click your

Re: subclass overwriting superclass ivar

2010-05-26 Thread Greg Guerin
Jonathan Mitchell wrote: MGSScriptExecutorManager *scriptExecutorManager; NSString *tempFilePath; } @interface MGS_B : MGS_A { @private NSData *stderrData; } Change the ivars to something like this: MGSScriptExecutorManager *scriptExecutorManager;

Re: Getting TextEdit to Recognise UTF-8 Output

2010-05-21 Thread Greg Guerin
K.Darcy Otto wrote: Question: Is there any header I can put at the beginning of the text file to get it automatically recognised as UTF-8? It's not a header, but there is the com.apple.TextEncoding xattribute. See post #4 in the following thread:

Re: singleton design pattern

2010-05-19 Thread Greg Guerin
Abhinay Kartik Reddyreddy wrote: everytime you ask for a uniqueInstance it looks like it retrieves a new instance not the existing instance... since you set the uniqueinstance to nil inside that function, your function will discard the previous instance if any and then create a new

Re: NSTask and piped commands

2010-05-18 Thread Greg Guerin
appledev wrote: arguments = [NSArray arrayWithObjects: @-c, @/bin/df -k| / usr/bin/grep /dev/ | /usr/bin/awk '{print $1 $4 $5 $6;}',nil]; Your awk syntax is somewhere between quirky and wrong. Since you didn't mention what the problem was, I will assume the output you want is not

Re: AsyncUdpSocket: Receiving duplicate UDP Packet

2010-05-14 Thread Greg Guerin
Todd Burch wrote: [aSyncSocket receiveWithTimeout:-1 tag:1]; //Listen for the next UDP packet to arrive...which will call this method again in turn. Don't start another receive. Handle or ignore the packet, then always return NO from the delegate method. The single outstanding

Re: Client/Server Design

2010-05-05 Thread Greg Guerin
Phillip Mills wrote: I've read the notorious Technical Note TN2152, iPhone OS does not currently provide a direct way for third party developers to transfer data between the user's computer and their device, but I assume common workarounds are in place. Obviously I could follow the

Re: NSCalendar date calculation anomaly

2010-04-28 Thread Greg Guerin
Scott Ribe wrote: NSDate * cd = [[NSCalendar currentCalendar] dateByAddingComponents: dc toDate: [NSDate dateWithString: @2001-01-01] options: 0]; I think the dateWithString: is wrong. From the NSDate reference: You must specify all fields of the format string, including the time zone

Re: NSCalendar date calculation anomaly

2010-04-28 Thread Greg Guerin
A couple suggestions: If you always calculate using noon on any given date, rather than midnight, then DST transitions won't affect the year/month/day components. If you don't want to use noon, then NSTimeZone daylightSavingTimeOffsetForDate: should be taken into account. -- GG

Re: menu madness with retain count

2010-04-27 Thread Greg Guerin
Bill Appleton wrote: 3) when i set the menus i have created for NSApp using setMainMenu then... what? who owns them? how do i set more menus for NSApp? how do i get NSApp to release the current set? You are not responsible for NSApplication's retention or release of menus. It alone is

Re: CharacterSet: CharSet(A) - CharSetUnicode = remainder ?

2010-04-24 Thread Greg Guerin
Filip van der Meeren wrote: What I was trying to do is the following: C/C++ operator| NSCharacterSet operation - | (or) | [aCharSet formUnionWithCharacterSet:bCharSet]; (and)

Re: NSNumberFormatter not working for me ?

2010-04-14 Thread Greg Guerin
Bill Hernandez wrote: I've worked with lots of number formatters over the years, and that is what they do, format numbers into strings, any kind of string... I looked at the header file for NSNumberFormatter, and there seem to be 9,000,000+ methods, it is amazing. Buried in there, there

Re: NSPipe (NSFileHandle) writedata limit?

2010-04-12 Thread Greg Guerin
McLaughlin, Michael P wrote: Is there a recommended (better) way of sending and receiving a known (large) amount of data to and from a subtask? Is there any sample code anywhere similar to what I need? I couldn't find anything close enough to work. Reading your description, my first

Re: NSPipe (NSFileHandle) writedata limit?

2010-04-12 Thread Greg Guerin
McLaughlin, Michael P. wrote: main -- subtask (main send data) -(void)sendData:(void*)data numBytes:(NSUInteger)sz taskTag: (NSString*)tag { NSData *dataset = [NSData dataWithBytes:data length:sz]; NSNumber *num = [NSNumber numberWithUnsignedInteger:sz]; // NSUInteger NSDictionary

  1   2   3   4   >