Re: Does anyone else dislike Xcode 4?
> Alex Kac 2011-07-24 13:07 wrote: > ...its a one window interface... This is a deal killer. Seeing things next to each other is vital. It's the reason we had to chop down so many trees in the olden days, for highly cross-referenced listings (even with tiny little laser print shrinking 2 older green-bar listing pages to one 8.5" by 11") to stretch out across conference tables next to each other. > Yes it did take some time to get used to it and > relearn how to do basic things. At first I hated > Xcode 4's way of dealing with libraries because > I'd spend literally days trying to get it to > link static libs that used to be a breeze in > Xcode 3. Its not a matter of "computer should > deal how I work and not me learning how it works" > because in the first place we learned how Xcode 3 > worked, not how we worked and this is engineering > after all. OTOH, some of us have been linking static and dynamic libraries since the 1970s and it was straight-forward enough back then that we could teach 70 year old mechanical engineers how to do it, so why should we have to stand on our heads and sacrifice pigeons to get it to work, now? > All that rambling to say that just like Lion, > just because its different doesn't mean its bad. Right. Back to dev talk. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
> Alex Kac 2011-07-24 13:31 wrote: >> 2011-07-25 20:22, Jeffrey Oleander wrote: >>>> Alex Kac 2011-07-24 13:07 wrote: >>>> ...its a one window interface... >>> >>> This is a deal killer. Seeing things next to >>> each other is vital. It's the reason we had to >>> chop down so many trees in the olden days, for >>> highly cross-referenced listings (even with tiny >>> little laser print shrinking 2 older green-bar >>> listing pages to one 8.5" by 11") to >>> stretch out >>> across conference tables next to each other. > OK so Xcode can do that. Turn on the assistant, and > click on a file to open. Then option click on > another file... Alternating looking at tiny little bits of 2 files (like trying to look at a panoramic land-scape through a straw) is not remotely the same as looking at several files at the same time side by side. That's a good way to make mistakes, and burn up a lot of time hunting them down, later, because they're usually mistakes the compiler won't flag. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired
> From: Ben Kennedy > Subject: UITapGestureRecognizer and state/action w/rt numberOfTapsRequired > To: "Cocoa-Dev List" > Date: Tuesday, 2011 November 8, 14:56 > From > http://developer.apple.com/library/ios/#documentation/uikit/reference/UITapGestureRecognizer_Class/Reference/Reference.html > : > >> Although taps are discrete gestures, they are discrete >> for each state of the gesture recognizer; thus the >> associated action message is sent when the gesture begins >> and is sent for each intermediate state until (and >> including) the ending state of the gesture. Code that >> handles tap gestures should therefore test for the state of >> the gesture, for example: >> >> - (void)handleTap:(UITapGestureRecognizer *)sender > { if (sender.state == > UIGestureRecognizerStateEnded) > { // > handling code } } > > This suggests that if I set numberOfTapsRequired = 2, I > should be able to get action for both a single tap (i.e. the > first of a pair of taps), as well a double-tap. > However, in iOS 5 this does not appear to be the case; my > action method is not called until the numberOfTapsRequired > has been satisfied. > > In order to respond to both a single and double tap, do I > thus need to attach two gesture recognizers? Go another layer more primitive: http://www.oreillynet.com/pub/a/iphone/excerpts/iphone-programming-user/touch-patterns.html http://iphonedevelopertips.com/user-interface/detect-single-tap-in-uiscrollview.html http://developer.apple.com/library/ios/documentation/UIKit/Reference/UITouch_Class/Reference/Reference.html#//apple_ref/occ/instp/UITouch/tapCount ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to cancel a loading document in NSDocument's readFromURL:ofType:error method ?
> From: Gilles Celli > Subject: Re: How to cancel a loading document in NSDocument's > readFromURL:ofType:error method ? > To: "Kyle Sluder" , "Mike Abdullah" > > Cc: cocoa-dev@lists.apple.com > Date: Thursday, 2012 February 9, 14:23 > > Thanks for the quick answers! > > Yes I'm targeting Mac OS X 10.6 and later so > canConcurrentlyReadDocumentsOfType: is a welcome addition, I > completely forgot that. > > Strangely if I put the method > canConcurrentlyReadDocumentsOfType: inside my NSDocument I > get a warning when trying to open a document (It seems to be > a QuickLook error ?) on Mac OS X 10.7.3: > > [QL] QLError(): +[QLSeamlessDocumentOpener > seamlessDocumentOpenerForURL:] should only be called in the > main thread > > Now for the cancel question: If I take the more traditional > approach to cancel the operation inside readFromURL, should > I fire up a new thread to check the flag's status ? > > Gilles > > >> On 2012 Feb 9, at 19:32, Kyle Sluder wrote: >>> On Thu, 2012 Feb 9 at 08:01, Gilles Celli wrote: > >> I searched the mailing-list but didn't find an > answer….so sorry if this was posted before: > >> > >> I've setup a document based application which can > read large ASCII data files (>150MB). > >> > >> When opening the document the method > readFromURL:ofType:error is used which then opens a small > feedback window > >> showing the file name and an animated > progress bar with a "Cancel" NSButton. > > > > If you're targeting Snow Leopard or later, you should > override > > +canConcurrentlyReadDocumentsOfType: to return YES. > That will cause > > -initWithContentsOfURL:ofType:error: (and therefore > > -readFromURL:ofType:error:) to execute on a background > thread. > > > > Then you get to the canceling part. The traditional > approach would be > > to set a flag when the user clicks Cancel, and > periodically check this > > flag from within your -readFromURL:… implementation, > returning an > > NSUserCancelledError if you detect it has been set. > > > > A more modern approach might be to use > NSOperationQueue. Instead of a > > loop, -readFromURL:… would divide its work into > operations and enqueue > > those on a queue. Clicking the Cancel button would > enqueue an > > operation that would shut down the -readFromURL:'s > operation queue and > > cause it to return an NSUserCancelledError. I don't get it. I though with OS X one of the great benefits was finally having pre-emptive multi-processing instead of co-operative multi-processing. Sure, when the user clicks "Cancel" it's an "event", it gets stuffed on an event queue, the wheels grind round and round and eventually that event gets popped off of the queue and paid attention to. But then... then the event processor, the action, should see that it needs to interrupt the file transfer cold, as close to immediately as possible, the buffers that were being used for the transfer freed, and control returned to the regularly scheduled programming. Neat. Sweet. And at least somewhat close to immediate in user terms. Not, Eyeore style... "ohhh, maybe... some... day..., maybe after it gets done filling the next buffer or 10... we may think about getting around to doing something about it." The master, the user, wants it done now! (Stuff like this gets sooo frustrating when Apple has the best there is... We love their systems so much...and yet...) ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iOS books, etc for experienced OSX programmers
> From: James Lee > Subject: Re: iOS books, etc for experienced OSX programmers > To: "Koen van der Drift" > Cc: "Cocoa Dev" > Date: Saturday, 2013 February 23, 14:21 > I am looking at Xcode 4 by Fritz Anderson now. I read everything I could get my hands on: Maher Ali _Advanced iOS 4 Programming: Developing Mobile Applications for Apple iPhone, iPad, and iPod Touch_ (669 pages; QA76.8; I64; A448; 2010) Wei-Meng Lee _Beginning iOS 4 Application Development_ (617 pages; QA76.8; I862; L44) Wei-Meng Lee _Beginning iPad Application Development_ (544 pages; TK; 5103.4885; L44; 2010) Chris Stevens _Designing for the iPad: Building Applications that Sell_ (328 pages; QA76.8; I863; S74; 2011) James A. Brannan & Blake Ward _iOS SDK Programming: A Beginner's Guide_ (483 pages; QA76.76; O63; B727) Vandad Nahavandipoor _iOS 4 Programming CookBook_ (594 pages; QA76.76; O63; N34; 2011) Joe Conway & Aaron Hillegass _iPhone Programming: The Big Nerd Ranch Guide_ (381 pages; 004.16) Patrick Alessi _Professional iPhone and iPad DataBase Application Programming_ (353 pages; 005.265) but they would have been better if the authors had used these as examples: Ralph Grishman _Assembly Language Programming for the Control Data 6000 Series and the Cyber 70 Series_ (COMPASS) James E. Thornton _Design of a Computer: Control Data 6600_ ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Core Data Reverse Engineering KickStarter Project
On 2013 Jun 24, at 06:10, Michael Crawford wrote: Scott, How do you do it? Honestly I want to know. The best I've ever been able to come up with is that if someone always writes the same kind of code, say repeatedly writing eCommerce sites for different clients, then they can base an estimate for a new project on experience with past project. But that's not the way I've ever worked. I always write completely new things, that bear no relation at all to past projects, so I don't have any meaningful basis for estimates. My colleagues tell me I should know how to estimate. I can see how it would be helpful but I've never been able to figure out how to actually do it. I concur in both personal experience and wondering how some manage to estimate (with more or less windage and the occasional "planned miracle"). The big sticking point is that, when you're always doing something new, there are a number of points in the project when you have to do research, and repeated rounds of experimentation... only you never know how many cycles of experimentation will be required to arrive at a satisfactory solution. It's not as though we haven't read a book or three on the subject of estimation (and the sections in the texts), but they seem to have a blind-spot. Or do they simply avoid doing significantly new things, and instead restrict what they do to the well-known? ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Converting RTFD to Word with embedded images
On 2013 Jul 15, at 13:06, Kyle Sluder wrote: On Jul 15, 2013, at 8:59 AM, Buddy Kurz wrote: Pages can export to Word with the attachment. Why can't I? Pages probably doesn't use NSString's Word exporter. What happens if you use TextEdit? What is RTFD format? It's a directory, with an RTF file with references to the image files in its extended rtf tags, isn't it? (Sometimes I suddenly find an old, untouched RTFD "file" that doesn't want to open up in TextEdit as rtfd anymore, i.e. the images are no longer recognized as embedded.) Anyway, rtf tags are fairly simple to humanly read and figure out, though it's not really a "standard". Then the trick becomes parsing out how MSFT does it when you save one of their files with embedded images as rtf... or are they calling it rtfx or some such, now? Make your "file" be "the same" and MSFT should import it. ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: 30x faster JSON date parsing
On 2013 Sep 09, at 13:14, Marcel Weiher wrote: On 2013 Sep 9, at 18:11 , Jens Alfke wrote: [...] [fg160,160,160;16:34:40.488| [fg0,128,0;[;NSDateFormatter took 26.97 µsec [fg160,160,160;16:34:48.649| [fg0,128,0;[;CBLParseDatetook 0.47 µsec (58x) Now, the tradeoff is that the optimized code parses only ISO 8601 dates — this is the informal standard used with JSON, so it’s become really common. It looks like "2013-09-09T17:52:12Z”. That might actually be a feature. (Also: didn’t know ISO did informal standards…) Looks like a feature, to me. The issue is users entering dates -- Julian (as in pre-Gregorian/"old style", not yyddd), day of week, month and year (i.e. incomplete dates, e.g. from grave-stones which were shot up in a war missing individual digits, or chemical break-down of the material), Hebrew calendar, Muslim calendar, Chinese, Japanese... with variant orders of the parts, variant punctuation, etc., leap seconds, expressions like "noon" or "nones", "first bell of the third watch" (?)... even just typographical errors... It at first seems like it should be sooo simple, but it is not. I go into analysis paralysis just thinking about it... and am sorely wishing I could just enforce ISO date entry as in the quoted example by using pop-up menus. Some do, but the dread of customer rebellion is strong, and they want to enter them in the slap-dash, hurried, harried ways they're used to writing them, or finding them in their source materials. Near-perfection, even satisficing, in interpreting such is expensive. MSFT Javascript (and it's non-standards) is evil, hence, JSON is evil. Further deponent saith nought. ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Progress for archiving/dearchiving
On 2013 Sep 16, at 08:53, Graham Cox wrote: If I wanted to add some sort of progress reporting to archiving and dearchiving, what's a good way to do it? The problem seems to me to know what the 'count' of things read from/written to the file is to set the progress max value. Since the delegate gets called for each object instantiated, that part of it isn't a problem, I can just bump a counter. Counting the objects rather than actual bytes is probably as fine-grained as I need to get. I'll bite. If you want to know the total number of objects to be archived, then you need to count them, at some time or another. To count them, you need to walk the object tree before you start actually archiving... which may take a significant fraction of the time it takes to archive. Then, you could make sure it's the first thing that is archived, and hence the first thing unarchived... after which you can display/update the progress bar. Yah, I know; ugly, but unavoidable as far as I know. ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Confusion about NSWritingDirectionNatural
On 2013 Sep 26, at 21:02, dangerwillrobinsondan...@gmail.com wrote: Good news is LTR languages tend to not have a lot of RTL interspersed. It's somewhat common for authors in certain fields to have to mix, e.g. German, Italian, Greek and Hebrew, or Hebrew, ProtoPhoenician, and Arabic in the same page, with individual words or phrases of a different language from the primary one embedded within sentences or as parentheticals. I'm tired and fuzzy at the moment about some of the mixed directionalities of other language combinations I've had customers (or relatives) asking about (e.g. English+Japanese, Gujarati + English + ?). Ludwig von Mises _Human Action_, an economics book; and a pre-publication manuscript for a book on Isaac Luria (with hundreds of multi-lingual, multiple attributes, etc., foot-notes associated with the first 2 pages) come to mind. Anywhere, there are people who need this stuff to work correctly. ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Core Data with ODBC databases?
On 2013 Oct 16, at 12:47, Flavio Donadio wrote: For sure, ODBC is not the answer here, nor direct client access to the database, as we need something to manage locking and concurrency, as you said -- unless the RDBMS can do that. Is there such a beast? The reason we look to CoreData as a Holy Grail kind of thing is that ... ...It seems to be logically connected to things we used to do in different ways, with different tools, with variously different design goals in mind when we created or worked with them. And we know handling fine-grained concurrency is a bear, but we know such exist from, e.g. OLTP packages for managing state lotteries, airline reservations, etc., which manage to handle concurrency and distributed processing and distributed data-bases, even though we don't know exactly how they manage to do it (I mean, I know for a fact from talking with some of their developers that several of them grew out of extremely dinosaur-kludgey heavy-metal remote card-reader/-punch/printer stations in the 1970s, FCOL). So, as with many things, it's frustrating when it falls short of our expectations and hopes, though those (our expectations and hopes) were not part of the CoreData developers' reckonings which they think they've explained in the docs, and it grows more frustrating all the time. (Ditto with OpenGL, Quartz, source library/configuration management/version control...) It's just so almost good, but... severely kludged and impaired, instead. (We still want affordable 500m/h flying-cars which get 50 miles/gallon for everyman.) I'd almost prefer the old relational data-base API from RIM circa 1982, and a separate graphical Object-Relation Model graphing tool, (and the CAD/CAD/CAM package we had back in 1986 for the graphics, and the source library management tools we had in 1986, and more (or all) of the library linkage controls that have been available at various times since 1980 on high-end systems -- some of which were developed right there in Sunnyvale). A code or declarations/header file generator add-on to the ORM grapher would be nice, too, but I could live and be productive without it. That's all I will say about it now. ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: C functions
On 2013 Oct 18,, at 04:48, Shane Stanley wrote: is there any way to build a call to a C function on the fly? I mean something like pass a string to a method, and have it call the function of that name? This at least used to be shown in the "Objective-C 2.0 Runtime Programming Guide". ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WebView blocks User Interface
On 2013 Dec 05, at 08:15, Gerriet M. Denkmann wrote: On 5 Dec 2013, at 19:55, Roland King wrote: On 5 Dec, 2013, at 8:34 pm, Gerriet M. Denkmann wrote: Don't send 2Mb of search results to your webview. Do you really need the case where you search for one character only? Don't send data until you have more than one and don't send obviously too much data to be useful to the user. Well, the users might want all words with 'n'. In which case they would happily wait 50 seconds. I do not know how to differentiate this from a slow typing of "no". Gerriet. Would they, you sure? I don't think a good user experience has a spinning beachball for 50 seconds during which time the UI is doing nothing... So therefore you can't dump 2Mb of text into a webview... So .. divide it into pages, send the first one with a link at the bottom to the next one and load in a few good screenloads of data at a time. Yes, this is rather a good idea. Or, file 2 bug reports. 1. for interrupts to work properly, and 2. to have an option to allow each character entered to be treated as an interrupt instead of just loading up the event queue. ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Threaded drawing
On 2013 Dec 11, at 10:01, Jens Alfke wrote: On 2013 Dec 11, at 04:39, 2551 <2551p...@gmail.com> wrote: Itâs certainly seemed the case to me that I would have probably spent less time just writing my own code from scratch than I spend trying to figure out how half the methods Iâm trying to use should be implemented. Thatâs probably not actually true; our experience of time is pretty subjective, and time goes by faster when youâre in a "flow" state than when you're trying to figure out something new... When a software developer is figuring out something new is exactly when he is in a flow state. Flow state requires a challenge which can be met. In this case, at some level, we're weighing trying to figure out from the cryptic docs and experiments how the frame-work works*, vs. building something that works as you think of it and as you want it to work from simpler components. Sometimes the frame-works are easier/better, and sometimes designing and developing your own is better. * (The posted snippet from sample code was as clear as mud to me. Why powers of 4 (and -4) instead of 5 when we're talking about 5 levels of detail? 1/(2^2) - 2^2 = (1/4) - 4 means "...levelsOfDetail" should be set to 5?!? It needs more words, more context.) Leave comments on the docs, file radars, maybe we’ll get better documentation... some day. dum spiro spero ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Disabling screen capture
On 2014 Feb 21, at 18:24, Scott Ribe wrote: On Feb 21, 2014, at 2:26 PM, Bradley O'Hearne wrote: Industries such as medical (HIPAA), legal, government, education, military defense, etc. all have such security needs. The only way I can see for the app under discussion to work is to create kiosks with human proctors, and not use the network. The video surveillance won't suffice to stop the cheating. But if you're going to do it that way, why use the computers at all? Might as well go back to paper as we do with election ballots. I'd even recommend privacy shields around each test-taker, require that devices be in opaque containers, etc. I can see why such tests need to be secure, because I've seen the articles about College Board test questions being collected, posted on the net, and crowd-sourcing of answers, which people then memorized. That was about a decade back though, and they pulled the on-line tests, and probably caught and penalized a tiny fraction of those involved. Well, there's certainly no such need for HIPAA compliance... Correct. Because HIPAA is Orwellian. It says it's to protect patient privacy, but makes sure privacy is violated, instead. It was to facilitate federal government snooping into individual medical records (or at least their software snooping), and cross-border processing, while putting on a nice face to the victims. I've consulted for some of the state "medical cost containment" people, and they yearn for a fool-proof way to integrate all such records so that no one's medical history gets through the cracks (e.g. matching up ambulance/EMT contact with hospital admission & treatment, with rehab center admission and treatment and out-patient treatment... despite people giving variants of their names, refusing to give Socialist Insecurity Numbers or intentionally making "mistakes" or making up new ones on the spot in an effort to preserve some shred of privacy), but despite having nearly full access to people's DNA, we still have some slim shreds of privacy left. ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Saving NSAttributedString to a File
On 2014 Dec 19, at 17:00, Jens Alfke wrote: On Dec 19, 2014, at 1:39 PM, Charles Jenkins wrote: But when it comes time to save to a file format selected from AppKit additions (e.g. RTFFromRange:documentAttributes:), any unusual, application-specific attributes will be lost. There is no built-in file format you can select that will save just any arbitrarily named attribute. Am I right? Yes, as far as I know. How would AppKit store your arbitrary attributes into an HTML document? It would have to be a nasty hack like adding a magic HTML attribute (like "nsattributedstringmetadata") whose value was a base64 string of an NSArchive of the attribute dictionary. O_o Except that the last time I looked, the MSFT RTF pseudo-standard allowed any tag compatible with the scheme (slash whatever). And if you're importing the file and don't recognize it, you're supposed to just drop it and move on (which can have some interesting results when you're nested in several attributes, but...). Whatever attribute is in the attributed text in memory should cause generation of a tag with that name. So, then the problem becomes, how do you get it to pass on those custom tags as custom attributes, or to your custom attribute processor? ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Blurry is the New Sharp
On 2015 Jan 05, at 18:38, Graham Cox wrote: People suggested that OS X had jumped the shark with Lion. If so, we're into Jaws VIII vs. Godzilla 3D territory now. They foisted intentionally blurry text on us by 2002, but don't single out the Apple execs and management. It has infected all of the industry executives, beginning some time around 1985. "Sure, it works fine, so let's do another 'face-lift' which destroys actual functionality." And that applies to their employment practices as well as frameworks, web-sites, OSes... They must have gone to DC to lobby for special favors and made the mistake of drinking the same water the delusional politicians do, and it spread like virus from there. ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSCalendar and NSDates prior to October 15, 1582
On 2015 Jan 30, at 12:32, Steve Mykytyn wrote: The documentation for the Date and Time Programming Guide for iOS does not seem to be telling the truth, or perhaps I'm doing something wrong. From https://developer.apple.com/library/ios/documentation/Cocoa/ Conceptual/DatesAndTimes/Articles/dtHist.html "The Julian to Gregorian Transition NSCalendar models the transition from the Julian to Gregorian calendar in October 1582. During this transition, 10 days were skipped. This means that October 15, 1582 follows October 4, 1582. All of the provided methods for calendrical calculations take this into account, but you may need to account for it when you are creating dates from components. Dates created in the gap are pushed forward by 10 days. For example October 8, 1582 is stored as October 18, 1582." ... In reality it's not so simple; calendar/date designations, because of the non-integer and varying spin, orbits (365.22... or maybe 365.2425... day year), etc., religion and what have you (calendars which use leap seconds, leap days, leap months...), are never as simple as most of us believe they SHOULD be. Some countries did not adopt the Gregorian adjustment until the 1750s, and others much later than that (Russia partially converted in 1700 but not completely until 1922, Turkey in 1926). Anyway, it's not something you can do a neat mathematical conversion on and have it work "perfectly" everywhere and for every date. What of those of us who have to deal with dates going back to e.g. 1200BCE? But then are we talking calendar conversion, date conversion, or merely date formatting? http://www.adamsonancestry.com/calendar/ http://www.adamsonancestry.com/pioneering_spirit/#_Toc302021234 https://en.wikipedia.org/wiki/Old_Style_and_New_Style_dates http://galileo.rice.edu/chron/gregorian.html http://www.britannica.com/EBchecked/topic/245469/Gregorian-calendar http://www.britannica.com/EBchecked/topic/307826/Julian-calendar http://scienceworld.wolfram.com/astronomy/GregorianCalendar.html http://stackoverflow.com/questions/20446495/conversion-of-nsstring-to- nsdate-conversion-incorrect-result http://stackoverflow.com/questions/141315/php-check-for-a-valid-date- weird-date-conversions http://stackoverflow.com/questions/2140597/client-side-date- conversions-in-gwt http://www.cocoawithlove.com/2008/10/worldtimeconverter-dates-and- timezones.html http://www.codeproject.com/Articles/2730/Gregorian-Date-To-ISO-Date- Converter http://forum.ionicframework.com/t/problem-with-conversion-of-specific- dates-on-ios/16689 And a slew of books, and several videos on the topic turned up when I did an ixquick. _Demystifying the Gregorian Calendar: A Look into Its History and the Math Behind It_ Paperback -- 2014 April 7 by Walter A. Calhoon _Gregorian Calendar_ [Kindle Edition] by Merv Astle _The Calendar (Inventions That Shaped the World)_ Paperback -- 2005 September 1 by Patricia K. Kummer _Calendar Fraud_ [Kindle Edition] by Laura Lee Vornholt-Jones, Elaine Vornholt, Brad Vornholt... (And why doesn't Numbers have TSV as an export option?! It's more cleanly portable than CSV... and why are the marketing promo examples so overly simplistic?) ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Elapsed time vs sleep
> On Mon, 2010/07/26, Kyle Sluder wrote: >> Charlie Dickman <3tothe...@comcast.net> wrote: >> As long as the NSTimer firing interval is >> sufficiently small the NSTimer can be used. >> If the run loop is stalled for any "significant: >> time _all_ timers will be inaccurate to some >> degree. > > This is untrue. mach_absolute_time is the kernel's > timekeeping mechanism. It is not susceptible to > runloop stalling or any stalling for that matter, > short of a hardware failure or a bug in the kernel. > > NSTimer can't fire at a rate beyond a certain threshold. > On the main runloop, I believe this will wind up being > somewhere around one thread quantum because the main > runloop is responsible for fetching events... Whatever happened to the pre-emptive processing we were supposed to be getting with OS X? If it were pre-emptive, you'd interrupt and then it would happen, not twiddle around until the next time around a run-loop and sifting through a queue. In this context, you'd set the timer, and when the time was up, control would switch to where you'd told it to when you set up the timer. Boom. Ditto with a user-interrupt. Only if there were a conflict -- essentially two interrupts at once, within less than a millisecond of each other -- would any queueing, stacking, etc., come into play. Whatever happened to hardware monitoring and control of the CPU (core)? ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
web-based Cocoa dev docs inaccessible
Normally, I'd file an on-line criticism of the docs, but I can't get there, and this is the closest means I have to doing so. I was trying to look up something about NSAttributedStrings and found that the usual link led me to a page that no longer has a search box, links to docs, etc. My BookMark has the URL: http://developer.apple.com/mac/library/navigation/index.html but it took me here, so apparently there's a redirect: http://developer.apple.com/library/mac/#navigation/index.html and by successive trimming (first of "index.html" and then of everything from the pound sign right) to try to get to something that works I tried this: http://developer.apple.com/library/mac/ When I trim off more, removing the "mac/" it takes me to http://developer.apple.com/resources/ Trying links from there, merely takes me back to the same garbage. Page Description: There are no scroll bars. At the top, next to a display icon (white on dark blue), it says "Mac OS X Reference Library" in white letters on a dark blue background. To the right a ways in a sort of gray-blue on dark blue it has the Apple icon and the word Developer. To the right of that is what may be a ping-pong paddle or magnifying glass (the business end is sort of square with rounded corners or filets), but no text box in which to enter search specifications. Below the dark blue bar is a lighter gray-blue bar and below that a light-blue bar, all 3 are gradient shaded to give the appearance of an object thicker than at the top and bottom edges. At the bottom is another light-blue-gray bar. In between is white. Displaying the source shows a lot of defective MSFT Javascript. Examining this discloses the bizarre title Loading… There's some stuff about iPad and createTouch. Amongst the Javascript, I see that it's supposed to be creating and displaying some buttons, and at least one check-box, but they're nowhere to be seen on the page. When I backed out and tried my favorite search engine http://www.ixquick.com/ and tried clicking on some of what seemed appropriate links, I still got such essentially blank pages (blank in the sense that they did not display the NSAttributedString reference information). When I logged into my ADC to try to get to a forum to report the bug, it asked me to change a bunch of stuff, but was lacking valid options for app types, like Scientific, Engineering. After a couple rounds trying to get past that, I just clicked some random garbage. After a few tries, I managed to get to http://developer.apple.com/support/ and then http://developer.apple.com/support/mac/ the significant content of which is "Mac Developer Program The Mac Developer Program offers a range of technical resources and support for developers and IT professionals innovating with Mac OS X." Maybe it's the season; I noticed that another firm whose name begins with a Y just destroyed significant parts of their web site as part of their latest face-lift efforts. If you need someone to help repair it, I'm available, but my first 3 suggestions would be to do a few yanks/undos, or reload the backups from a month or two or three ago. It wasn't pretty (hasn't been pretty for years), but at least it worked. Next, let's get rid of all of the evil MSFT Javascript (the description is the same with and without Javascript enabled) and convert it all to PHP or Python or Perl, anything but Javascript and .asp. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: web-based Cocoa dev docs inaccessible
> On Mon, 2010/09/13, Andy Lee wrote: > From: Andy Lee > Subject: Re: web-based Cocoa dev docs inaccessible > To: "Jeffrey Oleander" > Cc: cocoa-dev@lists.apple.com > Date: Monday, 2010 September 13, 2:01 >> On 2010 Sep 12, at 6:32 PM, Jeffrey Oleander wrote: >> Normally, I'd file an on-line criticism of the docs, >> but I can't get there, and this is the closest means I have >> to doing so. > > This list isn't an official channel for bug reports, so > filing a Radar might actually be closer: > > http://bugreport.apple.com Good point. I usually don't think of problems with the dev docs as "product bugs", but appears I have a couple more still open from several years ago. When I went there it displayed the vile message: "Your Browser does not support JavaScript, or it is disabled. To run this application, you must enable JavaScript!!" MSFT JavaScript is evil!! "AppleConnect requires Safari 1.0 or better." Yes, indeed; JavaScript == evil evil evil. It keeps (swly) reloading itself as I try to make pop-up menu choices (I had that problem with a simple math app implemented using php; we went with Python and the guy I was working with became a Python fanatic). But enabling or disabling JavaScript makes no difference with the accessibilty of the docs. But I managed to work through that and file: 8423662 Dev Docs on web are inaccessible For now, I'll try to get by with the down-loaded docs, but this is going to put a serious crimp in my efforts to stay current with versions I don't have. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
over-released NSIdEnumerator
After my main NSDocument algorithm method was done doing its thing and returned up the call chain to where the button click had started its action, it would flip to showing NSPopAutoreleasePool and I was crashing with EXC_BAD_ACCESS. So, I looked at all of my alloc, initWith..., retain, and releases. I did find a couple things which I should have been releasing, but had not, but no obvious ones I had been releasing that I should not have been. So, I looked in the archives and on the web and fired up some of the tools, one by one: MallocDebug, ObjectAlloc (and tried malloc_history with no luck at all). I got these: from NSLog and the run log/Debugger Console: 2010-09-13 21:11:40.899 DijkstraCocoa[411] MyDocument findRelationship: ---display predecessors--- (gdb) continue 2010-09-13 21:11:46.345 DijkstraCocoa[411] displayResults: resultsField= 2010-09-13 21:11:46.346 DijkstraCocoa[411] displayResults: superView=, superSuperView= window= (gdb) continue 2010-09-13 21:11:48.638 DijkstraCocoa[411] MyDocument findRelationship: --- DONE --- Program received signal: "EXC_BAD_ACCESS". (gdb) 0 objc_msgSend 1 NSPopAutoreleasePool 2 -[NSApplication run] 3 NSApplicationMain 4 main 0 objc_msgSend 0x908611e4 <+0004> beq- 0x90861308 0x908611e8 <+0008> lwzr12,0(r3) 0x908611ec <+0012> lwzr12,32(r12) 0x908611f0 <+0016> stwr9,48(r1) 0x908611f4 <+0020> lwzr11,0(r12) 0x908611f8 <+0024> addi r9,r12,8 0x908611fc <+0028> rlwinm r11,r11,2,0,29 0x90861200 <+0032> andr12,r4,r11 0x90861204 <+0036> lwzx r2,r9,r12 0x90861208 <+0040> addi r12,r12,4 0x9086120c <+0044> cmplwi r2,0 0x90861210 <+0048> beq- 0x90861234 1 NSPopAutoreleasePool 0x90a21da8 <+0336> beq+ cr7,0x90a21dbc 0x90a21dac <+0340> addis r4,r31,4097 0x90a21db0 <+0344> mr r3,r29 0x90a21db4 <+0348> lwzr4,-3720(r4) 0x90a21db8 <+0352> bl 0x90b47aa8 0x90a21dbc <+0356> lwzr2,8(r30) 0x90a21dc0 <+0360> addi r27,r27,1 0x90a21dc4 <+0364> cmplw cr7,r28,r2 0x90a21dc8 <+0368> blt+ cr7,0x90a21d64 2 -[NSApplication run] 0x9730407c <+0592> bl 0x976f8028 0x97304080 <+0596> lwzr3,864(r1) 0x97304084 <+0600> addis r4,r31,4095 0x97304088 <+0604> lwzr4,6316(r4) 0x9730408c <+0608> bl 0x976f8028 0x97304090 <+0612> lwzr2,1320(r1) 0x97304094 <+0616> lhar0,50(r2) 0x97304098 <+0620> cmpwi cr7,r0,0 0x9730409c <+0624> bne+ cr7,0x97303fe4 <-[NSApplication run]+440> 0x973040a0 <+0628> addi r3,r1,80 0x973040a4 <+0632> bl 0x976f8208 0x973040a8 <+0636> b 0x97304130 <-[NSApplication run]+772> 3 NSApplicationMain 0x973c0750 <+0444> bl 0x976fbb68 0x973c0754 <+0448> lwzr3,0(r30) 0x973c0758 <+0452> addis r4,r31,4083 0x973c075c <+0456> lwzr4,24824(r4) 0x973c0760 <+0460> bl 0x976f8028 0x973c0764 <+0464> li r3,0 0x973c0768 <+0468> orir3,r3,41471 0x973c076c <+0472> li r4,0 0x973c0770 <+0476> li r5,0 0x973c0774 <+0480> li r6,0 0x973c0778 <+0484> bl 0x976fbb68 4 main #import int main(int argc, char *argv[]) { return NSApplicationMain(argc, (const char **) argv); } MallocDebug says: /Users/giovanni/Projects/DijkstraCocoa/build/DijkstraCocoa.app/Contents/MacOS/DijkstraCocoa accessed memory at 0x5575 illegally. It probably tried to dereference a pointer in freed memory. The most interesting thing ObjAlloc were some tiny objects containing only an unsigned long long, which I allocate to stuff in a set, the sole purpose of which is as a quick test for the status of a node of my graph (not yet examined, examined and now in the priority queue, visited and removed from the priority queue). (Come to think of it, there may be a better way.) Anyway, it was the only kind of object that jumped out at me has having any irregularity, so I looked at them quite closely, before NSZombies told me it was worried about an enumerator. NSZombies says: 2010-09-13 22:47:33.575 DijkstraCocoa[511] *** *** Selector 'release' sent to dealloced instance 0x593180 of class NSIdEnumerator. Break at '-[_NSZombie release]' to debug. 2010-09-13 22:47:33.575 DijkstraCocoa[511] *** -[NSAutoreleasePool dealloc]: Exception ignored while releasing an object in an autorelease pool: NSGenericException *** Selector 'release' sent to dealloced instance 0x593180 of class NSIdEnumerator. Break at '-[_NSZombie release]' to debug. 0x90adb928 <+> mr r5,r3 0x90adb92c <+0004> mr r3,r4 0x90adb930 <+0008> b 0x90adb580 0 -[_NSZombie release] 1 NSPopAutoreleasePool 2 _NSAppleEventManagerGenericHandler 3 aeDispatchAppleEvent(AEDesc const*, A... 4 dispatchEventAndSendReply(AEDesc cor... 5 aeProcessAppleEvent 6 AEProcessAppleEvent 7 _DPSNextEvent 8 -[NSApplication nextEventMatchingMask:untilDate:i... 9 -[NSApplication run] 10 NSApplicationMain 11 main 0 -[_NSZombie release] 1 NSPopAutoreleasePool 2 -[NSApplic
Re: Question about hebrew in textfields and textviews
> Kyle Sluder 2012-04-11 12:26 wrote: >> On 2012 Apr 11, at 10:17, Matthew >> Weinstein wrote: >> Thanks for all the replies. Unfortunately >> NSNaturalTextAlignment doesn't seem to affect >> the justification of the textfields. Try creating >> a simple project and simply put a textfield and >> textview in the window in MainMenu.xib. Changing >> the input to hebrew, running the program does >> change the text to LTR but it's still justfied >> on the wrong side. > > Changing the input method or changing the system language? > These are two different things. And the programmer does not know what the user is going to do, nor are systemwide settings the proper control. E.g. Say I have a program which allows the user to enter names for my specialized family address book. The name may be entered into that text-box in English, Hebrew, Arabic, Kanji... and the next in Hangul, the third Gaelic runes... Is there a way to tell it to figure it out at execution time from the user's data entry mode (language, etc.)... and have it "just work"? (Ditto for date entries, now that I think of it, and some of those date entries may be, e.g. 3345BCE which kind of blows a 1970 base and increment in seconds out of the water.) ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sharing a file between Mac and iOS
> From: Jens Alfke > Subject: Re: Sharing a file between Mac and iOS > To: "Dennis" > Cc: Cocoa-dev@lists.apple.com > Date: Thursday, 2012 July 19, 13:32 >> On 2012 Jul 19, at 08:22, Dennis wrote: >> But I am stumped as to how I might be able to >> more or less seamlessly handle syncing the file >> between the Mac and the iOS device. Unfortunately >> iCloud is not an option for me, and iTunes file >> sharing seems to be far from seamless. > > If by 'syncing' you mean 'copying'... > If you really mean 'syncing' Or do you mean contention management as you'd get with a massive data-base running on an NFS cluster, so that what is really multiple files on separate devices appears to be a monolithic data-base that's always "current"? ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sandboxing die.die.die
Sandboxing die.die.die Code-Signing die.die.die Javascript die.die.die Kludgey CPUs die.die.die Bodyshopping die.die.die (throwing hammer at hare-brained power-mad forces of evil) Now, when can we cut the chains and get back to developing great apps? ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sandboxing die.die.die
> From: davel...@mac.com > To: cocoa-dev@lists.apple.com > Date: Thursday, 2012 August 30, 18:26 >> On 2012 Aug 30, at 18:09, z...@mac.com wrote: >>> From: Jeffrey Oleander >>> Thu, 2012 Aug 30 13:57:44 >>> To: >>> Subject: Re: Sandboxing die.die.die >>> Sandboxing die.die.die >>> Code-Signing die.die.die >>> Javascript die.die.die >>> Kludgey CPUs die.die.die >>> Bodyshopping die.die.die Contextless docs die.die.die >>> (throwing hammer at hare-brained power-mad forces of >>> evil) >>> >>> Now, when can we cut the chains and get back to >>> developing great apps? >> Easy. When the exact items that we have issues with >> are addressed. >> >> It's not that hard. Listen to the developers and >> fix what causes the most problems for them. >> >> You satisfy their needs and as a result have >> developers creating great apps easier and faster. >> >> If you don't do this, then the focus from management >> is in the wrong place. > But you're tilting at windmills here. Cervantes... Don Quixote de la Mancha charging at what he thought was an evil, force and fraud initiating knight, but, in reality attacking a wind-mill. That's not the case, here. (Why do so many people mis-apply that expression to deride others' efforts to improve things?) These are actual design flaws and bugs, and lack of clarity completeness and context in docs. > This is not an official support channel. File Radars I would but it's broken... again. Hence: >> Javascript die.die.die >> Javascript die.die.die On the plus side, display manufacturers have made larger, higher res displays. Yay. OTOH, who can afford them in this approximately 13th year of the Bush-Clinton-Bush-Obama economic depression. raspberries. OT3H, all past bug reports and requests for improvements in docs have gone to the bit bucket. Not corrected, just closed, rarely acknowledged. I used to do tech support. I've worked on ticketing/ bug report systems. I've seen developers and tech writers do such things in the past. The only real solution is for someone within the company to be given enough clout to see that the bugs are actually corrected before the ticket gets closed. The usual pattern is for it to get worse and worse over a period of a decade or more before someone comes along to clean house. But I don't expect miracles. Apple has high revenues, so some folks are satisfied with what they're getting for now, and I get the impression there are lots of newbie developers willing to put up with draconian nonsense just to have the chance to develop at all. Until the bugs and design flaws and docs are all corrected, I'll continue grumping by whatever channels are open, thankyouverymuch, though I do refrain for long periods -- often years at a stretch -- so as not to jam the lines of communication. I'm making an exception, this time, by posting twice, simply because there's quite a bit of spill-over aggravation from the US (and UK) politicians of several parties striving mightily to make STEM job markets worse in this political cycle. ___ 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 Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bindings Problem
> On Sat, 2010/01/16, Ken Thomases wrote: >> On 2010 Jan 14, at 17:11, Carter R. Harrison wrote: >> My model is an NSMutableSet that contains >> NSMutableDictionaries. > > I think this is asking for trouble. A set of mutable > dictionaries doesn't make much sense. > > ..."Equal" is determined by the -isEqual: and -hash > methods, not by identity (memory location). So, it's quite possible that he has a "hash" used by the NSMutableSet which doesn't depend on the contents of the mutable dictionary once it's been created. Still, though I can imagine someone wanting such a set-up, I have to wonder what purpose it serves, as opposed, e.g., to a mutable dictionary of dictionaries, or a mutable array of dictionaries. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bindings Problem
> On Sun, 2010/01/17, Ken Thomases wrote: >> On 2010 Jan 17, at 11:15, Jeffrey Oleander wrote: >>> On Sat, 2010/01/16, Ken Thomases > wrote: >>>> On 2010 Jan 14, at 17:11, Carter R. Harrison wrote: >>>> My model is an NSMutableSet that contains >>>> NSMutableDictionaries. >>> >>> I think this is asking for trouble. A set of >>> mutable dictionaries doesn't make much sense. >>> >>> ..."Equal" is determined by the -isEqual: and >>> -hash methods, not by identity (memory location). >> So, it's quite possible that he has a "hash" used by >> the NSMutableSet which doesn't depend on the contents >> of the mutable dictionary once it's been created. > > Huh? The hash in question is that of the mutable > dictionaries. He doesn't get to decide this. > It's a near certainty that the hash of a dictionary is > sensitive to its contents. First, logically, how else > would the NSDictionary implement equality? Second, the > documentation I cited virtually asserted that it's so. > > So, if you mutate a dictionary while it's inside a > collection, that will cause trouble. The documentation > I cited says this, too, without equivocation. > > He also doesn't get to decide on the hash of the set, if > that's what you were thinking about. > > He could implement some custom class and decide how its > hash is implemented, but that's beside the point I was > making. In fact, that was one of my suggested > solutions. > > In other words, I'm not sure what you're trying to say. http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Collections/Articles/Sets.html "Set Fundamentals: Note that if mutable objects are stored in a set, either the hash method of the objects shouldn’t depend on the internal state of the mutable objects or the mutable objects shouldn’t be modified while they’re in the set (note that it can be difficult to know whether or not a given object is in a collection)." So, you can use your own hash function to determine where in the set each item is stored. In this case, each item stored in the set is an NSMutableDictionary. http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/Reference/Reference.html "Internally, a dictionary uses a hash table to organize its storage and to provide rapid access to a value given the corresponding key. However, the methods defined in this cluster insulate you from the complexities of working with hash tables, hashing functions, or the hashed value of keys. The methods described below take keys directly, not their hashed form." So, you may use your own hash function to create your keys... or not, as you wish. But then the NSDictionary and NSMutableDictionary will hash the keys you pass to their methods using their own, internal, hash function, to determine where objects are stored in the dictionary. But my primary point was to ask the original poster to think about why he is using this arrangement of instances of NSMutableDictionary stored in an NSMutableSet. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Use NSDocument as a variable of another NSDocument
> At Mon, 2010/01/18 15:19, Quincey Morris wrote: > On 2010 Jan 18, at 10:48, Jarod Wen wrote: >> Is it a proper design to use a NSDocument as a >> variable of another NSDocument? >> >> I am now working on an application which generates >> some information from a movie. The information >> generated will be showed as a table, and the >> information in the table can be saved/opened. >> Multiple types of information are possible >> so for one movie there may be several tables. >> >> I used the NSDocument architecture for the movie >> document, and I am a little bit confused about >> the hierarchy... > The question isn't whether one document object > can contain a reference to another document > object. The question is what's supposed to > happen later when the derived (table) > document is re-opened. > > If the table refers to information in the > original (movie) document, you'll need to > open the movie document too. That depends on what you mean by "refers to". I can refer to the Encyclopedia Brittanica without opening it. I can say "this is related to the movie 'Blah' whose screen- play was written by Blurp, was direced by Blorp, and produced by Bloop" without having to open up that movie file. It just depends on what Jarod Wen wants to do. If he wants the extracted data which he displays in tables to be mostly independent of the original movie, then he will need that to be in a document with its own hierarchy. The original movie would be one document with its own data, and the extracted data for that movie might be a separate document with its own, independent data hierarchy. If he does that, then the 2 files can diverge, and he might have to consider how to control proliferation of related data files, each derived from the same movie file. So, his question becomes, what object owns each document type? What object owns the movie? What object owns the derived data that he displays as tables? Or, should he just keep only the movie document and extract/generate at run- time the data to display in table views as "views of the movie". ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSDocument override Undo's default handling of changes count
> On Mon, 2010/02/01, Ernesto Giannotta wrote: > From: Ernesto Giannotta > Subject: NSDocument override Undo's default handling of changes count > To: "Cocoa List" > Date: Monday, 2010 February 1, 04:27 > I'm using NSDocument default undoManager but want to > override it's change counting behaviour > (I want the black modifed dot to not show when some minor > changes are done, but still have them undoable)... You might want to look at Undo Groups. I was just looking at it last night in the conceptual overview: http://developer.apple.com/documentation/Cocoa/Conceptual/UndoArchitecture/UndoArchitecture.html ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Core Data: Custom to-many relationship setter not being invoked
> On Tue, 2010/02/23, Ken Tabb wrote: > From: Ken Tabb > Subject: Re: Core Data: Custom to-many relationship setter not being invoked > To: "Quincey Morris" > Cc: "cocoa-dev" > Date: Tuesday, 2010 February 23, 03:20 AM > Adding is via a button going to an > Employee array controller's -add. In the interface there are > 2 array controllers (1 for Departments, 1 for Employees). > The Employees controller is set to use the selection in the > Departments controller (i.e. showing the subset belonging to > the selected dept). > > Adding and deleting Departments and Employees is fine > (everything gets hooked up / added / deleted properly), and > if I look in the XML Core Data store, all is well. It's just > my custom accessors (the 4 mentioned below) don't get used, > whereas -setEmployees does. > > Do you reckon it's because the adding is happening from the > Employee side of things rather than the Department side of > things? Shouldn't both sides have their accessor methods > called (thanks to the inverse relationship)? > > I can't believe it's relevant, but the Department's > 'employees' relationship is mandatory, as is the inverse > relationship. > > Weird isn't it :) > > Ken > > On 23 Feb 2010, at 2:34, Quincey Morris wrote: > > > On Feb 22, 2010, at 15:54, Ken Tabb wrote: > > > >> Yep I implemented all 4, as per the Design -> > Data Model -> Copy to clipboard template, i.e. > >> > >> - (void)addEmployeesObject:(Employee *)value; > >> - (void)removeEmployeesObject:(Employee *)value; > >> - (void)addEmployees:(NSSet *)value; > >> - (void)removeEmployees:(NSSet *)value; > >> > >> However if I implement -setEmployees as per > Jerry's e-mail (and seemingly contravening the advice in the > Core Data Programming Guide), then it works like a charm > :-/ > > > > There's something else going here, though it isn't > clear what. One thing you haven't said is *how* you're > adding employees. Could you show the code that does this? It's not something simple like Employees vs. Employee is it? ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Messaging Cocoa apps through Terminal
> On Wed, 2010/03/03, Matt Neuburg wrote: > From: Matt Neuburg > Subject: Re: Messaging Cocoa apps through Terminal > To: "Ulai Beekam" > Cc: cocoa-dev@lists.apple.com > Date: Wednesday, 2010 March 03, 13:02 >> On Wed, 2010 Mar 03 16:17:13 +, >> Ulai Beekam >> said: >>get the point. Just so the user (but mainly the >> developer for testing purposes) can somehow >> make the app do things that cannot be done >> in the UI. > > This might be a reason to build some scriptability > (AppleScript-type) into the app. In fact, it is > the usual reason. Granted, it might also be > overkill for your app. But it's a very good way > to build in some "hidden" preferences. > > On the other hand if you are just saying you want > to automate the choosing of a certain menu item > or pushing of a certain button 100 times, you > could use GUI scripting without bothering to > make your app scriptable at all. GUI scripting > is a very good "poor man's" way to automate > interface testing, and on Cocoa apps it just > works, out of the box, for most interfaces. m. I'd like something like this just to make my apps properly interruptible. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: predicate for a Core Data fetch request rejected by SQL
> On Sat, 2010/03/06, Joanna Carter wrote: > This quote from the Core Data Programming Guide: > > There are some interactions between fetching and > the type of store. In the XML, binary, and > in-memory stores, evaluation of the predicate and > sort descriptors is performed in Objective-C with > access to all Cocoa's functionality, including > the comparison methods on NSString. > The SQL store, on the other hand, compiles the > predicate and sort descriptors to SQL and > evaluates the result in the database itself. > This is done primarily for performance, but > it means that evaluation happens in a non-Cocoa > environment, and so sort descriptors (or > predicates) that rely on Cocoa cannot work. > > > To my mind, this does state exactly what you have found. ? Sounds like 10% information and 90% hand-waving with no "exactly" about it. The reasonable thing to have in the doc after this is more precise descriptions of the differences, with several examples to show how it would work with and without SQL. But... after several tries searching from the doc home page, fighting the Evil Fremd Javascript, finally finding the right doc, reading through the page, I filed feed-back against the doc page. You should probably file your own, because the likelihood that we'd say things the same way, expressing exactly the same concern, including the same things and leaving out the same things, is tiny. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Better sorting using threads?
> On Fri, 2010/03/12, Andrew James wrote: > From: Andrew James > Subject: Re: Better sorting using threads? > To: "Gwynne Raskind" , "Ken Ferry" > > Cc: "Cocoa-Dev List" > Date: Friday, 2010 March 12, 13:55 > My concern is that keeping traditional C-arrays > in sorted order means > > 1) finding the location for insert ( O(n) ) > 2) copying a range of contiguous memory to make the > location available > 3) copying in new value > > I've made the assumption that NSArray wraps an > old school contiguous C-style array > ( ala C++ std:::vector ) > > With many sorted container insertion inserting > in sorted order means > 1) finding the location for inserter ( O(nlogn) ) > or the like > 2) create node with new value > 3) swizzle some pointers to include new values > > .. ( ala C++ std::set ) > > I have a hard time seeing how this is more expensive > for very large container than sorting an array when > needed. The initial poster was indicating he has > a container with thousands of members. > > Please educate me where my post illustrates ignorance. > > Cheers, > --aj Well, encapsulation requires a certain amount of enforced ignorance. We're not supposed to know exactly how it does it. We're only supposed to know the public interface and let it do its thing as it wishes to do it, even changing when the maintainers of the class decide to make changes. I may be implemented as a Fibonacci heap, or a binary tree for all we know, using a contiguous block of memory or nodes allocated one at a time. There are hints in the interface provided, but no promises beyond it regarding implementation. >> >> From: Gwynne Raskind >> To: Ken Ferry >> Cc: Cocoa-Dev List >> Sent: Fri, March 12, 2010 9:14:35 AM >> Subject: Re: Better sorting using threads? >>> On Mar 12, 2010, at 2:25 AM, Ken Ferry wrote: >>> Does Cocoa have sorted containers so that an >>> object can be inserted in >>> sorted order? If so it seems like this would be far >>> less expensive. >> >> Probably the best thing to do if you want this is to >> maintain the sort >> yourself by inserting new objects in the correct >> position. You can find the >> position using >> -[NSArray >> indexOfObject:inSortedRange:options:usingComparator:] >> ... ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Changing appearance of NSDatePicker?
> On Tue, 2010/03/16, Ben Golding wrote: > From: Ben Golding > Subject: Changing appearance of NSDatePicker? > To: "Cocoa-Dev List" > Date: Tuesday, 2010 March 16, 2:10 AM > Is it possible to change the way the dates are > presented in NSDatePicker in graphical mode? > In my app I have a calendar with a list of > events in it, when the user selects a date > in the date picker it shows which events occur > on that day. I'd like to offer a visual clue... You could just direct them to the next date and event for which you do have info. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSXML Parsing Problem
> On Thu, 2010/03/25, Keary Suska wrote: >> Maybe a cool option for NSXML would be to be able to >> specify the & pound ; sequence and have it map it to >> whatever... > My XML is a little rusty but IIRC this is an XML issue, and > any XML parser would choke. You have to define (or perhaps > more properly "declare") every named entity other than the > pre-defined named entities such as >, < and > &. > > I believe you can use numeric references with impunity: > nnn; but make sure it jives with your character > encoding. Agreed. pound is defined in html 4 but not in xhtml, which has only pre-defined character references for amp, lt, gt, apos, and quot http://www.w3.org/TR/2006/REC-xml11-20060816/#intern-replacement But in the current mode, they strive to make it difficult to put the pieces together, though they may believe they are clearly doing so here http://www.w3.org/TR/2006/REC-xml11-20060816/#intern-replacement here http://www.w3.org/TR/2006/REC-xml11-20060816/#sec-entexpand and here http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EntityValue But if you've told it you're using UTF-8 or UTF-16 it shouldn't need an ampersand escape, since the British pound sterling symbol is not otherwise used in XML itself; in which case you just use the Unicode character. But, if you want to be compatible with html 4 you've got to define that character reference. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How do I compare two NSDates using NSPredicate & Core Data
A date-time is a date-time, regardless of how it is displayed or entered or obtained from the system. The whole purpose of the NSDate object is to allow easy comparison, and determination of intervals by subtraction... well, a couple of the main purposes... and be able to display dates and intervals as appropriate to the context. Calendar systems and date display formats don't lend themselves to such calculations, and change-overs from one calendar to another have made it more difficult. > On Fri, 2010/04/09, Ashley Clark wrote: > From: Ashley Clark > Subject: Re: How do I compare two NSDates using NSPredicate & Core Data > To: "Sean McBride" > Cc: Cocoa-dev@lists.apple.com > Date: Friday, 2010 April 9, 12:52 >> On 2010 Apr 5, at 19:02, Sean McBride wrote: >>> On Sun, 2010 Apr 04 23:15:16 -0400, Michael A. Crawford said: >>> Thus far I've gotten away with using >>> -predicateWithFormat and scalar >>> values. I now need to compare a couple of >>> NSDate instances but am not >>> sure how to code it up with NSPredicate. >>> Consider me a 'visual' learner. >> >> I'm pretty sure you can use just <, >, ==, etc. >> with NSDates in NSPredicates. > > One thing that many people overlook is that NSDates > *always* include a time component. And if that time > wasn't specified explicitly it typically defaults > to a preset value set in the editing control (if > one was used) or the current time at the time the > date string was parsed. > > So, if you were expecting to compare a set of NSDate > objects to be on a particular date irrespective of > their time value... you have a bit of work to do. > A simple way to approximate the test is to look at > a time range from midnight to midnight-1 second > of the following day. > > That of course leaves another issue aside though, > that of differing timezones. All NSDate objects are > converted to the local timezone by default and the > original timezone information is not stored in the > object, so an NSDate created as {2010/01/01 23:59 EDT} > when read back at some later point when the computer > is now on the west coast (PDT) would show as > {2009/12/31 20:59 PDT}. > > All of that to say, comparing dates with predicates > (or at all) is hard. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: TUTORIAL: Generating Unique ID Strings
> On Fri, 2010/05/14, Thomas Wetmore wrote: > From: Thomas Wetmore > Subject: Re: TUTORIAL: Generating Unique ID Strings > To: "Jens Alfke" > Cc: "CocoaDev" > Date: Friday, 2010 May 14, 12:30 > I must say that I am constantly > amused by the nanniness of the Apple discussion lists, > telling people what is safe and what is dangerous. There is > nothing dangerous about bit-twiddling code. You test it til > it works and then it works forever. It doesn't develop bugs > later. My goal was to use the 128 bits of a UUID and encode > them for use in genealogical database applications using the > smallest record id strings possible. My choice was to break > the 128-bits into 22 6-bit sequences and encode each 6-bit > sequence as a simple character. This is good, honest, easy > to write, easy to debug software. > > In my application databases can be very large, having > millions if not billions of records. The goal is that every > instance of the application, wherever it is being run, will > generate record ids that are not only unique to itself, but > to every other instance of the application. In this way > people can share information with one another knowing with > assurance that any data imported from a database created by > another instance of the program will never have id clashes. > It is not intended that massive numbers of records be > transferred over the network, though they could be, just > that data can be shared between databases to any extent with > no clashes. There are other benefits such a system has for > genealogical data, but what I have described here is good > enough. > > Tom "danger is my middle name" Wetmore >> On 2010 May 14, at 13:00, Jens Alfke wrote: >> (2) If you do need to convert to string, it would be >> safer to use an existing Base64 converter rather than >> writing your own as you've done. This kind of bit-twiddling >> code is very prone to error. Probably the quickest way is to >> use the Base64 support in the OpenSSL library; a bit of >> searching in the list archives should turn up some sample >> code. >> >> (3) I'm sort of confused by Thomas Wetmore's comment >> that "my application generates billions of [unique ids]". >> That's way too many to be sending over the network, so these >> must be used locally. But in that case, generating unique >> IDs becomes much easier, and the IDs a lot smaller: just >> increment a 32-bit counter. I'll concur with both. It's typical for an individual genealogist to collect records about 3,000 or 4,000 people in their family forest, and each of those can have hundreds of associated records (objects) of various types. But the big progress comes when you can link up with a base of data created by another researcher, who has records on several thousand relatives, and so on. Names don't suffice to uniquely designate an individual (sometimes not even full-name plus birth-date), and it's common for a researcher to, unknowingly, have 3 or 5 records for the same individual human being. The desire is to convert those to aliases, and to use UUIDs to designate each human. And there are many other data-items in such information collections which benefit from universally unique identifiers. But I agree with Jens that, when well-tested, off-the- shelf utilities, e.g. for binary to octal or hex or ASCII or Unicode conversion and back are available, they're preferable to rolling our own (and I rolled my own such coder/decoders a couple times before the web existed). But my memory is that there is already a method in the UUID framework for such conversions. No need to bring in external packages, even. http://developer.apple.com/mac/library/documentation/CoreFoundation/Reference/CFUUIDRef/Reference/reference.html Functions by Task Creating CFUUID Objects CFUUIDCreate CFUUIDCreateFromString CFUUIDCreateFromUUIDBytes CFUUIDCreateWithBytes Getting Information About CFUUID Objects CFUUIDCreateString CFUUIDGetConstantUUIDWithBytes CFUUIDGetUUIDBytes Getting the CFUUID Type Identifier CFUUIDGetTypeID http://developer.apple.com/mac/library/documentation/Java/Reference/1.5.0/doc/api/java/util/UUID.html ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Coming up with ideas
> On Sat, 2009/06/13, Grant Erickson wrote: > From: Grant Erickson > Subject: Re: Coming up with ideas > To: "Graham Cox" > Cc: cocoa-dev@lists.apple.com > Date: Saturday, 2009 June 13, 11:13 >> On 2009/06/12 23:34, Graham Cox wrote: >>> On 2009/06/13, at 13:27, WT wrote: On 2009 Jun 13, at 04:36, Graham Cox wrote: > On 2009/06/13, at 12:30, Development wrote: > Hey, how do you guys come up with ideas > for new programs?... I wish I had your problem ;-) I come up with ideas for new apps several times a week. I'm going nuts trying to figure out how I'll ever find time to implement them without dozens of developers! ... >> Well, most of them reflect two things: >> a) my interests and >> b) the lack of certain categories of affordable >> software on the Mac. ... >> a) really good CAD software that was in a >> hobbyists price-range but was of professional >> quality and a true OSX app, not a crappy port >> or half-baked shareware effort > While it is still not as good as Illustrator > at what it does and still not quite as good > as Claris CAD at what it did, I found > IlexSoft's HighDesign... > VersaCAD, Graphite, AutoCAD, Canvas, > PowerCADD, ArchiCAD, MacDraft, and > VectorWorks when considering both value and > ease-of-use. I've been longing for a good, inexpensive app along those lines, too, since working on one years ago. We had over 200 developers working mostly on one CAD/CAM product, but with others working on integration with others' specialized packages, e.g. for plastic mold design and the CAE packages. The best I've seen have disappeared from the markets or cost a king's ransom (ours was $100K a pop, as I recall, but you could have 64 or more designers using it). The ones I've run across more recently are mere toys, and cumbersome at that. I've thought about what it would involve, and turned back each time. Neither the Quartz nor OpenGL libraries/frameworks lend themselves to it. In some ways it was simpler way back when drawing consisted of sending escape sequences to graphics terminals, and it didn't require standing on your head to draw something elsewhere than the view origin; you just said "draw an ellipse with foci there and there", or "draw a circle inscribed in the triangle" or "draw a circle with center there, in that part of the sky-scraper and with radius of 2 millimeters and parallel to the current view plane". Others would be to see gimp ported to use Quartz instead of X11 or whatever, better bidness graphing programs, outlining/writing assistants, reading/writing teaching programs & games, poor man's GIS, more graphical report options for genealogical info, EASY to use encryption/ decryption, bibliographic data-base, games that did not skimp on physics but ditched the speed gimmicks, weather-watching app that would let me watch an imagery loop that lasted 30-120 seconds instead of skimping and showing a jerky 5-second loop, handy integrated program for sending out resumes and tracking when which version was sent to which e-mail address (I'm using iCal and AddressBook and MarinerCalc and TextEdit and lots of copying and pasting, and file selecting, now; but would much prefer to just click on a dozen check-boxes, and then a "do it" button, and have it keep track of which ones bounced, too ;B-) and a handy data-base to keep and share my black-list of firms with unethical practices (though I suppose a group in AddressBook would suffice). "The best way to have a good idea is to have a lot of ideas." --- Linus Pauling (quoted in Martin Edelston & Mary Buhagiar 1992 _I Power_) ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: UML Diagramming or Other Helpful Software
> On Wed, 2009/06/24, I. Savant wrote: > From: I. Savant > Subject: Re: UML Diagramming or Other Helpful Software > To: "Dennis Christopher" > Cc: "cocoa-dev@lists.apple.com" > Date: Wednesday, 2009 June 24, 10:18 >> On 2009 Jun 24, at 11:16, Dennis Christopher wrote: >> Has anyone found a diagramming package that will >> "reverse engineer" Cocoa code and output a UML >> diagram from it? > Xcode will make a class diagram (under the "Design" > menu). Is that what you're looking for? If not, > maybe you should list what functionality you're > looking for in such a package. And Core Data will generate Chen diagrams. Which of the many kinds of diagrams that are included in the UML did you have in mind? Flow charts? Timing diagrams? State diagrams? ... ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Cocoa Graphics Parsing
> From: Courtney Arnold > Subject: Re: Cocoa Graphics Parsing > To: cocoa-dev@lists.apple.com > Date: Monday, 2009 July 20, 21:25 > I am expecting that I am going to > have to drop down to lower levels. I want to be able to > manually parse an image of a UPC barcode. I assume that the > best way to do so would be to potentially examine each > single pixel. > > any information that you provide, I would appreciate it. Yes, it boils down to mincing along, examining each pixel. Do a search on "syntactic pattern recognition". That was the title of the class in which we covered such things. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Document-Based Application
> On Mon, 2009/07/27, Graham Cox wrote: > From: Graham Cox > Subject: Re: Document-Based Application > To: "David Blanton" > Cc: "cocoa-dev" > Date: Monday, 2009 July 27, 00:10 >> On 2009/07/27, at 2:09 PM, Quincey Morris wrote: >>> On 2009 Jul 26, at 20:39, David Blanton wrote: >>> I have 22 file types, each with its own C++ >>> methods for extracting its data. >>> >>> Now, I could use just one subclass of NSDocument or you could have 22 classes, and use setDelegate in your NSDocument sub-class to control which one gets used for each file. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Printing Multiple-Pages Issue
> On Mon, 2009/08/17, Renzil D'Souza wrote: > From: Renzil D'Souza > Subject: Re: Printing Multiple-Pages Issue > To: "Graham Cox" > Cc: cocoa-dev@lists.apple.com > Date: Monday, 2009 August 17, 12:39 AM > > No, I want control over how many pages I'm dividing my > view into, and precisely how I divide my image into > those pages. I'm writing a function for someone to > print N images from 1 large image, and the user of > the function may want to supply the ratios at which to > divide the image (vertically only). I found out what > my problem was - in my call to CGContextDrawImage(), > I was passing the CGRect I used to get the sub-image > which was wrong. That, combined with some > transformation stuff in my code, messed it up. > > So if I print a really large view, it will print on > multiple pages - is this what is meant by 'Collated'? > > Thanks, > Renzil >> 2009/08/17 Graham Cox >>> On 2009/08/17, at 03:56, Renzil D'Souza wrote: >>> I'm trying to print a really large image into >>> 'N' pages. So I over-rode 'knowsPageRange' and >>> 'rectForPage'. >> If you're simply trying to tile a large view >> over 'n' pages, you don't need to do this - >> that's what it will do by default with no >> intervention on your part. Try that first and >> see if it does what you want. >> --Graham I think Graham is correct. Try it without any over-riding, first. I tend to think of what you describe as dividing the page into tiles, with some tile size (usually the same as the page size), and the amount or percentage of over-lap. (And then you need to decide whether the user should designate the amount of overlap in millimeters or inches or pixels and which of these Cocoa expects.) And then you'd probably have to give it multiple rectForPage for each page you want to be tiled, one for each tile. I have not done this with Cocoa, so am only describing how I think of it in hopes of providing some insight and possible terms on which to search. Collating has to do with the order in which the separate tiles and pages of a document are printed. If you tell it to print it 3 times, page n will precede page n+1, and each copy will be "together". What order is proper for tiles is up to you, since I know of no widely accepted conventions. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: When do I need to override hash?
> On Fri, 2009/08/21, Quincey Morris wrote: > From: Quincey Morris > Subject: Re: When do I need to override hash? > To: "cocoa-dev" > Date: Friday, 2009 August 21, 00:48 >> On 2009 Aug 20, at 22:05, Jeff Laing wrote: >> Without wanting to keep the thread going forever, >> can I just ask why we would presume this? >> >> In fact, if I were implementing NSDictionary >> I'd assume the reverse, that I was not allowed >> to assume that an objects hash would not change.. > "If a mutable object is added to a collection > that uses hash values to determine the > object’s position in the collection, the > value returned by the hash method of the > object must not change while the object > is in the collection." The impression I get from all this is that * if you do want to change how you hash, you should pull objects out of the collections with the old hash and then add them back in using the new hash. * be careful when choosing a hash scheme; it has to be fast and it has to produce keys that minimize collisions and yet come out the same when you want it to come out the same. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to create GPS enabled Iphone application?
> On Wed, 2009/08/26, rethish wrote: > From: rethish > Subject: How to create GPS enabled Iphone application? > To: "Cocoa Dev" > Date: Wednesday, 2009 August 26, 07:34 > I need to create GPS enabled Iphone application > which is to display the nearby hotels and other > facilities. > > How can I do it? > I am using iphone sdk 2.2 And, by the same token, how can one positively shut off GPS on an iPhone for customers who value their privacy? ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to create GPS enabled Iphone application?
> On Wed, 2009/08/26, Luke the Hiesterman wrote: > From: Luke the Hiesterman > Subject: Re: How to create GPS enabled Iphone application? > To: "Jeffrey Oleander" > Cc: "Cocoa Dev" , "rethish" > Date: Wednesday, 2009 August 26, 08:30 >> On 2009 Aug 26, at 06:27, Jeffrey Oleander wrote: >>> On Wed, 2009/08/26, rethish wrote: >>> From: rethish >>> Subject: How to create GPS enabled Iphone application? >>> To: "Cocoa Dev" >>> Date: Wednesday, 2009 August 26, 07:34 >> >>> I need to create GPS enabled Iphone application >>> which is to display the nearby hotels and other >>> facilities. >>> >>> How can I do it? >>> I am using iphone sdk 2.2 >> >> And, by the same token, how can one positively shut >> off GPS on an iPhone for customers who value their >> privacy? > Read: > http://developer.apple.com/iphone/library/documentation/CoreLocation/Reference/CoreLocation_Framework/index.html > > Luke Thanks. I filed feed-back against the docs, because the info on how to positively stop the iPhone from transmitting GPS location data to the cell is not there. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to create GPS enabled Iphone application?
> On Wed, 2009/08/26, Luke the Hiesterman wrote: > From: Luke the Hiesterman > Subject: Re: How to create GPS enabled Iphone application? > To: "I. Savant" > Cc: "Jeffrey Oleander" , "Cocoa Dev" > > Date: Wednesday, 2009 August 26, 10:10 > As stated, the application doesn't get to decide > whether location services are on or off. That's not my question. Can a USER shut off broadcasting of his location to the cell(s), either directly via a nice big hardware switch with an indicator light (and, preferably, a switch that makes a nice audio and tactile clunk like a power plant circuit breaker) or with the help of my handy-dandy application? If not, it's a design flaw, and will have to be corrected. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: whether to use core data...
> >> Anyway, I ended up with a graph of Objects and > methods which looks nice and consistent and -- clean! > :-) > > I'm happy with my model. And I'm certain it would benefit > from Core Data. > > > A1: A lot of beginners complain about this. A lot of > intermediate to pros recognize that the documentation > is far better than most platforms. > > That's not saying much :-) "better than most platforms in the last 10 years", maybe. Mac OS 7 and 8 and 9 had better docs. Kronos, back in the 1970s, and NOS in the 1980s had far far better docs. So, the proper thing to do is just keep on submitting suggestions, corrections, requests for clarifications to the docs. > > The trick is, you just have to take the time to > familiarize yourself with it. Study, study, study. > This is a very large platform with a lot of powerful > technologies. "Powerful" is not a word I would use in this context. Not quite elegant, or striving to be elegant, maybe. > It's not a toy language or API by any stretch of the > imagination. But Core Data seems to be. > Finding your way around will take time. > Learning what are clearly labeled as "advanced" technologies > will require you to master the basics first (surprise!), so > give it time and study. Which "basics"? The greatest "basic" that would allow someone to read the docs and grok how to design new software making use of these frameworks would be the psychotic power to reach out to the mind of the original framework designer(s) to understand the extent and limitation (things that seem to logically follow but do not because he/they weren't thinking of them when they designed this part of the frameworks) of his POV, and the direction of development of his ideas, and the terminology used that doesn't quite mean what it appears to mean (not what it meant in other languages, libraries and frameworks you've used in the past, or in the "real world"). > > A2: All the more reason to heed the warnings and stick > to basics. Whether Core Data is a good match for your > project or not (more on that in a second) is largely > irrelevant since you have already indicated (I think - the > rambling makes this hard to say for sure) that you haven't > read the more basic technologies upon which Core Data is > built. > > No, I read the Core Data Basics chapter of the Core > Data Programming Guide, I'm happy enough with KVC and > KVO for now - at least my bindings between an > NSTableView, NSArrayController and my NSArray are fine. > So, I'm sort of OK with bindings, notifications and > delegation, although not thoroughly immersed in the > mind set. Yet. So, according to the recommended > learning path, the next step would be going through > the tutorial (which it later says, is NOT how you do > things...) > > > Therefore, your first app should use the most basic > methods. Build your data structures with dictionaries, > arrays, and NSCoder-compliant custom objects as you wish ... > then write the main container to a file. There's your > document format. Start with the basics, then move on > to the voodoo. But I've already done the object-relational diagramming of a major military logistics data warehouse (rat's nest, really), a vehicle fleet management system and other toys, and taught the techniques to others. After that, what can seem like voodoo in far simpler graphs of data in this thing that's not even tied to one full-featured relational data-base? It should be a walk in the park, a mere application of well-known principles. Only it's not. Why not? I'd advise reading the docs at least 3 times, and maybe the Objective-C 1.0 and 2.0 docs (the best of the whole lot, IMO) a couple times each. Typically, a student is expected to retain maybe 15% of what he reads the first time from a text book. In the past, I've tended to retain maybe 50% from text books and reference manuals. A good teacher answering just the right questions as they arise can bring that up rapidly. A second pass through documents written from another POV, by another author, with different holes in his presentation is also helpful. With that good mentor who's BTDT, a bright industrious study group, I'd be up to the 98% neighborhood before a 2nd pass (at which point what I had for breakfast becomes a more important factor). The OS X docs bring me down to maybe 5%-10% for a first run-through. By the time I've read a set of them 3 times, I'm finally getting up to my accustomed first-pass 50% or so. And, as someone noted, there are a lot of docs, so it often happens that between passes one or two revisions have been issued and it's time to start over. In Cyber days and VAX days and DG days and SGI Iris days, I'd be up to about 85% by the 2nd pass and have implemented the features into a couple releases. On OS 7 I'd be trying to implement features on the 2nd pass, but be making mistakes because of ignorance of the full context, and be needing to make a third pass to fix bugs. On
Re: Should I learn CoreData for this project?
> 1. Keep going back to the documentation. > It takes time to grasp all the concepts. If something is not clear and complete, submit a comment on the documentation. Every documentation web page has a link to a comment form. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: beginner question, NSNumber, NSDecimalAsNumber
> On Mon, 2009/11/09, Alastair Houghton wrote: > From: Alastair Houghton > Subject: Re: beginner question, NSNumber, NSDecimalAsNumber > To: "Thomas Wetmore" > Cc: "list-cocoa-dev List" > Date: Monday, 2009 November 9, 5:55 >> On 2009 Nov 09, at 10:49, Thomas Wetmore wrote: >> The approach found by Ron prints the bits in >> correct order... > > Or you can calculate the number of bits and > fill the buffer in reverse. It's pretty > easy to do a bit count on a fixed-size word > (no need for a loop, in fact). Last I looked, 1-bit count was an assembly/ hardware instruction. Getting the highest order on-bit required a little cleverness. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: passing a method name?
> On Sun, 2009/12/20, Graham Cox wrote: > From: Graham Cox > Subject: Re: passing a method name? > To: "Chunk 1978" > Cc: "cocoa-dev Dev" > Date: Sunday, 2009 December 20, 07:29 >> On 2009/12/21, at 00:18, Chunk 1978 wrote: >> i have a bunch of methods that will call one >> method. currently, i'm passing a string object >> so the called method will know which method >> had called it, and complete the proper task >> based on the method that called it. > Good programming practice encourages the idea that > functions and methods are complete in and of themselves, and > are invariant under different calling conditions. Variations > should be accomplished using properly passed parameters, not > information about where the function has been called from. > I'd say this approach is going to bite you very, very hard > if you persist with it. Nobody does this in professional > programming, and where it is done inadvertently, it will > usually be rejected and revised when code is peer-reviewed. > So you might consider this comment part of a peer review. > > The only situation this is considered acceptable is when > passing a callback or completion method, where the called > method calls the passed method but no part of its internal > state depends on it. > > > instead of creating strings and passing them, is it > possible to pass > > the method name? > > You can pass a SEL (selector) type but unless it's for the > specific purpose of indicating a callback or completion > method, I would strongly advise against it. OTOH http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ActionMessages/Concepts/TargetsAndActions.html http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/SearchFields/Articles/ConfiguringTargetAction.html - (IBAction)updateFilter:sender http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/CommunicateWithObjects.html - (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename; // NSApplication - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender; // NSApplication An action is the message a control sends to the target or, from the perspective of the target, the method it implements to respond to the action. A control or— as is frequently the case in the Application Kit—a control’s cell stores an action as an instance variable of type SEL. SEL is an Objective-C data type used to specify the signature of a message. An action message must have a simple, distinct signature. The method it invokes returns nothing and has a sole argument of type id. This argument, by convention, is named sender. Here is an example from the NSResponder class, which defines a number of action methods: - (void)capitalizeWord:(id)sender; Action methods declared by Cocoa classes can also have the equivalent signature: - (IBAction) deleteRecord:(id)sender; In this case, IBAction does not designate a data type for a return value; no value is returned. IBAction is a type qualifier that Interface Builder notices during application development to synchronize actions added programmatically with its internal list of action methods defined for a project... http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/EventOverview/EventHandlingBasics/EventHandlingBasics.html >From Interface Builder you can generate a header file and implementation file >for your Xcode project that include a declaration and skeletal implementation, >respectively, for each action method defined for a class. These Interface >Builder–defined methods have a return “value” of IBAction, which acts as a tag >to indicated that the target-action connection is archived in a nib file. You >can also add the declarations and skeletal implementations of action methods >yourself; in this case, the return type is void.) The remaining required part >of the signature is a single parameter typed as id and named (by convention) >sender. Listing 3-1 illustrates a straightforward implementation of an action method that toggles a clock’s AM-PM indicator when a user clicks a button. Listing 3-1 Simple implementation of an action method - (IBAction)toggleAmPm:(id)sender { ... } ... ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
OO idiom avoiding switch and if
There's a programming idiom to avoid using complex if statements and switch/case statements, and instead to just send a message to a different class of object. I'm doing some parsing of an old text data format which has a hierarchy with a record and then sub-records and sub-sub records, 1 per "line". Each is structured as a type, nesting level number and then various kinds of values depending thereon. What I'm agonizing over is how best to handle invoking the processing for each sub-record type in Objective-C. This would seem to require having a bunch of classes with names like JGRecordTypeParser and then I might do something like: NSString * valueParserClassPrefix = @"JG"; NSString * valueParserClass = [[valueParserClassPrefix stringByAppendingString:recordSubType] stringByAppendingString:@"Parser"]; [[NSClassFromString(valueParserClass) alloc] initWithTokens:tokens recordType:recordType level:aLevel]; or some such. Or, I could just do it all in my primary parser class [self parseValueOfType:recordType subRecordType:subType level:aLevel]; and then have the rat's nest inside there: switch (recodType) { case thisType: //... break; case thatType: //... break; default: //... } Advice on what's least messy overall or pointers to sources of info would be appreciated. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: parsing a string into words
NSArray * tokens = [string componentsSeparatedByCharactersInSet: whitespaceCharacterSet]; ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: parsing a string into words
At Sun, 2009-04-26, 09:01, Alastair Houghton wrote: >> At 2009 Apr 26, 04:33, Jeffrey Oleander wrote: >> NSArray * tokens = [string >> componentsSeparatedByCharactersInSet: >> whitespaceCharacterSet]; > No, no, no. If you read Gerriet's original post, > you would have noticed that he even explained > that what you just said won't work, because not > all languages use whitespace to separate words > like English does. > > You probably want to be using CFStringTokenizer(), > at least on OS X. For cross-platform code, > ICU is probably your best bet. Thanks for that info and the pointer to the ICU. http://userguide.icu-project.org/boundaryanalysis BreakIterator Character, Word, Line or Sentence "you provide an appropriate CharacterIterator" UChar * I was half expecting that response because I was aware that "not all languages use white space to separate words", but hoping for some magic in NSString. Unfortunately, CFStringTokenizer is not available in 10.3.9, and no, I do not have a chest of silver or gold behind my pillow to run around buying newer hardware and software, let alone doing so every 2 years; we're in re-boot-strapping mode in the land of the globalized Bush-Clinton-Bush-Obama depression. This makes ICU suspect: "Copyright (c) 2000 - 2008 IBM and Others" Is Apple one of the "Others"? The "using ICU" list is a mixed bag of reputable firms and unethical rogues, and I don't see any additional info on who is behind "ICU". As much as I enjoy languages (I've taken a few in college, and 10 years ago I was on a couple Unicode e-mailing lists mainly to read the interesting discussion about the differences), for now I'll stick with the US+Euro+Japanese+ Latin+Hebrew solution that I have, that uses Objective-C and doesn't drag me into the complications of Objective-C++ and transferring data around to different stores based on different programming language and framework conventions, that I can immediately use, can trust, and seems amenable to reasonable later modification to handle the remote out-liers. Onward. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSDateFormatter for ISO8601
> On Mon, 2009/04/27, Martijn van Exel wrote: > Unrelated: one of the XML attributes that needed > parsing was a ISO8601 style date string, for > which neither NSDate nor NSDateFormatter > curiously does not seem to provide a parser. ? Of course, it will parse ISO dates. You just need to give it the format... off the top of my head something like %Y-%m-%dT%H:%M%:s ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSXMLParser and NSDocument
I've been having 2 intermittent compilation errors on 10.3.9 in - (BOOL)loadDataRepresentation:(NSData*)data ofType:(NSString*)fileType { BOOL success; NSString * lowercaseFileType = [fileType lowercaseString]; NSLog(@"fileType=%S", lowercaseFileType); if ([lowercaseFileType isEqualToString:@"abc"]) { JGOAbcParser * abcParser = [[JGOAbcParser alloc] initFromAbcData:data]; if (abcParser) success = YES; } else if ([lowercaseFileType isEqualToString:@"defg"]) { NSXMLParser * xmlParser = [[NSXMLParser alloc] initWithData:data]; [xmlParser setDelegate:JGOXMLParser]; success = [xmlParser parse]; } [...] return success; } The first is a warning where I try to log the file type, grumping that the 2nd argument is not of the desired type. (Converting it to lower case was an attempt to see whether it would affect the warning, and at first I thought it did. But, in any case, it makes the later if condition simpler.) The second is error: parse error before "JGOXMLParser" and point to [xmlParser setDelegate:JGOXMLParser]; I understand that – loadDataRepresentation:ofType: method is valid in 10.3.9 but deprecated in 10.4 but I have to work with what I have. Does the delegate have to be an instance? If so, would I instantiate it right before setting the delegate? The manuals and examples are not enlightening, since most simply [fred setDelegate:self] Do I have to implement all delegate methods? I am under the impression it would check and revert to defaults on ones that I did not. Here are the declarations of the ones I have, now: - (void)parserDidStartDocument:(NSXMLParser*)parser; - (void)parser:(NSXMLParser*)parser didStartElement:(NSString*)elementName namespaceURI:(NSString*)namespaceURI qualifiedName:(NSString*)qName attributes:(NSDictionary*)attributeDict; - (void)parser:(NSXMLParser*)parser foundCharacters:(NSString*)string; - (void)parserDidEndDocument:(NSXMLParser*)parser; And, finally, what is that namespaceURI parameter? The descriptions are non-descriptive to me. Is that supposed to be a URI to a DTD or XML schema, or something completely different? Since it's not doing validation, I was hoping to dispense with a DTD or schema, for now, and just pick and choose what tags to process. manuals, etc., consulted: _Event-Driven XML Programming Guide for Cocoa_ _Application Architecture Overview_ _Document-Based Applications Overview_ _NSDocument Class Reference_ Aaron Hillegass 2002 _Cocoa Programming for Mac OS X_ http://www.w3schools.com/ ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSXMLParser and NSDocument
> On Tue, 2009/04/28, Graham Cox wrote: >> On 2009/04/29, at 08:34, Jeffrey Oleander wrote: >> I've been having 2 intermittent compilation errors >> on 10.3.9 in >> - (BOOL)loadDataRepresentation:(NSData*)data >> ofType:(NSString*)fileType >> { >> BOOL success; >> NSString * lowercaseFileType = >> [fileType lowercaseString]; >> NSLog(@"fileType=%S", >> lowercaseFileType); > %S specifies a null-terminated array of 16-bit unicode > characters. What you're passing is an NSString object. > So the specifier should be the object specifier, %...@. Yes, that is what I had tried first. Still, the warning comes and goes. >> The second is >> error: parse error before "JGOXMLParser" >> and point to >> [xmlParser setDelegate:JGOXMLParser]; >> >> I understand that – loadDataRepresentation:ofType: >> method is valid in 10.3.9 but deprecated in 10.4 >> but I have to work with what I have. >> >> Does the delegate have to be an instance? > > It has to be an instance of *something*. OK, Thanks. That leaves only, what's the namespaceURI parameter in - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName attributes:(NSDictionary *)attributeDict The examples do not show and the reference says "namespaceURI If namespace processing is turned on, contains the URI for the current namespace as a string object." so I'm going to let it be an empty string. I've submitted comments to the documentation. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: A tree data structure?
> On Tue, 2009/05/05, WT wrote: > From: WT > Subject: Re: A tree data structure? > To: "Cocoa-Dev List" > Date: Tuesday, 2009 May 5, 12:19 > Please let's not forget that a tree data structure > is often pretty much useless without some form of > balancing... The OP's post reminds me of a couple of mine back around 2001, asking for threaded trees and graphs and linked lists and such (with bi- directional links and built-in support for other threadng schemes). You can always whip up a quick index into the more complex data forest, as you build the trees or after, if walking the structure isn't fast enough. I'm more concerned about how to manage what owns the tree or forest (and the index), so that it stays around and is accessible as long as necessary, but no longer. I understand that setters can do an autorelease and then the caller do a retain as one way to pass ownership up the line. I might have a user who opens several files, the data gets imported, converted, reorganized, and then added to a model tree. The user is likely to attach trees at particular node(s), display these trees in various ways in multiple windows and save the model tree in my native format (or an export file format), most likely after doing some editing in my editing interface(s) to the model data. Maybe he opens or imports various trees along the way, does some work, sometimes saves changes, and closes some of the trees, or just releases the file and the associated NSData object once I've got the data in model form. What I don't get is how the life-cycle of whatever object(s) own the tree, and of the tree itself, fit into the application's execution and event cycles. Sure, we've got model, controller and view/interface. And we automagically have a couple threads going. And the tree should be part of/owned by the model, fed back and/or forth through the controller to/from the interface(s), but just at the moment, I'm missing some glue or fasteners somewhere. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Calling delegates explicitly
> On Sat, 2009/05/16, Jason Stephenson wrote: > From: Jason Stephenson > Subject: Re: Calling delegates explicitly > To: "Cocoa Cocoa-Dev" > Date: Saturday, 2009 May 16, 23:04 >> Eric E. Dolecki wrote: >> If I understand you, make a method which you can call >> directly and call this also from your delegate selector. > > I was trying to say that if you implement a class that has > the following method: > > -(void) setDelegate: (id) delegate; > > You are more or less obligated to call: > > [delegate delegateMethod] > > somewhere in your implementation. Otherwise, the delegate > never does anything. Unless the class that does the setDelegate: also does [self delegateMethod] ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: File formats for multi-doc app: packages, single files or zipped alternatives
> On Sun, 2009/05/17, Keith Blount wrote: > From: Keith Blount > Subject: File formats for multi-doc app: packages, single files or zipped > alternatives > To: cocoa-dev@lists.apple.com > Date: Sunday, 2009 May 17, 12:20 > I’m working on version 2 of my software at the moment, > and in so doing and am looking into the possibility > of a better file format and was wondering if I am > missing something. Currently, my program uses a > file package format... > However, there are some issues with the package format, > chief among them synchronisation; much synchronisation > software just doesn’t play nicely with file packages, > and some users not au fait with the package format > have had files corrupted by synchronisation software. > They have problems e-mailing files to each other (not > all e-mail software allows them as attachments because > they are interpreted as folders), sharing them across > networks and suchlike too... I've been pondering this same issue, and anticipate giving the user the ability to extract a subset of the, uh, package-base for export into a new package. As far as e-mailing as a monolithic unit, you could give them the option to do make it a tarball or zip it as part of the saving operation (or, at first, do that as a separate operation, themselves). For now, my thinking was to let them choose whether to tar or zip and fire off a process. Synchronization, in and of itself, has some quirks that anyone using it must consider. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Databases on Cocoa (was Re: Invoice program made in Objective c/Cocoa)
Yah, it's getting there. It's just not there yet. The data modeling still isn't quite up to ORM standards we had nearly 30 years ago. When we dink with PHP and Python which have handy APIs, it can get to be frustrating. Just provide input via the bugreporter and comments to the docs, and strive for a bit of patience. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: what am I missing with NSString ?
> On Tue, 2009/05/26, Volker in Lists wrote: > From: Volker in Lists > Subject: Re: what am I missing with NSString ? > To: "vinai" > Cc: Cocoa-dev@lists.apple.com > Date: Tuesday, 2009 May 26, 08:41 > from the code listed I cannot tell if you alloc'ed memory > for your NSString at all? > > What is the goal you try to achieve? If you just want to > store a single file path... with a global NSString do as > along the lines of: > > [rawFileName release]; > rawFileName = [[NSString alloc] initWithString:[[files > objectAtIndex:i] stringByStandardizingPath]]]; The NSString reference suggests that it will return an object. Since it's an instance method and not a class method, this suggests that an alloced string must be the receiver. "Returns an NSString object initialized by copying the characters from another given string. - (id)initWithString:(NSString *)aString " OTOH, stringWithString is a class method, suggesting that it must be sent to NSString and it will take care of the alloc: "Returns a string created by copying the characters from another given string. + (id)stringWithString:(NSString *)aString " ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSXMLParser - howto resolve entities defined in DTD
> On Mon, 2009/06/01, Keary Suska wrote: > From: Keary Suska > Subject: Re: NSXMLParser - howto resolve entities defined in DTD > To: "Cocoa-Dev (Apple)" > Date: Monday, 2009 June 1, 10:16 >> On 2009 May 31, at 4:31 PM, Dominik Pich wrote: >> I use NSXMLParser to parse large XML files-- going >> good BUT :) >> I cant get the parser to resolve the external entities >> from the DTD. >> >> I googled and read documentation and older mails... >> and I did set parser.shouldResolveExternalEntities = >> YES > Well, the docs state: 1) "An NSXMLParser notifies its > delegate about the items (elements, attributes, CDATA > blocks, comments, and so on) that it encounters as it > processes an XML document. It does not itself do > anything with those parsed items except report them." > and 2) in setShouldResolveExternalEntities, "Indicates > whether the receiver reports declarations of external > entities using the delegate method > parser:foundExternalEntityDeclarationWithName:publicID:systemID:." > > I should be clear, then, that NSXMLParser does *not* > resolve external entities in any way, only reports > them, and explains what you see. And I don't recall it saying anything about parsing and otherwise examining the DTD or XML schema file except that there were hooks for later possible development of means to check whether the XML conforms to a DTD or XML schema. My reading is that it should be possible to have it parse whatever it finds in an XML file without any regard for whether it conforms to a DTD or XML schema. ___ 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 Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com