Re: Indexing broken for one project

2022-02-12 Thread Kirk Kerekes via Cocoa-dev
Sort of straw-grasping I would try with Xcode under these circumstances… Try changing the target CPU/OS setting to something else, build, and see if the indexing works. If it does, make the minimal changes needed to appropriately build your target. If it doesn’t, discard straw. Kirk

Cocoa dylib access by C program

2020-11-13 Thread Kirk Kerekes via Cocoa-dev
Change your .c files to .m. Then you can use objective-c calls _in_ your C code. Objective C is a proper superset of C, and so you just need to inform the compiler of your intent by changing the file extension(s). Kirk Kerekes (iPhone) > Message: 1 > Date: Fri, 13 Nov 2020 11:16:23

Need for Swift

2019-10-11 Thread Kirk Kerekes via Cocoa-dev
onomous vehicle software. What they have ended up is a kind of disciplined, compiling Python — not really a bad concept, given the goals. I would not want to be at the mercy of a vehicle piloted by C++. Or Objective-C, for that matter. (And I happily use ObjC every day). Kirk K

Re: Cocoa-dev Digest, Vol 16, Issue 63

2019-07-26 Thread Kirk Kerekes via Cocoa-dev
> what I really want is to do is drag a couple of URLs into System Preferences? > ?Full Disk Access? list, and that one accepts only lists of URLs, as far as I > know. > > Now, I want it to look like a user is only dragging an icon of my application > (which he/she really does), but

Re: Mysterious write-only SMB behavior (Kirk)

2017-05-01 Thread Kirk Kerekes
modifies (renames) and relocates remain visible, and > directories that it creates are visible. > > If this rings a bell with anyone, I would appreciate a clue, which would be > one more than I have now. > > Kirk Kerekes > (iPhone) >

Re: Displaying '%' in the UI (Velocityboy)

