Re: Checking security settings?

2014-09-05 Thread Jens Alfke
It might be better to make your app itself enforce the HIPAA requirements — for example, blank the application's windows after a period of no activity, and require a passcode to un-blank them. That won't involve any sandboxing issues. —Jens ___ Cocoa-

Re: dispatch_sync(dispatch_get_main_queue() UI weirdness

2014-09-05 Thread Jens Alfke
> On Sep 5, 2014, at 11:44 AM, Jonathan Guy wrote: > > when the NSOpenPanel opens all kinds of weirdness is going on. The scroll > views scroll very erratically if at all and the directories don't list > properly. Well, you've blocked one of the threads that services the global dispatch queu

Re: dispatch_sync(dispatch_get_main_queue() UI weirdness

2014-09-05 Thread Jens Alfke
> On Sep 5, 2014, at 1:48 PM, Quincey Morris > wrote: > > It seems to me you’re *still* abusing the main thread. A dispatch_sync blocks > the main thread, so it can’t be allowed to do anything that run > asynchronously on the main thread (such as displaying a dialog) since that > won’t compl

Re: Crash presenting modal built with Xcode 6 GM

2014-09-09 Thread Jens Alfke
> On Sep 9, 2014, at 6:09 PM, Rick Mann wrote: > > The debugger stops at the main entry point with this useless stack. Come on; it's not "useless", you just have to look carefully. Cocoa APIs are so verbose that backtraces often read pretty easily. > #20x023b2d5e in -[NSObject(NSKeyValueC

Re: NSUserDefaults not sticking

2014-09-10 Thread Jens Alfke
I've run into issues of app preferences/defaults not persisting (across lots of apps, not necessarily just my own), and in the past few years when it's happened it's been an early symptom of filesystem corruption. Sometimes there have been a bunch of leftover temporary lock(?) files in the Prefe

FYI, SQLite-based geo-queries are broken in Yosemite DP7

2014-09-10 Thread Jens Alfke
(I know this technically isn't about Cocoa APIs, but cocoa-dev still seems like the most appropriate list. I suspect a lot of app developers don't read darwin-userlevel.) Those of you with Mac apps that do geo-querying using SQLite may be interested to know that your queries probably broke in Y

Re: Sudden termination and WebKit

2014-09-12 Thread Jens Alfke
> On Sep 12, 2014, at 12:16 AM, Daryle Walker wrote: > > I heard that the User Defaults API does caching since 10.9 Mavericks. If so, > it is safe to use when adding Sudden Termination to your app? It's Apple's code so I assume they would make it safe with Sudden Termination. My guess is that

Re: Singleton or class methods?

2014-09-13 Thread Jens Alfke
I would go with class methods. Apple's APIs tend to use instance methods (NSFileManager, NSNotificationCenter, etc.); the benefit of those is that you can have multiple instances with different state (like delegates), or different behaviors. The doesn't seem like it's relevant to your case, thou

Re: Why not use path-based API? (was: Loading image resources)

2014-09-14 Thread Jens Alfke
Performance is another reason. IIRC, in earlier OS X releases it turned out that there was significant overhead stemming from converting between different types of file references as a call went up and down the stack — NSString/CFString <—>NSURL/CFURL <—> FSRef <—> C strings, etc. (This may soun

Re: NSOutlineView not lazy when expanding items :(

2014-09-16 Thread Jens Alfke
> On Sep 16, 2014, at 10:23 AM, Jerry Krinock wrote: > > Apparently it’s the *expand* operation which is not smart enough to realize > the small number of items that can be displayed. (So I guess you would not > see this behavior in a table view.) Maybe there is a technical reason for > thi

Re: Doc links broken

2014-09-17 Thread Jens Alfke
> On Sep 17, 2014, at 6:00 PM, Alex Zavatone wrote: > > What is insanely stupid is that in Xcode 5, the docs are already downloaded > into the app, but Xcode 5 has to check the internet for the docs by using the > link. This breaks the docs. So, searching any of the docs fails from within >

Re: Changing app screenshots after submission

2014-09-18 Thread Jens Alfke
> On Sep 18, 2014, at 10:25 AM, Rick Mann wrote: > > I learned yesterday that you can't change the screenshots in the App Store > after your app is approved. Has this always been the case? It seems ludicrous > that I have to submit a new binary to change the screenshots (but that's > exactly

Re: Heavy flickering on Retina Macs with Yosemite & NSVisualEffectView & overlay windows

2014-09-19 Thread Jens Alfke
FWIW, I've seen standard UI controls (esp. progress bars) in Apple apps go into this kind of super-flickery state in Yosemite on my Retina MBP. I've been assuming it's a WindowServer or graphics driver bug. (No, I didn't file a Radar. It was sufficiently common and glaring that I assumed it was

Re: return string that is the difference between two other strings

2014-09-20 Thread Jens Alfke
> On Sep 20, 2014, at 10:43 AM, Scott Ribe wrote: > > There is no simple definition of "the difference between two strings", and I > don't think it's a basic need at all. Usually when programmers talk about "differences" they're referring to something like what a 'diff' tool produces, which i

Re: return string that is the difference between two other strings

2014-09-20 Thread Jens Alfke
> On Sep 20, 2014, at 7:54 PM, 2551 <2551p...@gmail.com> wrote: > > OK, I should have presented the problem, rather than a solution that needed > improving. If you have two text files written out at different times, how do > you guys determine the difference between their contents to produce a

Re: Question on OS X app submission

2014-09-20 Thread Jens Alfke
> On Sep 20, 2014, at 8:53 PM, Jim Geist wrote: > > Or is it the status area aspect you think will get me rejected? What's the "status area" — the menu bar? Any app can show an icon/menu in the menu bar using NSStatusItem. Fantastical is a good example, and it's in the App Store. —Jens _

Re: return string that is the difference between two other strings

2014-09-21 Thread Jens Alfke
> On Sep 20, 2014, at 11:45 PM, Allan Odgaard > wrote: > > If you need a C API then have a look at > https://code.google.com/p/google-diff-match-patch/ > This^^ looks like exactly what you want, 2551. The online demo is quite impressive:

Re: ios 8 crashing on "_updateInterfaceOrientationFromDeviceOrientation"

2014-09-23 Thread Jens Alfke
> On Sep 23, 2014, at 11:31 AM, Herman Chan wrote: > > Hi all, > > Another mysterious iOS 8 crash I am getting, here is the crash log. > > Thread : Crashed: com.apple.main-thread > 0 libobjc.A.dylib0x32bfbf46 objc_msgSend + 5 > 1 UIKit 0x289ba531 -[UI

Re: ios 8 crashing on "_updateInterfaceOrientationFromDeviceOrientation"

2014-09-24 Thread Jens Alfke
> On Sep 24, 2014, at 10:52 AM, Herman Chan wrote: > > Sadly, I wasn't able to find any zombies in instruments. > > Just to make sure that I am doing this right, the step to find zombies are. I've never used zombies in Instruments; I think that's a separate thing from using it in Xcode. All y

Re: Obtaining class of key at runtime

2014-10-06 Thread Jens Alfke
> On Oct 6, 2014, at 7:43 AM, Devarshi Kulshreshtha > wrote: > > Scenario 1: Do not initialize instance variables in initWithPlist method > > In this case if I try to log class of key in setValue:forKey method, > it prints nil That doesn't make any sense — it's illegal to pass a nil key to s

Re: iOS Category to match OS X category

2014-10-07 Thread Jens Alfke
> On Oct 7, 2014, at 1:09 AM, Kevin Meaney wrote: > > This category is not in any of the iOS frameworks as far as I can tell. So it > looks like the only way I can get the same behaviour on iOS is using > associated objects/references. That sounds reasonable. > I'm not comfortable with this

Waiting for a future runloop-based callback

2014-10-08 Thread Jens Alfke
I thought I understood runloops pretty well, but I'm running into a situation that's got me stumped. Basically it involves how to wait (block) for a future message-send that will be queued onto the current runloop. So I've started an asynchronous task that runs on a background thread. When the

Waiting for callback with GCD: impossible?

2014-10-08 Thread Jens Alfke
On a related topic from my last post, looking at the equivalent situation but using GCD instead of runloops, the problem appears to be impossible. That is: * Code running on dispatch queue A starts some async task that will run on another queue B, and which will signal completion by using dispat

Re: Waiting for callback with GCD: impossible?

2014-10-08 Thread Jens Alfke
> On Oct 8, 2014, at 12:06 PM, davekeck . wrote: > > You could use some other signaling mechanism -- a dispatch_semaphore_t > or NSConditionLock, for example. Yeah, but that doesn't work for the async mode, where I need a dispatch_async call to queue A to notify it. Maybe I'd also need a share

Re: Waiting for callback with GCD: impossible?

2014-10-08 Thread Jens Alfke
> On Oct 8, 2014, at 12:28 PM, Ken Thomases wrote: > > Queues are not like run loops nor threads. Your desire to have ongoing logic > occur on a particular queue seems odd to me. I don't think it's odd to want an ongoing single flow of control for specific parts of the program. Limiting para

Re: Concurrent tasks are getting hung up

2014-10-09 Thread Jens Alfke
First check the docs for the CGImage APIs to see what their thread-safety is like. I'm guessing you may need to create a new context for each different thread you use them in. That's relevant because if the operation queue allows operations to run in parallel, they're each effectively on a diffe

Re: Kerning Pairs

2014-10-12 Thread Jens Alfke
> On Oct 12, 2014, at 7:44 PM, Raglan T. Tiger wrote: > > I don't think so as our model code works just fine when driven from Windows > V-C that get a font, gets it its outline and mer table and call the model. > Beautiful output. Sure, it's just going to be limited by pair-based kerning, wh

Re: Proper way to retain member of AppDelegate?

2014-10-15 Thread Jens Alfke
> On Oct 15, 2014, at 1:58 PM, Howard Moon wrote: > > I think I resolved it… my data object's members were all declared using > @property(assign). I changed those all to @property(retain), and it works > now. Don't use assign or retain in ARC, use weak and strong. (And generally you'd just

Re: DOMDocument in 10.10

2014-10-18 Thread Jens Alfke
> On Oct 18, 2014, at 5:33 AM, Gerriet M. Denkmann wrote: > > Note: the head has only 12 children (the first 10 are identical to 10.9), and > there is no body at all. Weird! Are you sure that the page has finished loading by the time you made the call? Maybe your code is running at a point wh

Re: Expected identifier or '(' and other errors occur after copying working code to a second machine

2014-10-28 Thread Jens Alfke
> On Oct 28, 2014, at 6:44 AM, Saunderson, Rik > wrote: > > Does anyone have any ideas about what's going on? I can only assume that > there's something wrong with the build settings or include paths or > something, but I've checked through all of them and they all appear to be > identical

Re: Turn off background click behavior on a window?

2014-10-29 Thread Jens Alfke
> On Oct 29, 2014, at 10:57 AM, Quincey Morris > wrote: > > However, this is the wrong solution. A button that doesn’t click through > should *look* different when the app is in the background (and shouldn’t do > rollover highlighting). So a better solution is to disable buttons you don’t >

Re: CoreData regression or performance problem, anyone?

2014-11-12 Thread Jens Alfke
> On Nov 12, 2014, at 6:51 AM, Vincent Habchi wrote: > > the sqlite version installed on OS X machines has been bumped to 3.8.x in OS > X 10.10. This apparently had the unfortunate side (or collateral) effect of > plummeting performance of some requests (specifically, some Macports related >

Re: help with debugging

2014-11-18 Thread Jens Alfke
> On Nov 18, 2014, at 10:04 AM, Sean McBride wrote: > > Those offsets tell you how far into the function (in bytes I think) it was. > You can indeed bring that back to a line number. See here: > > > That in

Re: Crash on SIGILL

2014-11-21 Thread Jens Alfke
> On Nov 21, 2014, at 9:24 AM, Laurent Daudelin > wrote: > > I've never seen this. Anybody has any clue what could cause a method cache > corrupted? Well, general heap corruption, I suppose, like overwriting the end of a block or writing to previously-freed memory. These kinds of problems a

Re: Trouble getting ISO-8859-1 encoded feed to parse and display

2014-11-23 Thread Jens Alfke
> On Nov 23, 2014, at 1:06 PM, Diederik Meijer | Ten Horses > wrote: > > When I just pull in the feed’s contents using a NSURLConnection, it will show > up on some, but not all, devices. What does "show up" mean in this case? Is there an error? If so, what is it? > When I try to log the resp

Re: Trouble getting ISO-8859-1 encoded feed to parse and display

2014-11-24 Thread Jens Alfke
> On Nov 24, 2014, at 5:15 AM, Alex Zavatone wrote: > > The Android parser doesn't seem to care about return/enter characters, but > the iOS JSON parser sure does. The grammar at json.org (in the right sidebar on the home page) explicitly says strings can't contain control characters. I've

Re: Trouble getting ISO-8859-1 encoded feed to parse and display

2014-11-24 Thread Jens Alfke
> On Nov 24, 2014, at 9:30 AM, Diederik Meijer | Ten Horses > wrote: > > I get no errors, but no results from the parser either. I haven't tested > against didStartElement, because it seems clear that no data goes into the > parser. Did you implement these delegate methods: - (void)parser:(N

Re: Is NSURLSession with NSURLSessionDataTask safe for streaming network connection?

2014-12-02 Thread Jens Alfke
> On Dec 2, 2014, at 4:47 PM, Sasikumar JP wrote: > > But some times, connection is terminated with -1001(NSURLErrorTimedOut) > error code (may be after 10 or 15 mins). I have tried with different radio > URLs. the same behaviour. That will happen if no data is received from the server for a wh

QR-code scanning for Mac OS?

2014-12-03 Thread Jens Alfke
I'm getting interested in using QR codes to pair devices or quickly share information (i.e. one device displays a QR code that the other device then reads with its camera.) It's quite easy to generate a QR code using CoreImage. The roadblock I've hit is that AVFoundation only supports QR-code s

Re: Using AV Foundation to record m3u8 stream to disk

2014-12-08 Thread Jens Alfke
> On Dec 7, 2014, at 11:00 PM, Graham Cox wrote: > > The title says it all really: is it possble to use AV Foundation to record a > m3u8 stream to a movie file (optionally transcoded). m3u8 isn't a stream, it's simply a small playlist file that contains one or more HTTP URLs, which resolve to

Re: NSUserDefaults and home folder on different drive

2014-12-11 Thread Jens Alfke
> On Dec 10, 2014, at 11:05 PM, Rick C. wrote: > > Hi, > > Digging deeper I find that most often the user has their home folder on a > different drive (external?) than the actual app. What would be the solution > to make sure these objects are written properly in this case? There's nothing

Where's NSExpression format string syntax documented?

2014-12-12 Thread Jens Alfke
I'm looking for a description of the expression syntax that +[NSExpression expressionWithFormat:] parses, but I can't find anything. There's a whole page on the _predicate_ format string syntax*, but that only covers the syntax specific to predicates and ignores expressions. (For example, it des

Re: NSRegularExpression segfault

2014-12-15 Thread Jens Alfke
> On Dec 15, 2014, at 8:38 AM, ecir hana wrote: > > Please, can anyone explain to me why does the following program > consistently segfault after 5 characters? I'm running 10.9.5… What's the backtrace? Whenever investigating a crash you should always start by looking at the stack. (To get

Re: NSRegularExpression segfault

2014-12-15 Thread Jens Alfke
> On Dec 15, 2014, at 8:56 AM, ecir hana wrote: > > I don't seem to have "bt" but I got instead from "Problem Report" window: Sounds like you're not running the app in Xcode. If you're hitting a crash or other bug you should always try to reproduce it while running the app in Xcode, so the de

Re: PList Data Typing

2014-12-15 Thread Jens Alfke
> On Dec 15, 2014, at 2:10 PM, Kevin Bracey wrote: > > How can I tell if the Value is a Boolean or Number in the NSDictionary? as 0 > and 1 are valid values for a number. There's no clean solution for this. You have to take advantage of the fact that the YES and NO NSNumbers are singleton obj

Re: PList Data Typing

2014-12-16 Thread Jens Alfke
> On Dec 16, 2014, at 11:46 AM, Uli Kusterer > wrote: > > Make sure you test that thoroughly. I remember that older Mac OS X releases > didn't have a separate boolean class, so depending on who writes that file on > what OS, you may just get an NSNumber (even if you call NSNumber > numberWit

Re: Issues with applications running on background (Alarm Application)

2014-12-16 Thread Jens Alfke
> On Dec 16, 2014, at 11:49 AM, Claudio M. E. Bastos Iorio > wrote: > > · I’ve started by using UILocalNotification, however, when my app > goes to background, I’m receiving the scheduled Notification, as expected, > but I didn’t find a way to load my custom image or playing the custom

Re: Issues with applications running on background (Alarm Application)

2014-12-16 Thread Jens Alfke
> On Dec 16, 2014, at 7:55 PM, Claudio Maximiliano Edison Bastos Iorio > wrote: > > soundName property is OK, and allows to use any embedded sound. But there’s > no way to load any custom view dispatched right from the LocalNotification, > at least no with a previous user interaction. Correc

Re: Issues with applications running on background (Alarm Application)

2014-12-17 Thread Jens Alfke
> On Dec 16, 2014, at 10:37 PM, Claudio Maximiliano Edison Bastos Iorio > wrote: > > Is it possible to wakeup/resume an iPhone application from background mode to > foreground mode programmatically? How? No. From the user's perspective, the app they're using would abruptly disappear, to be r

Re: Saving NSAttributedString to a File

2014-12-19 Thread Jens Alfke
> 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 th

Re: Beep ( frequency, duration)

2014-12-28 Thread Jens Alfke
> On Dec 28, 2014, at 12:05 PM, Raglan T. Tiger wrote: > > Is it possible with Cocoa to generate a tone of a specified frequency and > duration to play synchronously? You might be able to do this with AVFoundation, or you may need to descend to the C-based CoreAudio APIs. I don't think there

Re: Beep ( frequency, duration)

2014-12-29 Thread Jens Alfke
> On Dec 29, 2014, at 2:12 AM, Michael Crawford wrote: > > While this source runs in userspace, > and it supplies data from userspace, the requests for samples seem to > be coming from a hardware interrupt task. It's not quite that low-level! It's a thread, but a super-high-priority (real-time

Re: Beep ( frequency, duration)

2014-12-30 Thread Jens Alfke
> On Dec 29, 2014, at 2:12 PM, Michael Crawford wrote: > > My input does come from another thread, reading ogg vorbis, flac, wave > or mp3 files that write into a circular buffer. If you're doing this for your own entertainment or education, going the low-level route like this is fine. But for

Re: Bifurcating text color in QL on X.6, how?

2015-01-01 Thread Jens Alfke
> On Jan 1, 2015, at 1:25 PM, Eden Smallwood wrote: > > If you’re thinking "Wh on Bk and Bk on Wh, therefore XOR to the > rescue", I’ve tried every conceivable setting of cgBlendMode and > nsCompositingMode and nothing has any effect whatsoever on the text color > which results in the w

Re: Detecting face features using CoreImage or HSV space/Mask

2015-01-02 Thread Jens Alfke
> On Jan 2, 2015, at 12:34 AM, Muhammad Hussein Nasrollahpour > wrote: > > I just got one solution to the problem. Instead of using CI I can convert RGB > to HSV and then create a mask for face features e.g. lips, eyes, etc. but > 1. How to use hue to create a mask for different face features

Re: Bifurcating text color in QL on X.6, how? (Quincey Morris / Jens Alfke)

2015-01-03 Thread Jens Alfke
> On Jan 2, 2015, at 9:53 PM, Eden Smallwood wrote: > > Why would an RTF data representation be more amenable to blend modes > than when I’m directly calling [ drawInRect:sasdf > withAttributes:asdfasd] ? Because the client that's drawing the preview can postprocess the RTF (or more li

Re: QuickLook Poll

2015-01-04 Thread Jens Alfke
> On Jan 4, 2015, at 2:43 PM, Eden Smallwood wrote: > > Hey, readers, execute the following at the shell and post if ( result > != 0 ) : > > qlmanage -m | grep -v /System/Library | grep -v com.apple I've got a bunch: public.object-code -> /Applications/Library Inspector.app/Co

Re: Blurry is the New Sharp

2015-01-05 Thread Jens Alfke
> On Jan 5, 2015, at 9:00 AM, Paul Scott wrote: > > And a waste of time that should have been spent elsewhere. I usually dislike piling in on Apple's UI blunders, but in this case I'm compelled to agree :-p I honestly thought that in the post-Steve-Jobs era we at least wouldn't get these poi

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Jens Alfke
> On Jan 6, 2015, at 8:25 AM, Trygve Inda wrote: > > I am saving a bookmark to a file and later on I need to display the filename > associated with that Bookmark. You may need to canonicalize the path. The docs for -[NSString stringByStandardizingPath] don't say that it will fix up the case, b

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Jens Alfke
> On Jan 6, 2015, at 8:43 PM, Trygve Inda wrote: > > Ultimately what I need to able to do is compare a bookmark to a path. Why? Or rather, what is the reason underlying that one? —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please d

Re: URLByResolvingBookmarkData not case sensitive

2015-01-06 Thread Jens Alfke
> On Jan 6, 2015, at 9:37 PM, Trygve Inda wrote: > > When adding new files, I need to make sure the file is not already in the > database so I compare the paths. That's not reliable. Different paths does not mean different files, even without case-folding. There are symlinks and hard-links and

NSCollectionView.selectionIndexes goes wrong

2015-01-06 Thread Jens Alfke
I've just noticed that after an NSCollectionView's content property changes, its selectionIndexes property doesn't change. So even though the change in content means the selected items may now have different indexes, or may no longer exist at all, the selectionIndexes still contains the old obso

Re: Saving NSAttributedString to a File

2015-01-07 Thread Jens Alfke
> On Jan 7, 2015, at 1:49 PM, Jeffrey Oleander wrote: > > 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? By writing your own RTF codec. Apple's doesn't support this. —Jens

Re: Am I Reinventing the Wheel? (Part II)

2015-01-08 Thread Jens Alfke
> On Jan 8, 2015, at 4:43 AM, Charles Jenkins wrote: > > I have two ranges from an NSAttributedString. I want to compare their fonts > and attributes in such a way as to derive a dictonary containing only the > differences. Does a font-and-attribute comparison method already exist? I'm 99% ce

Re: Displaying a scaling, relative time or date

2015-01-08 Thread Jens Alfke
> On Jan 8, 2015, at 6:43 AM, Gary L. Wade wrote: > > When it comes to any localized date or number formatters, see if ICU supports > it, especially the included version on the earlier OS you need to support. If > not but a later one does, you could just include it in your app. On OS X you ma

Re: Am I Reinventing the Wheel? (Part I)

2015-01-08 Thread Jens Alfke
> On Jan 8, 2015, at 4:43 AM, Charles Jenkins wrote: > > I'm writing data to XML. When you create a node and set its string contents, > the node will happily accept whatever string you give and allow you to > serialize information XML deserialization cannot then recreate. In my case, > the st

Re: licence key validation method

2015-01-11 Thread Jens Alfke
> On Jan 10, 2015, at 10:34 PM, 2551 <2551p...@gmail.com> wrote: > > Yes, that's precisely what I'm looking for and don't seem able to find. Can > anyone suggest one? I've been all over stackexchange etc, and there seems to > be a lot of confusion out there (or, rather, the more I read, the mor

Re: licence key validation method

2015-01-11 Thread Jens Alfke
> On Jan 11, 2015, at 12:59 PM, Charles Srstka wrote: > > IMO, it’s better to just static-link OpenSSL into the app and use that. Kind of big, though! libSodium* (based on NaCl) is a much smaller crypto library, which also has the benefit that it uses an elliptic-key algorithm, Curve25519, wh

Re: licence key validation method

2015-01-12 Thread Jens Alfke
Somebody (Dave Fernandes, apparently) wrote: >> >> If you use AquaticPrime, unfortunately, it does not generate standard >> signatures. It manually hashes and then encrypts using the private key. This >> sounds like a normal signature, but it is missing some information stored in >> standard P

Re: licence key validation method

2015-01-12 Thread Jens Alfke
> On Jan 12, 2015, at 8:05 PM, 2551 <2551p...@gmail.com> wrote: > > On the CocoaFob page it says "There is no framework or a library to link > against. You include the files you need in your application project directly". That's pretty inadequate, IMHO (speaking as a library developer.) The pro

Re: licence key validation method

2015-01-12 Thread Jens Alfke
> On Jan 12, 2015, at 9:07 PM, pscott wrote: > > Experience has taught me that copy protection and license keys almost never > prevent software piracy, except where the cost of ownership is so low that > defeating the protection isn't worth the effort. I don't mean to discourage > anyone, but

Re: Debugging memory leak in NSURLSession with ARC

2015-01-13 Thread Jens Alfke
May I just jump in to say that you probably should be discussing this on the macnetworkprog list? There are people on that list (esp. Quinn) who are experts in this area. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: drawRect runs twice, bounds are changed in between

2015-01-13 Thread Jens Alfke
> On Jan 13, 2015, at 9:25 PM, N!K wrote: > > A breakpoint at the end of drawRect shows that it runs twice. After the > second pass, the view appears, as it should. > Between passes, bounds is changed somehow, as shown by NSLog at the start > and end of drawRect. > Since this will upset code

Re: Advice for iOS web app with live feed

2015-01-14 Thread Jens Alfke
> On Jan 14, 2015, at 9:05 AM, Steve Mills wrote: > > I have an opportunity to branch out to new areas (yay!) that I've never had > the chance to work with before, an iOS app that acts as the frontend for a > web site, receiving and sending Facebook- or Twitter-like statuses/updates. > The ba

Re: Advice for iOS web app with live feed

2015-01-14 Thread Jens Alfke
> On Jan 14, 2015, at 10:29 AM, Shazron wrote: > > Consider constructing a JSContext and setting up HTML5 Server Sent > Events (in essence, push for web browsers): The data format for these events is so brain-dead simple that it's not worth starting up a JavaScript context just to handle them.

Re: performBatchUpdates: + removeObjectAtIndex: = EXC_BAD_ACCESS

2015-01-16 Thread Jens Alfke
I suspect your code is getting called on multiple threads, which would definitely cause crashes or heap corruption since you haven't added any synchronization around your objects. If you don't explicitly use multiple threads, maybe the UICollectionView is running your performBatchUpdates: block

Re: Need help on xcode offline documents, it doesn't recognize the docsets

2015-01-19 Thread Jens Alfke
> On Jan 19, 2015, at 8:15 AM, Aaron Lewis wrote: > > I downloaded and installed the iOS 8.1 docsets: Don't download them directly. Use the "Downloads" preferences tab in Xcode to download and manage doc sets. —Jens ___ Cocoa-dev mailing list (Coco

Re: setApplicationIconImage:

2015-01-21 Thread Jens Alfke
> On Jan 21, 2015, at 9:46 PM, Rick C. wrote: > > I’m using NSApp setApplicationIconImage: to set a different icon for > Yosemite. Problem is the standard icon appears for a second then it changes > to the Yosemite one. Same when quitting the app. Is there a better way to > do this? That

Re: setApplicationIconImage:

2015-01-21 Thread Jens Alfke
> On Jan 21, 2015, at 11:03 PM, Rick C. wrote: > > Thanks for the reply. But how can I have multiple icon files in the bundle > and then choose the one I want? Alter the app's Info.plist, I suppose (and then call LaunchServices to tell it to re-register, so it'll notice the changes.) Which i

Re: What's up with the Cocoa Text System?

2015-01-23 Thread Jens Alfke
> On Jan 23, 2015, at 5:50 AM, Charles Jenkins wrote: > > For some reason, typing text on a Mac has always had a little bit of > friction: however the OS receives keyboard input, it doesn't seem to be able > to keep up as well as a PC. But lately, toward the end of Mavericks' lifespan > and n

Re: What's up with the Cocoa Text System?

2015-01-23 Thread Jens Alfke
> On Jan 23, 2015, at 6:02 AM, Peter wrote: > > Maybe this sounds silly, but have you tried to increase the keyboard repeat > frequency in the system preferences. I once was silly enough not to. That sounds silly, honestly. That only affects how rapidly a key repeats when you hold it down. Us

Re: setApplicationIconImage:

2015-01-23 Thread Jens Alfke
> On Jan 23, 2015, at 1:53 AM, Rick C. wrote: > > Unfortunately setApplicationIconImage: works great it’s just I can’t find a > method to put it in that will cause the change before the app launches. It > always takes place a second after the app launches… What you're asking for is impossibl

Re: What's up with the Cocoa Text System?

2015-01-23 Thread Jens Alfke
> On Jan 23, 2015, at 1:53 PM, Michael Crawford wrote: > > At one time I found it quite painful to edit source code with Xcode. > I was told that was due to Xcode using the Cocoa text widget. > > Consider that Lightspeed C worked just fine, snappy and responsive, on > my 6 MHz 68000 Mac 512k (o

Re: NSString stringByAbbreviatingWithTildeInPath and Sandboxing

2015-01-27 Thread Jens Alfke
> On Jan 27, 2015, at 9:20 AM, Jon Baumgartner > wrote: > > So how do I get /Users//file.txt to output as ~/file.txt when > my app is sandboxed? Why do you need it to? That’s not the kind of path you should be displaying in the UI, because it won’t make sense to anyone but geeks. Is this a

Re: copyWithZone archive/unarchive

2015-01-29 Thread Jens Alfke
> On Jan 29, 2015, at 9:44 PM, Trygve Inda wrote: > > However, naming conventions expect copy to not > be autoreleased so should the above really be: > > return ([copy retain]); Yes, if you're really still not using ARC ;-) —Jens ___ Cocoa-dev mail

Re: copyWithZone archive/unarchive

2015-01-30 Thread Jens Alfke
> On Jan 30, 2015, at 8:43 PM, David Rowland wrote: > > It’s best to use ARC uniformly in a project and not mix with non-ARC modules. > Xcode has a tool to upgrade projects to ARC. I have used it a number of > times, and it seems to do a very good job. I haven't had any problem mixing ARC wit

Re: Networking framework crash

2015-02-05 Thread Jens Alfke
> On Feb 5, 2015, at 7:22 AM, Roland King wrote: > > all of which seems to indicate processes have plenty more than 256 file > descriptors available by default. I thought 256 was left behind as a default > long ago because it was way too small. It was definitely 256 as recently as OS X 10.8

Re: ARC dealloc best pratice

2015-02-06 Thread Jens Alfke
> On Feb 6, 2015, at 6:48 AM, Jonathan Mitchell wrote: > > // remove observers > // unregister for notifications I have to confess I'm still not completely certain whether these are needed under ARC. I remember reading something about at least one of these being handled automatica

Re: Convert to NSString from

2015-02-06 Thread Jens Alfke
> On Feb 6, 2015, at 9:48 AM, Raglan T. Tiger wrote: > > What is the 'best practice' for converting to NSString? The best practice is to know how the string data was encoded, and pass that encoding to the NSString initializer. There isn't any single encoding constant that's best, because diff

Re: ARC dealloc best pratice

2015-02-06 Thread Jens Alfke
> On Feb 6, 2015, at 11:55 AM, Jonathan Mitchell > wrote: > > The tableView.delegate is not a zeroing weak ref - in the lingo of ARC it is > unsafe_unretained I believe > self can be deallocated leaving tableView.delegate as a dangling pointer. This is still a weak reference, it's just unsafe

Re: ARC dealloc best pratice

2015-02-06 Thread Jens Alfke
> On Feb 6, 2015, at 2:00 PM, Greg Parker wrote: > > Swift adds "unowned" references. These references are non-retaining. They > differ from weak references and unsafe unretained references: unowned > references fail with a runtime error if you try to access the pointed-to > object after it h

Re: NSBezierPath + thin lines + antialias = :(

2015-02-09 Thread Jens Alfke
> On Feb 9, 2015, at 1:18 PM, Jerry Krinock wrote: > > Is there a way to draw thin lines in code, and get good results on non-Retina > displays? What should I read to learn how? (The listserv strips image attachments, so we can’t see the pictures.) The typical problem drawing thin horizontal

Re: Disable Text Replacement

2015-02-10 Thread Jens Alfke
Have you tried turning off automaticDashSubstitutionEnabled? —Jens ___ 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.co

Re: Question for StackOverflow or other about not sharing cookie jar per webview

2015-02-10 Thread Jens Alfke
You may be better off asking on the webkit-sdk-dev list on this site. I’ve seen WebKit developers from Apple answer questions there, but not on this list. —Jens > On Feb 10, 2015, at 2:13 PM, Juanjo Conti wrote: > > How to achieve the goal of having a not shared cookie jar per WebView in > Mac

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Jens Alfke
> On Feb 16, 2015, at 6:17 AM, Dave wrote: > > My initial thought were to have a WindowController: > LTWMainWindowController that looks after a number of Windows. Usually you have a separate NSWindowController subclass for each distinct type of window. If the windows share some functionality,

Re: NSWindowControllers and NSWindow

2015-02-16 Thread Jens Alfke
> On Feb 16, 2015, at 9:55 AM, Dave wrote: > > I can see I could do it if I had LTWViewController.xib that included an > NSWindow? I’m surprised by how complicated the discussion is making this seem! All you need to do is create an NSWindowController subclass in Xcode, check the “Also crea

Re: BOOL attribute types.

2015-02-16 Thread Jens Alfke
> On Feb 16, 2015, at 1:27 PM, Akis Kesoglou wrote: > > objc.h typedefs BOOL as char/bool, as David says, so I don’t think you can > infer that a property is BOOL by introspecting the property — you’ll always > see char or bool. I’ll chime in too — there’s no way to tell the difference. If yo

Re: get class of a method

2015-02-22 Thread Jens Alfke
> On Feb 22, 2015, at 9:30 AM, Kyle Sluder wrote: > > The compiler does keep type info for properties, but that’s not actually > documented. It’s documented in the “Declared Properties” section of the “Objective-C Runtime Programming Guide”: You can use the property_getAttributes fun

Re: scale text proportionally as bounds increase

2015-02-23 Thread Jens Alfke
> On Feb 23, 2015, at 8:49 AM, sqwarqDev <2551p...@gmail.com> wrote: > > How do I programmatically tell each NSControl to increase its text size > proportionally as its bounds increase? You’ll have to do it manually. Observe the control’s frame, then when it changes compute a new font size and

Re: How to prevent app activation on NSUserNotification action

2015-02-26 Thread Jens Alfke
> On Feb 26, 2015, at 6:11 PM, Alex Kac wrote: > > If my app is currently hidden and a user notification occurs and the user > taps on the action button (in my case "Snooze"); how do I prevent the app > from coming to the foreground? I don’t think you can. Activating the app when the user cli

<    1   2   3   4   5   6   7   8   9   10   >