2012-04-19 Thread Kirk Kerekes
On Apr 18, 2012, at 2:00 PM, cocoa-dev-requ...@lists.apple.com wrote: Re: Displaying '%' in the UI (Velocityboy) As a possibly more clear alternative to escaping the %, you could use: [NSString stringWithFormat:@%.0f%@,ratio1, @%] Or, even more cocoa-fied ObjC: [NSString

RE: Stenography

2012-04-02 Thread Kirk Kerekes
For the sake of later Googlers, the word is Steganography (http://en.wikipedia.org/wiki/Steganography. Stenography is writing in shorthand. NSBitMapImageRep allows individual pixel access. On Apr 1, 2012, at 12:16 AM, cocoa-dev-requ...@lists.apple.com wrote: Message: 9 Date: Tue, 27 Mar

Re: Cocoa-dev Digest, Vol 8, Issue 415

2011-06-09 Thread Kirk Kerekes
On Jun 8, 2011, at 1:09 PM, cocoa-dev-requ...@lists.apple.com wrote: Re: Login item not hidden My app should execute several tasks fired by several timers. Actually the app must remain open in order to fire the timers, and this is not what my client wants. He wants the tasks run as hidden.

RE:Trouble with design pattern

2011-02-18 Thread Kirk Kerekes
NSNotification is your friend. When your custom views do something notable, they should post or enqueue an NSNotification containing the relevant info. Presumably you will have subscribed your NSDocument to those notifications in your override of -windowControllerDidLoadNib. This way the

re: NSDictionary key types

2011-01-07 Thread Kirk Kerekes
If you are insufficiently confused, I thought I would add some additional confusion. 1. Don't worry overmuch about hash values. Particularly, never succumb to the temptation to store them persistently. The -hash algorithm for a particular class may vary with OS version. It certainly

Re: LOCATING MEDIA FILES IN MACINTOSH

2011-01-07 Thread Kirk Kerekes
I may have missed it, but I don't believe anyone has mentioned my first choice in this sort of task: -- the programmatic interface to Spotlight: http://goo.gl/JGgVQ Introduction to Spotlight Query Programming Guide combined with UTIs: http://goo.gl/9AxdT Introduction to

RE: Obscuring an NSString (Adam Gerson)

2010-12-02 Thread Kirk Kerekes
If you convert the NSString into an NSData,(dataUsingEncoding:) and then Base64 encode it into an NSString, doesn't that get you what you want? I am writing an NSString to a file and I would like to obscure it in a two way reversible fashion. It doesn't have to be major hacker proof, just

RE:Instantly delete a directory without recursion?

2010-10-04 Thread Kirk Kerekes
Is there a way to delete a directory instantly and completely without first deleting all its subdirectories and files recursively? The hierarchical structure that you see is not real -- directories are not physical containers for the files that they appear to contain. The directory hierarchy

Re: Distributed object vending problem

2010-09-22 Thread Kirk Kerekes
Others seem to have found http://www.thotzy.com/THOTZY/Distributed_Objects_Demo.html -- to be useful. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the

re; Distributed object vending problem

2010-09-20 Thread Kirk Kerekes
How do I send messages to a server's vended object without having to include the server's entire dependency tree? Incorporate the methods that you actually need for remote interaction into a protocol that is defined in a separate .h file, and #import it at both ends of the connection. You

RE:decodeObjectForKey without definition

2010-08-20 Thread Kirk Kerekes
Open the file in a hex editor (0xED, for example), if it has the text plist near the beginning, it may have been archived with NSKeyedArchiver. If instead it displays 0x3 or 0x4 followed by 0xb followed by typedstream or streamtyped at the beginning of the file, it was probably archived with

RE:Sample code for simple sharing using Bonjour?

2010-07-28 Thread Kirk Kerekes
http://www.thotzy.com/THOTZY/Distributed_Objects_Demo.html might be useful. ___ 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: Reading in UTF-8 to Data

2010-07-16 Thread Kirk Kerekes
In the first page of Google hits for nsstring quoted-printable http://stackoverflow.com/questions/491678/can-you-translate-php-function-quoted-printable-decode-to-an-nsstring-based-ob This is at least a starting point. ___ Cocoa-dev mailing list

Re: Adding an image to a project

2010-07-14 Thread Kirk Kerekes
Google for OpenCV Cocoa -- there is at least one Google Code hosted project, and many other hits. I'll bet someone has solve this and many other similar problems already. Don't struggle, Google. ___ Cocoa-dev mailing list

Re: NSPredicate to exclude specific elements??

2010-03-21 Thread Kirk Kerekes
I suggest that you need to provide the actual code you are using to generate the NSPredicate, because what you are wanting to do just isn't that hard. The problem may not be in the predicate format string. I would have used @NOT CONTAINS[cd] %@ as my first pass, and been quite surprised if it

RE: NSDictionary trouble

2010-01-19 Thread Kirk Kerekes
I wish NSDictionary (NSMutableDictionary actually) could handle arbitrary mappings of one type of object to another, without copying the keys. A string makes a good key most of the time but what about the case where you want to do the reverse mapping, to find the string which you have

RE: Analyzer in error?

2010-01-14 Thread Kirk Kerekes
AFAIK, yes. Please file a bug to add to the ones I have filed on this and similar behaviors. On Jan 13, 2010, at 9:49 PM, cocoa-dev-requ...@lists.apple.com wrote: Message: 10 Date: Thu, 14 Jan 2010 12:54:46 +1100 From: Graham Cox graham@bigpond.com Subject: Analyzer in error? To:

Re: Search multiple / all properties in single NSPredicate statement

2010-01-13 Thread Kirk Kerekes
Create a property for the target class that concatenates the text value of all the other properties of interest, and then search on that? On Jan 13, 2010, at 9:46 AM, cocoa-dev-requ...@lists.apple.com wrote: Message: 5 Date: Tue, 12 Jan 2010 17:10:10 -0800 From: Mike Chambers

Re: iPhone: validate a NSString for US zipcode

2010-01-07 Thread Kirk Kerekes
In my testing NSDictionary's objectForKey: is extremely fast, with NSSet's member: coming in second and everything else trailing waayyy back. I was using simple immutable keys and complex, mutable objects, which may have affected the results. YMMV. So if you make a dictionary where the ZIPs

Re: GC crash due to being naughty

2009-10-16 Thread Kirk Kerekes
... This led me to generate a new hypothesis: that I am an idiot. I have now proven that hypothesis to my full satisfaction. ... A remarkably universal observation. I certainly have made it many times about myself. One of my rules of thumb about Cocoa coding is Code for your Inner

Re: Stability on Snow Leopard

2009-09-23 Thread Kirk Kerekes
I _strongly_ suggest that you (at least temporarily) use the LLVM/ CLANG compilers in XCode, and use the build and analyze option that is then available. By the time you have fixed every issue that CLANG finds, I suspect that 90% of your crashes will have evaporated, as well as quite a few

Re: When do I need to override hash?

2009-08-21 Thread Kirk Kerekes
AFAIK, NSDictionary specifies that it COPIES keys, and RETAINS objects. Thus even if you were to use an NSMutableString as a key, you could not mutate the key in the NSDictionary. So the only way you are likely to get into trouble with keys is if you do troublesome things like use oddball

RE: A simple DO situation - point me in the right direction!

2009-08-20 Thread Kirk Kerekes
I need to implement a system where I can verify the number of running copies of my app on a local network against a site license. I thought DO might be a good way to implement this. Consider using just Bonjour for this -- with careful implementation of the name and type service strings, you

Re: NSString -componentsSeparatedByString: line break

2009-07-27 Thread Kirk Kerekes
How about: [array filterUsingPredicate:[NSPredicate predicateWithFormat:@SELF.length 0]]; LIKE is awfully fancy for the purpose. On Jul 27, 2009, at 2:03 PM, cocoa-dev-requ...@lists.apple.com wrote: Date: Mon, 27 Jul 2009 12:36:27 -0500 From: Chase Meadors c.ed.m...@gmail.com Subject:

Re: NSSocketPort initRemoteWithTCPPort is never valid

2009-07-15 Thread Kirk Kerekes
An NSSocketPort is intended for use with Distributed Objects and NSConnection or, at least, to communicate with another NSSocketPort at the other end. The documentation used to state this, possibly erroneously. It no longer does so: NSSocketPort is a subclass of NSPort that represents a BSD

Re: Long term performance of NSConnection

2009-07-06 Thread Kirk Kerekes
Use Activity Monitor (or other tool of your choice) to check for a port leak. ___ 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: [Newbie] Displaying an NSImage inside an NSTextField?

2009-06-30 Thread Kirk Kerekes
An alternative to the other ideas presented previously: Read up on NSAttributedString. Use NSTextAttachment to attach your image to an NSAttributedString, and then use -setAttributedStringValue to set the string in your NSTextField. This has worked nicely for me with the cells in

Re: repeatable random numbers in an object

2009-06-17 Thread Kirk Kerekes
http://www-cs-faculty.stanford.edu/~knuth/programs/rng.c ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Re: Doc kind from extension

2009-06-11 Thread Kirk Kerekes
UTIs will get you there. http://developer.apple.com/documentation/Carbon/Conceptual/understanding_utis/understand_utis_intro/understand_utis_intro.html#//apple_ref/doc/uid/TP40001319-CH201-SW1 ___ Cocoa-dev mailing list

RE: SQLite/MySQL BLOB-creator application needed.

2009-05-28 Thread Kirk Kerekes
So I need a simple OS X application (either an existing desktop application, or a simple command-line application) that can serialize a PNG image into a BLOB (keeping all metadata, etc.) for access by a SQLite (or any SQL-type DB) engine (used within a Cocoa/iPhone application). AFAIK a SQLite3

Re: String Comparison and return values

2009-05-26 Thread Kirk Kerekes
Consider the pattern: [[thing description] isEqualToString: someString]; All objects will return a string for description. Whether it is meaningful in your terms is a whole other issue. NSNumber will return a sensible numeric string. NSString will return itself. Generally, property-list

Re: Network Reachability APIs

2009-05-21 Thread Kirk Kerekes
I may have missed it, but I think that an essential point about the Reachability API has been left unmentioned: The OS Reachability API does its work without annoying the user -- something that is quite difficult to guarantee with roll-your-own versions. Believe it or not, there are still

Re: microsoft file formats in cocoa

2009-05-18 Thread Kirk Kerekes
-- And it is easy to wrap in a Cocoa wrapper -- I've done so. The interface is appended to this email. The libxls open source project on sourceforge.net allows you to read and parse .xls files. This library works under OSX - I know, I'm one of the developers :-) // // XLSWorkbook.h //

RE: File formats for multi-doc app: packages, single files or zipped alternatives

2009-05-17 Thread Kirk Kerekes
Serialized NSFileWrapper? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your

Re: Subject: detect option key on startup

2009-05-10 Thread Kirk Kerekes
of Cocoa available during your initialization. On May 9, 2009, at 5:58 PM, Mitchell Livingston wrote: In what method would that need to be in to get the key on startup? I tried without luck in init and awakeFromNib. On Saturday, May 09, 2009, at 06:48PM, Kirk Kerekes kirkkere...@gmail.com

RE: Subject: detect option key on startup

2009-05-09 Thread Kirk Kerekes
How About: ([[NSApp currentEvent] modifierFlags] NSAlternateKeyMask) ___ 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: Distributed Objects via Bonjour?

2009-05-08 Thread Kirk Kerekes
Good DO demo code is rather scarce, and the best-practices are highly dependent on the target OS. For one example showing about every permutation imaginable, and a little-recognized simplified Bonjour strategy, try: http://thotzy.com/THOTZY/Distributed_Objects_Demo.html The demo

RE: How to clone a mutable dictionary

2009-04-24 Thread Kirk Kerekes
Simple, brute-force method: archive the dictionary, then unarchive it. The result is a 1-line deep copy. Of course, that assumes that all the dictionary objects/keys support archiving. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

RE: performSelectorOnMainThread primitives for withObject

2009-04-22 Thread Kirk Kerekes
You don't have to use NSInvocation -- you could instead define a category on NSView that wrapped setActivated: ( STANDARD COMPOSED IN MAIL WARNING ) - (void) setActivatedWithObjectValue: (id) value { [self setActivated: [value boolValue]]; } OR - (void) setActivatedWithObjectValue:

Re: filteredArrayUsingPredicate and points

2009-04-16 Thread Kirk Kerekes
Something like: [NSPredicate predicateWithFormat: @containsPointString %@ == YES, NSStringFromPoint(point)]; On Apr 16, 2009, at 5:24 AM, Alexey Baev wrote: On Apr 15, 2009, at 19:59:39, Kirk Kerekes wrote: Untested suggestion: Try adding a method to MyDot that will accept

Re: SQLite and Unicode

2009-04-07 Thread Kirk Kerekes
To break your text into sentences, I suggest swiping componentsSeparatedByCharacterRunFromSet: from: http://thotzy.com/THOTZY/ComponentsSeparatedByCharacterRunFromSet%3A.html -- and create a character set of your sentence-splitting characters to prime it with. If you need to preserve

RE:Beachball on Lengthy Task

2009-04-05 Thread Kirk Kerekes
Along with threads and various asynchronous techniques already mentioned, you should also consider creating a separate UI-less foundation tool to perform your lengthy task, controlled with NSTask in your main app. This yields all of the benefits of a thread, with none of the threading

RE: Best Practice for reading a string with NSScanner

2009-04-04 Thread Kirk Kerekes
It looks like you have tabular data to deal with, like punch cards. That means that you can assume a fixed character position for the beginning of each column in the table. And your code can infer those positions the same way you would -- by looking at the source file. Or you can just

Re: NSTask Leaking...

2009-01-29 Thread Kirk Kerekes
// must include Security framework to use this // Tiger or later for SHA256 #import libCdsaCrypt.h @implementation NSData (DataDigest) - (NSData *) digestWithCDSAType:(CSSM_ALGORITHMS) algorithm { // does not validate algorithm selection, let the framework worry about that. NSData

Re: NSSocketPort == BSD Socket

2008-12-05 Thread Kirk Kerekes
Well it looks like you ought to be able to use NSPortMessage's sendBeforeDate: method, if you are seeking a pure NSPort-and-friends technique, but I've never tried that. It actually looks like it might be handy, if it works. It would handle some of the overhead tasks that otherwise one

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

2008-12-04 Thread Kirk Kerekes
It is *possible* to use NSSocketPort to create a socket which you then communicate with using other techniques, but you can't use NSSocketPort directly to talk to a non-Cocoa app. While the documentation used to imply this, it did not appear to be true then, and the documentation no longer

Re: NSSocketPort == BSD Socket

2008-12-04 Thread Kirk Kerekes
-[NSSocketPort socket] returns a file descriptor. Write to it. Init an NSFileHandle with it. (-[NSFileHandle initWithFileDescriptor:]) It's all just sockets/files/descriptors. But raw messaging is not the same as writing raw bytes to a TCP stream. All that means is that you can use the

Command-clicking table column

2008-11-30 Thread Kirk Kerekes
In at least Leopard, I was surprised to discover that command-clicking NSTableView columns does not appear to function as per the standard interface guidelines (discontinuous selection): A Command-click should result in a discontinuous selection. With discontinuous selection, in which

Re: Command-clicking table column -- radar://6407526

2008-11-30 Thread Kirk Kerekes
Done: radar://6407526 Now that I have done that I eagerly anticipate the post that shows me my bonehead error. On Nov 30, 2008, at 2:02 PM, [EMAIL PROTECTED] wrote: I was surprised to discover that command-clicking NSTableView columns does not appear to function as per the standard

Re: How to implement float min(float x, ...) ?

2008-11-17 Thread Kirk Kerekes
How to implement float min(float x, ...) ? I suggest you not use var_arg functions if you can avoid them. So I propose a different path. As a jumping-off point, here is a category method on NSData that assumes that self (the NSData instance) is an array of floats: (The -floats category

Re: How to count composed characters in NSString?

2008-09-28 Thread Kirk Kerekes
Users don't see characters, they see glyphs. If you want your count to maximally agree with user perception, you need to be counting glyphs, not characters. See NSLayoutManager, esp: - (NSRange)glyphRangeForCharacterRange:(NSRange)charRange -- and friends. If you are showing

Re: Inter-machine notifications

2008-09-11 Thread Kirk Kerekes
I would look at Distributed Objects again. It really isn't intrinsically client-server oriented any more than Cocoa is. A client-server architecture is just one way to use the distributed object functionality. It does tend to be easier to have a single- source-for-truth to keep things

Re: How to create a GUID?

2008-09-07 Thread Kirk Kerekes
@implementation NSString (KKUUIDString) + (NSString *) UUIDString { CFUUIDRef UIDRef; NSString *uidString; UIDRef = CFUUIDCreate(NULL); uidString = (NSString *)CFUUIDCreateString(NULL, UIDRef); CFRelease(UIDRef); return [uidString autorelease]; }

Re: global NSMutableDictionary

2008-07-29 Thread Kirk Kerekes
Consider class methods instead of globals. See: http://www.thotzy.com/THOTZY/Robust_Cocoa_Coding.html Unmentioned there is the additional advantage of lazy initialization: (composed in Mail) + (NSMutableDictionay *) myGlobalDict { static NSMutableDictionary * result = nil; if(!result)

Re: GNUStep, OpenStep, NextStep, Cocoa port?

2008-03-08 Thread Kirk Kerekes
IMNTBHO, OpenStep/GnuStep are not useful means for achieving cross- platform GUI applications, at least not if the platforms are OS-X and Win32. Anyone who would disagree should point two out. OTOH, Cocotron, http://groups.google.com/group/cocotron-dev while spottily incomplete, is Doing