UITableView: combining row moves with insert/delete/reload in animation

2016-03-08 Thread Jens Alfke
I’m animating a UITableView in response to its backing data changing. I’ve gotten it working with row insertion, deletion and reloads, but now I’m trying to add row movement and it seems like I’ve blown the little view’s mind. Does anyone have experience at combining -moveRowAtIndexPath: with th

Re: Can launchd start a daemon from a code-bundle? Can I bundle my daemon?

2016-03-01 Thread Jens Alfke
> On Mar 1, 2016, at 12:01 AM, Motti Shneor wrote: > > 1. Can launchd launch a code bundle? as a daemon? Launchd has no notion of bundles; those are a concept defined at higher levels. Launchd just knows about executable files. Also, are you sure you want a daemon and not an agent? Daemons ru

Re: Triggering UITableView's -didSelectRowAtIndexPath: delegate callback

2016-02-28 Thread Jens Alfke
>> On Feb 27, 2016, at 4:27 PM, Keary Suska > > >> wrote: >> >> This results in a much more reliable and extensible decoupling since no >> other object should know those internal signaling me

Re: NSURLErrorKey vs. NSURLErrorFailingURLErrorKey

2016-02-26 Thread Jens Alfke
> On Feb 26, 2016, at 4:48 PM, Quincey Morris > wrote: > > According to NSError documentation: Thanks, but I did read the documentation before asking. > On Feb 26, 2016, at 4:53 PM, dangerwillrobinsondan...@gmail.com wrote: > > It seems like the shorter one would be for a "click here to se

NSURLErrorKey vs. NSURLErrorFailingURLErrorKey

2016-02-26 Thread Jens Alfke
So, NSError.h declares NSURLErrorKey, as a userInfo key for the URL associated with the error. And NSURLError.h declares NSURLErrorFailingURLErrorKey, which appears to have the same purpose. Neither of these is deprecated, although there’s yet another constant (NSErrorFailingURLStringKey) that i

Re: Getting displayName out of font file

2016-02-26 Thread Jens Alfke
If this functionality exists it would probably be down in the CoreText framework. Take a look there. —Jens > On Feb 26, 2016, at 2:16 AM, Gerriet M. Denkmann wrote: > > I have a file “Some Font.ttf” and I want to know the displayName of this > font, which might be “Some-Font” or “Nice Font”

Re: ARC code in a non ARC app. iOS

2016-02-25 Thread Jens Alfke
> On Feb 25, 2016, at 8:35 AM, Dave wrote: > >>> Also, beware subclassing a Non-ARC Class in an ARC Project - you have to >>> have the subclass Non-ARC too. >> >> This is not true. For example, NSView is not ARC but you can write ARC >> subclasses of it. > > I didn’t say it was impossible, b

Re: Can an NSArray ever have a count of -1?

2016-02-19 Thread Jens Alfke
> On Feb 19, 2016, at 1:44 PM, Jean-Daniel Dupas wrote: > > Not exactly. %d is for 32 bit signed integer, Not exactly ;) %d is for “int”, whose size is unspecified. It does happen to be 32 bits on Apple platforms with current compilers. (I still remember the “fun” period of the early ‘90s whe

Re: Can an NSArray ever have a count of -1?

2016-02-19 Thread Jens Alfke
> On Feb 19, 2016, at 1:17 PM, Jim Adams wrote: > >SLogInfo(@"Starting csi %ld count %d", csi, sortedEvents.count); > > In the console I see: > INFO: Starting csi -1 count -1 > The very next line crashes when the sortedEvents are accessed. What could > cause the array to have a -1

Re: Swift bindings issue, Swift.Dictionary, NSMutableDictionary and NSObjectController

2016-02-14 Thread Jens Alfke
> On Feb 14, 2016, at 2:06 AM, Samuel Williams > wrote: > > 2/ Should I prefer NSMutableDictionary in the Swift code? It looks like you’ll need to use Foundation collection classes, for properties that you want to bind in this way. Remember, Swift’s native arrays and dictionaries aren’t toll

Re: Full-text indexing on iOS

2016-02-13 Thread Jens Alfke
> On Feb 12, 2016, at 8:04 PM, Britt Durbrow > wrote: > > I thought SQLIte had an extension to do this also (I’ve never played with it > myself, so YMMV)… I don’t know if the built in version has it enabled It does, and ironically our database used to use SQLite as its storage engine, so we

Re: How to write an RSS client for iOS

2016-02-13 Thread Jens Alfke
> On Feb 13, 2016, at 10:02 AM, nicholasacosta...@gmail.com wrote: > > > > hi, what would I need in order to write my own RSS reader for iOS? - NSURLSession to fetch feeds. - NSXMLParser to parse the feeds. (I was going to write "NSXMLDocument to parse the feeds”, but that class only exists o

Re: Full-text indexing on iOS

2016-02-12 Thread Jens Alfke
> On Feb 11, 2016, at 2:48 PM, Alex Zavatone wrote: > > Project from second link that claims iOS Full Text Search > https://github.com/Blue-Rocket/BRFullTextSearch > That’s an Obj-C wrapper around the open-source CLucene library. If possible I’

Full-text indexing on iOS

2016-02-11 Thread Jens Alfke
I’m looking into OS support for full-text indexing, for the database engine I work on. On Mac OS, there’s SearchKit, which does exactly what I want. iOS doesn’t have SearchKit for some reason, but it now has Core Spotlight, which lets me index data. The intended use seems to be for device-wide s

Re: Deleting an file that's been NSData memory mapped - safe?

2016-02-11 Thread Jens Alfke
> On Feb 11, 2016, at 11:44 AM, Dan Lau wrote: > > If a file has its contents mapped using NSData's > initWithContentsOfFile + NSDataReadingMappedIfSafe, > deleting it doesn't appear to affect reading it's mapped contents. Does > anyone know if NSData uses mmap(2) under the hood to ensure that t

Re: PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-10 Thread Jens Alfke
> On Feb 10, 2016, at 4:35 PM, Gary L. Wade > wrote: > > I just checked to see what happens when visiting your web site at > https://xenonium.com and found on the current latest > release of iOS and OS X under Safari I get a "Cannot Verify Server Identity" > alert, so

Revisiting that "(redraw)" NSView property behavior

2016-02-10 Thread Jens Alfke
A few weeks ago Graham was asking how to make instances of his NSView subclass redraw themselves automatically when their custom properties were changed. During the discussion he said something like “wouldn’t it be great if you could declare a property as “(redraw)” and then it would automatical

Re: PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-10 Thread Jens Alfke
> On Feb 10, 2016, at 12:17 PM, brodhage wrote: > > Why? Because any application accessing web content via the WebView framework > (Sparkle, Safari and many other apps) might allow to "launch special / > default behaviour" (for example "file://" or "ftp://"; or Safari which starts > iTunes if

Re: PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-09 Thread Jens Alfke
> On Feb 9, 2016, at 2:22 PM, Graham Cox wrote: > > Is it enough to change the SUFeedURL to https (if your server supports it, > which ours does), or does it also require the library to be updated? Using HTTPS for the appcast RSS feed should be sufficient, because it prevents an attacker from

PSA: Does your app use Sparkle? Update it, or use an HTTPS server

2016-02-09 Thread Jens Alfke
Ars Technica has an article today about a vulnerability in the Sparkle auto-update framework, which can allow an attacker to hijack an app update check to install malware on the user’s Mac: http://arstechnica.com/security/2016/02/huge-number-of-mac-apps-vulnerable-to-hijacking-and-a-fix-

Re: An API for Airplane mode on iOS?

2016-02-09 Thread Jens Alfke
> On Feb 9, 2016, at 10:38 AM, Alex Zavatone wrote: > > Simply put, if we can detect that this user is has turned off Airplane mode, > we can respond in a more cautious manner. But you can run into the same behaviors if the user has turned WiFi and/or cellular off and then back on. The Airpla

Re: An API for Airplane mode on iOS?

2016-02-09 Thread Jens Alfke
> On Feb 9, 2016, at 4:17 AM, Alex Zavatone wrote: > > I’ve created multiple tests using reachability and it would be REALLY EASY if > we could simply respond to changes in the Airplane Mode switch. This triggers changes in network interfaces that you can detect using the SystemConfiguration

Re: An API for Airplane mode on iOS?

2016-02-08 Thread Jens Alfke
> On Feb 8, 2016, at 9:45 PM, Glenn L. Austin wrote: > > According to the docs on Reachability (possibly lost in the mists of > time...), Reachability isn't really designed to tell you whether your net > access *will* succeed, but to give you reasons that your last access *failed.* It’s not t

Re: An API for Airplane mode on iOS?

2016-02-08 Thread Jens Alfke
> On Feb 8, 2016, at 1:55 PM, Alex Zavatone wrote: > > I'm using reachability classes to determine if we can reach our web services > IP and monitoring all reachability enums, but would be "really nice™" is if > there is a published API to read the position of the Airplane Mode setting. Do yo

Re: Just a quick verification on a bad access cause.

2016-02-08 Thread Jens Alfke
> On Feb 8, 2016, at 1:47 PM, Alex Zavatone wrote: > > if ( [myIVar respondsToSelector:@selector(someMethod)] { > EXC_BAD_ACCESS (code=1, address=0x143545358) > I did a po on myiVar and I get an address or 0x00014f05ee00 0x143545358 is probably the (bogus) class-info pointer it got from the

Re: Strange Analyser Warning/Error

2016-02-08 Thread Jens Alfke
> On Feb 8, 2016, at 8:09 AM, Steve Sisak wrote: > > The nil key pointer is a red herring. -[NSDictionary objectForKey:] can > return nil if the dictionary doesn’t contain a value for the key. > > The analyser is correctly flagging that the code doesn’t handle this case. No, it isn’t, because

Re: WebViews and the Java Plugin

2016-02-06 Thread Jens Alfke
___ 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.co

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Jens Alfke
> On Feb 5, 2016, at 9:00 AM, Dave wrote: > > self.pNetworkNodeChildArray = [[NSMutableArray alloc] initWithArray:myArray > copyItems:YES]; > > and that should be - copyItems:NO Or just myArray.mutableCopy … —Jens ___ Cocoa-dev mailing list (Cocoa

Re: mmap quiet failure - all reads are 0x00

2016-02-05 Thread Jens Alfke
> On Feb 5, 2016, at 10:09 AM, Trygve Inda wrote: > > It seems like no matter what is in the mmap file, when I read from it I get > 0x00 for every byte and no error or exception is generated. I can't > reproduce it as it is very random. Quitting and relaunching solves it. That sounds strange to

Re: WebViews and the Java Plugin

2016-02-05 Thread Jens Alfke
> On Feb 5, 2016, at 5:02 AM, Sandor Szatmari > wrote: > > Has anyone had any success running Java applets in a WebView? FYI, Java applets are being deprecated and developers are urged to stop using them: "With modern browser vendors working to restrict and reduce plugin support in their

Re: Archive/Unarchive Problem/Question?

2016-02-04 Thread Jens Alfke
> On Feb 4, 2016, at 12:10 PM, Dave wrote: > > I’m not sure how to get around this, is what I am doing supposed to work? I > mean, should backlinks get saved/restored correctly when you > archive/unarchive? Yes, they should. What happens if you experimentally change them to strong? Obviously

Re: Archive/Unarchive Problem/Question?

2016-02-04 Thread Jens Alfke
> On Feb 4, 2016, at 11:02 AM, Dave wrote: > > However, after I unarchive this object, the pNetworkParentNode property is > nil. Is this after the entire object graph has been unarchived, or is it inside your -initWithCoder: method? > I was wondering about copyWithZone, should I use copy fo

Re: Protocol extensions returning self

2016-02-04 Thread Jens Alfke
FYI, the swift-users list is a great place to ask questions about the Swift language (that don’t involve platform APIs.) Lots of expert users there, including Chris Lattner and other members of Apple’s Swift team. https://lists.swift.org/mailman/listinfo/swift-users

Re: [NSThread callStackSymbols] weirdness

2016-02-04 Thread Jens Alfke
> On Feb 3, 2016, at 11:28 PM, Trygve Inda wrote: > > why do I get to > see 3 method calls in my own app in the first example, but only the last call > in the second example? Tail-call optimization, probably. If the last thing a function does is call another function, the optimizer will chang

Re: creating draggable NSView

2016-02-03 Thread Jens Alfke
> On Feb 3, 2016, at 4:28 PM, Jeff Evans wrote: > > Does anyone have a clue as to why that frame would not alter after setFrame: > with a new value? Constraints, probably. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: App Transport Security exceptions App Store signed app

2016-01-27 Thread Jens Alfke
> On Jan 27, 2016, at 7:53 AM, Sixten Otto wrote: > > According the docs, it's also for the case where the connection needs to be > made over non-S HTTP: "With this key’s value set to YES >

Re: App Transport Security exceptions App Store signed app

2016-01-27 Thread Jens Alfke
> On Jan 27, 2016, at 7:32 AM, Trygve Inda wrote: > > It is basically a cost issue. It is expensive to set up SSL certificates on > 8 different servers... It would cost us about $700/yr Sounds like you’re being overcharged. SSL on hosted domains used to be pricey (partly due to the CPU overhea

Re: LGPL code in the Mac App Store?

2016-01-27 Thread Jens Alfke
> On Jan 26, 2016, at 11:48 PM, Quincey Morris > wrote: > > It would be the end of the App Store if it were possible to strip the code > signature out of a downloaded app and then just run it. Hm, I hadn’t thought of this in terms of cracking DRM. (Though of course, all forms of DRM have bee

Re: LGPL code in the Mac App Store?

2016-01-27 Thread Jens Alfke
> On Jan 26, 2016, at 10:59 PM, Pascal J. Bourguignon > wrote: > > Sorry, I thought the context was iOS (and therefore distribution thru the > AppStore). I still don’t see why you wouldn’t be able to submit an app to the store that contains LGPL code. For one thing, Apple’s reviewers have no

Re: App Transport Security exceptions App Store signed app

2016-01-26 Thread Jens Alfke
> On Jan 26, 2016, at 9:55 PM, Trygve Inda wrote: > > NSTemporaryExceptionAllowsInsecureHTTPLoads The “Temporary” in those names was only needed for the first iOS 9 beta. It might still be supported, but the official names do not have Temporary in them. See the official docs at https

Re: LGPL code in the Mac App Store?

2016-01-26 Thread Jens Alfke
> On Jan 26, 2016, at 1:17 PM, Britt Durbrow > wrote: > > I would consider a: packaging a version of the library in your resources; and > loading that if there is not one in the app’s Application Support folder Loading a library at runtime is somewhat awkward, because instead of being able t

Re: LGPL code in the Mac App Store?

2016-01-26 Thread Jens Alfke
> On Jan 26, 2016, at 1:06 PM, Pascal J. Bourguignon > wrote: > > I'm not sure it's allowed, you would have to check the App Store EULA and > license, and your Apple Developer Program agreement, etc. Why would Apple care one way or another about the license of the source code used to build y

Re: LGPL code in the Mac App Store?

2016-01-26 Thread Jens Alfke
> On Jan 26, 2016, at 1:06 PM, Pascal J. Bourguignon > wrote: > > You cannot use dynamically loaded libraries on iOS. (a) No. You can use dylibs/frameworks in iOS 8 or later. (b) But this is irrelevant since the OP is writing a *Mac OS* application. —Jens _

Re: Obj-C - your thoughts on hiding data members?

2016-01-26 Thread Jens Alfke
> On Jan 26, 2016, at 12:43 PM, Alex Zavatone wrote: > > Additionally, when creating an @property, the compiler does this > automatically, when it create the iVar, correct? Only if you have auto-synthesis turned on. (Which it is, by default, but I always turn it off because I think it’s a ver

Re: LGPL code in the Mac App Store?

2016-01-26 Thread Jens Alfke
> On Jan 26, 2016, at 11:23 AM, thatsanicehatyouh...@me.com wrote: > > I’m working on a program that I will be submitting to the Mac App Store that > uses LGPL code. I have recently learned that the license requires the > capability for the end user to create their own version of the LGPL libra

Re: Dodgy Code - Low Level Memory Management Question!

2016-01-26 Thread Jens Alfke
> On Jan 26, 2016, at 6:00 AM, Dave wrote: > > Sorry typeo in the pseudo code, it passes the object and it is retained…. Dave, if you want us to debug your code for you, then SHOW US THE ACTUAL #*$&% CODE! Don’t show us something else that _looks_ like real Obj-C but that you just typed into

Re: Obj-C - your thoughts on hiding data members?

2016-01-26 Thread Jens Alfke
> On Jan 26, 2016, at 6:32 AM, Alex Zavatone wrote: > > Since we're all computery and programmy and stuff, couldn't we put together a > little matrix of the type of variable and come up with several loose > standards? > The reason I ask this (am pressing on this) is that a large amount of what

Re: Dodgy Code - Low Level Memory Management Question!

2016-01-25 Thread Jens Alfke
> On Jan 25, 2016, at 10:48 AM, Dave wrote: > > if ( myCachedObject == nil); The trailing semicolon on that line above must be a typo. It’s going to cause the test to be ignored and the block below to always run. > { > self = myNewObject; > [LTWCacheManager addToCache: myID]

Re: The PID of an Application?

2016-01-25 Thread Jens Alfke
> On Jan 25, 2016, at 9:53 AM, Dave wrote: > > Is the PID of an Application 120% cast-iron guaranteed not to change during > the Application’s life span? Yes. The PID is what uniquely identifies a process during its lifespan. (Technically it’s possible for running code to see its PID change i

Re: delete stock apps

2016-01-24 Thread Jens Alfke
> On Jan 24, 2016, at 10:16 PM, Rick C. wrote: > > Does anyone know if there’s a way to delete stock apps on 10.11 without > disabling SIP and rebooting the machine? This doesn’t sound like a coding question. Try Apple’s support forums or apple.stackexchange.com . > Or, is there a way to di

Re: Obj-C - your thoughts on hiding data members?

2016-01-24 Thread Jens Alfke
I do; it makes the @interface shorter and easier to read, and afterwards if you change/add/remove an instance variable, it only touches the .m file, so it doesn’t force a bunch of other files to recompile. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@l

Re: How to save a Dictionary Network to a plist file?

2016-01-24 Thread Jens Alfke
> On Jan 24, 2016, at 7:12 AM, Dave wrote: > > And it would synthesize the initWithCoder, encodeWithCoder and copyWithZone > methods. It would be nice, but the compiler doesn’t always have enough information to do this: * Some instance variables are transient and shouldn’t be archived. * Som

Re: NSTextFields will not fully justify in 10.11

2016-01-23 Thread Jens Alfke
> On Jan 23, 2016, at 7:44 PM, Trygve Inda wrote: > > When running in 10.11, my fully justified text fields are no longer so... > They are left justified only. > > Is there a fix for this? Use an NSTextView instead? It’s generally better to use that class when the user might enter more than a

Re: How to record screen in iOS

2016-01-22 Thread Jens Alfke
> On Jan 21, 2016, at 6:45 PM, ico wrote: > > For the sandboxing reason, I know it possibly not to get it done. However, > what if there is some dark magic like private API The list moderators won’t allow discussion of private APIs on an Apple forum. You’ll be warned, and then banned. Honestl

Re: Using an anchor in NSURL file url

2016-01-22 Thread Jens Alfke
> On Jan 21, 2016, at 6:23 PM, Jeff Evans wrote: > > //The full url appears to have the anchor prepended, plus a couple of > dashes: > > #page3-- [pathtobook is here]/book/chapter1.html The .description property of a URL assembled with -relativeToURL is weird looking like that,

Re: How to save a Dictionary Network to a plist file?

2016-01-21 Thread Jens Alfke
> On Jan 21, 2016, at 4:36 PM, dangerwillrobinsondan...@gmail.com wrote: > > I'm surprised nobody has mentioned JSON. > You might later look at it. From the perspective of Dave’s question, JSON is the same thing as a plist except it doesn’t support NSData or NSDate. It’s not going to offer an

Re: 32-bit / 64-bit roadmap

2016-01-21 Thread Jens Alfke
> On Jan 21, 2016, at 1:57 PM, SevenBits wrote: > > Unrelated, but… are these the official code names? Yup, the road map got leaked last month. And 10.14 will be Rancho Cucamonga and 10.15 is Manteca*. —Jens * sure to be a big hit in Spanish-speaking countries! __

Re: Problem Archiving/Un-archiving Custom Objects

2016-01-21 Thread Jens Alfke
No, that’s weird, your code looks ok to me. Have you tried using the static analyzer? Or the address sanitizer? Or running with NSZombies? —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comm

Re: How to save a Dictionary Network to a plist file?

2016-01-21 Thread Jens Alfke
> On Jan 21, 2016, at 9:05 AM, Dave wrote: > > This all works great and now I’d like to save this to a plist file and load > it later on. Does it have to be in plist format? The easiest way to persist this data would be to make LTWNodeInfo implement the NSCoding protocol, then use an NSArchiv

Re:

2016-01-19 Thread Jens Alfke
> On Jan 19, 2016, at 10:11 AM, Aandi Inston wrote: > > Thank you. The problem turned out to be a foolish mistake in the caller, > but this has alerted me to the need for a systematic check of the > conversion between BOOL and C integers. The only thing likely to cause problems is if values oth

Re: Best Way to Hold Array of CFRefType’s

2016-01-18 Thread Jens Alfke
> On Jan 18, 2016, at 5:44 AM, Dave wrote: > > I have need to keep an Array of CFRefType’s stored in an Object. Um, why can’t you just put them in a CFArray or NSArray? —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Re: Looking at moving part of our iOS app become an iOS framework to be used in other apps.

2016-01-15 Thread Jens Alfke
> On Jan 15, 2016, at 1:31 PM, Alex Zavatone wrote: > > However, a good amount of app startup and config is triggered in the > appDelegate, same as push notification, opening the app via URLs and other > appDelegate related tasks would conflict with the appDelegate of the app > using the fram

Re: OT: Swift Code Autoformatter?

2016-01-15 Thread Jens Alfke
> On Jan 15, 2016, at 10:47 AM, Quincey Morris > wrote: > > — You have a utility that assists conversion from (say) Obj-C to Swift by > reformatting at least the easy things according to the destination language > syntax. This is the use case that the other Charles added to the discussion >

Re: Using CFHash to tell if a CFTypeRef has changed?

2016-01-11 Thread Jens Alfke
> On Jan 11, 2016, at 10:18 AM, Dave wrote: > > Any one have any other techniques for telling if a CFTypeRef has changed? No, in general there is no way. You’d have to make a copy of the object, keep that around, and then later call CFEqual on the current object and the copy … except that (a)

Re: Using CFHash to tell if a CFTypeRef has changed?

2016-01-11 Thread Jens Alfke
> On Jan 11, 2016, at 9:57 AM, Jens Alfke wrote: > > No. If the object has changed, its hash isn’t guaranteed to change; there > exist hash collisions where two different values have the same hash. (This is > inevitable since there are only 2^32 hash values, but a nearly infini

Re: Using CFHash to tell if a CFTypeRef has changed?

2016-01-11 Thread Jens Alfke
> On Jan 11, 2016, at 9:48 AM, Dave wrote: > > I have an object that is a wrapper around a CFTypeRef. I’d like to be able to > check if this object has changed, can I use the safely use the CFHash() > function to do this. No. If the object has changed, its hash isn’t guaranteed to change; th

Re: enum as String

2016-01-11 Thread Jens Alfke
> On Jan 11, 2016, at 7:37 AM, Eric E. Dolecki wrote: > > 1. How can I get rid of that .rawValue? It works but not coder-friendly. In Swift one usually uses a switch statement to match enums, rather than comparing rawValues. (There are a lot of examples in the book.) —Jens _

Re: Any way to Rename a File that is being Dragged before it's Dropped?

2016-01-09 Thread Jens Alfke
> On Jan 9, 2016, at 2:08 PM, robmar...@frontiernet.net wrote: > > Is there any way to cut out this ’staging’ folder? To somehow Drag a file > named: ‘0012345.m4a’ from the server (mounted via AFP) directly onto the > Desktop, or an app like Logic, and have it Dropped with a name like: ‘aaa bbb

Re: Obtaining a value from a hex representation

2016-01-08 Thread Jens Alfke
> On Jan 8, 2016, at 1:58 PM, Carl Hoefs wrote: > > A user enters the hexadecimal representation of a number like "0x31C8FD" into > a text field. The intValue of such strings is 0. Is there a Cocoa method > (like .hexValue) to convert the hex representation string into a value? -[NSScanner sc

Re: Strange app crash

2016-01-05 Thread Jens Alfke
> On Jan 1, 2016, at 6:54 PM, SevenBits wrote: > > Setting an exception breakpoint didn’t help; the app crashes anyway, leading > me to believe that the problem either a) is not an uncaught exception or b) > it is an exception, but occurs before the ObjC runtime is initialized. It’s not an ex

Re: Subclassing/Override question

2016-01-04 Thread Jens Alfke
> On Jan 4, 2016, at 8:24 AM, Dave wrote: > > myClassB = myClassA.propA;//Warning on this line saying > return type is not ClassB You have to declare the override in the subclass’s @interface, with the modified return type. Otherwise callers have no idea that your override

Re: Kernel Panics Developing for SpriteKit

2015-12-28 Thread Jens Alfke
> On Dec 28, 2015, at 11:02 AM, Charles Jenkins wrote: > > No sarcasm. Since the advent of Swift, it seems each version of Xcode has its > weak and unstable points, and I just supposed SpriteKit was one of them for > this version. Kernel panics have nothing to do with Xcode. They’re caused by

Re: Kernel Panics Developing for SpriteKit

2015-12-28 Thread Jens Alfke
> On Dec 28, 2015, at 6:23 AM, Charles Jenkins wrote: > > While less than ideal, I expect kernel panics when developing for SpriteKit > on the Mac are just the way things are these days, right? Nothing to really > worry about? Can’t quite tell if that’s sarcasm… Obviously kernel panics are se

Re: applicationSupportDirectory access for admin and standard users

2015-12-28 Thread Jens Alfke
> On Dec 28, 2015, at 12:50 AM, Uli Kusterer > wrote: > > And, in fact, when I check the NSFileManager.h header in the 10.11 SDK that > seems to be true: NSFileManager doesn't declare an > applicationSupportDirectory method, it seems. Looking at the compiler warnings would have helped too. :

Re: Any way to intercept the URL-opening mechanism on OS X?

2015-12-23 Thread Jens Alfke
> On Dec 23, 2015, at 12:36 AM, Rick Mann wrote: > > Hmm, didn't this change in iOS 9 and 10.11 to only work per-app? NSURLProtocol has _always_ been per-app. It’s not a system extension, it’s a way of hooking into NSURLConnection / NSURLSession in the current process. So it’s not going to he

Re: Best way to get a file path for presentation to the user

2015-12-19 Thread Jens Alfke
> On Dec 19, 2015, at 12:57 AM, Graham Cox wrote: > > Actually - heh, -displayNameAtPath: really strips it back to just the folder > name, with no path at all. That doesn’t tell the user *where* the folder is. > Unless they’re already familiar with the location it’s likely less helpful > than

Re: Best way to get a file path for presentation to the user

2015-12-18 Thread Jens Alfke
> On Dec 18, 2015, at 1:24 AM, Graham Cox wrote: > > I want to display a path to the user. I have a URL, I need to show the local > file path that represents (it’s always a local file path), where the > /Users// is replaced by ~/ The best methods for this are in NSFileManager: /* displayName

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Jens Alfke
> On Dec 16, 2015, at 9:10 PM, pscott wrote: > > Are you sure about that? Every linux or bsd system I ever ran into says in > the system(3) man page that /bin/sh is used Oops, you’re right. My bad. I still think no one should use it, though :) —Jens __

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Jens Alfke
> On Dec 16, 2015, at 3:23 PM, pscott wrote: > > I am pretty sure you can do that as one command without semicolons or export. > I.e, > > system("PYTHONPATH=/usr/bin/python PYTHONHOME=/usr/share/python/ > /path/to/script args"); Not all shells support that syntax. I know that tcsh didn’t (I

Re: Environment woes executing scripts from my OS X app

2015-12-16 Thread Jens Alfke
> On Dec 15, 2015, at 11:47 PM, Rick Mann wrote: > > the environment is different when launched via my app than when launched on > the command line. — When you launch a program from a terminal, it inherits the shell’s environment, which includes variables you’ve set in startup scripts like .

Re: iPad Pro apps given more memory?

2015-12-09 Thread Jens Alfke
> On Dec 9, 2015, at 5:17 PM, Rick Mann wrote: > > - By "virtual memory," I'm sure you don't mean it's swapping to disk (flash). > Or do you? If not, how is it virtual? All memory is virtual in any modern OS — the only thing that sees ‘real’ memory addresses is the kernel’s VM subsystem. ‘Vir

Re: iPad Pro apps given more memory?

2015-12-09 Thread Jens Alfke
> On Dec 9, 2015, at 16:24 , David Duncan > wrote: > > The virtual limit is 2GB on most devices right now, so you can use mmap() to > go beyond the dirty limit. Hm, I wasn’t aware that was limited. 2GB seems like a lot normally, but there are databases engines l

Re: iPad Pro apps given more memory?

2015-12-09 Thread Jens Alfke
> On Dec 9, 2015, at 2:56 PM, Rick Mann wrote: > > One of the WWDC videos stressed that iOS apps are given no more than 600 MB > of RAM. Our app is VERY RAM-intensive. Slightly off-topic, but I wonder if you could use mmap to give your app more address space? Create a big empty file, mmap it

Re: Best Control for Catching a Mouse Click?

2015-12-07 Thread Jens Alfke
> On Dec 7, 2015, at 8:32 AM, Dave wrote: > > If the User Clicks anywhere inside the base NSView, I’d like a Perform Click > IBAction to be sent to the connected class (The View Controller in this case). Make the base view a custom subclass of NSView, and override -hitTest: to return self. Th

Re: Overriding property attributes

2015-12-03 Thread Jens Alfke
AFAIK, ‘nonatomic’ is nothing more than a hint to the property synthesizer that it can create getter/setter methods that are faster but not thread-safe. That is, it only has effect inside the @implementation of the class, and no effect on callers. So it seems weird that you get a warning at all

Re: Best Control for a Matrix these days?

2015-12-03 Thread Jens Alfke
> On Dec 3, 2015, at 8:46 AM, Jonathan Mitchell wrote: > > I have found that an NSTableView can do the job with a bit of subclassed TLC. Or you can just make an NSView that adds a bunch of subviews in a grid. If your needs are simple this would be pretty easy to do. —Jens

Re: How to import a Framework

2015-12-01 Thread Jens Alfke
> On Dec 1, 2015, at 7:12 PM, Gerriet M. Denkmann wrote: > > “When you build an application or other executable, the compiler looks for > frameworks in/System/Library/Frameworks as well as any other location > specified to the compiler.” That hasn’t been true for a long time, at least since t

Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-12-01 Thread Jens Alfke
> On Dec 1, 2015, at 4:03 AM, Leonardo wrote: > > NSURLIsAliasFileKey returns YES even in case of SymLinks. > And I need to return YES only in case of Aliases. Then call lstat() to check if it’s a symlink. —Jens ___ Cocoa-dev mailing list (Cocoa-dev

Re: Design pattern for Painting applications, where to start

2015-11-30 Thread Jens Alfke
Have you looked at the (Mac OS) Sketch sample app? It’s object/vector based, not pixel based, but maybe the concepts will be useful to you. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator com

Re: Objective-C Question about Categories and Subclasses

2015-11-30 Thread Jens Alfke
> On Nov 30, 2015, at 5:18 AM, Dave wrote: > > I’m guessing it overrides it? Right? Right. A category method is a normal method. It just isn’t declared in the same @interface. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: [OT] Good XML Viewer App for Mac

2015-11-20 Thread Jens Alfke
> On Nov 20, 2015, at 5:20 AM, Dave wrote: > > Could anyone recommend an XML Viewer for Mac? I just need to open XML text > files are have it format the text sensibly. I’ve tried a couple from the Mac > App Store but I couldn’t get then to work properly and requested a refund….. TextMate (fre

Re: Assigning an element of a swift array to a userdata parameter triggers didSet

2015-11-18 Thread Jens Alfke
> On Nov 18, 2015, at 10:17 AM, Quincey Morris > wrote: > > If the array element (a dictionary, in your original post) is small enough, > you can pass a pointer to a copy of the element instead of a pointer to the > element. That is: > > var myElement = myArray[0] > view.addToolT

Re: Assigning an element of a swift array to a userdata parameter triggers didSet

2015-11-17 Thread Jens Alfke
I think the cause is “&(myArray[0])”. In Swift it isn't possible to get a pointer to an array item — these aren’t C arrays, their internal representation is opaque! So what I think happens is that it copies myArray[0] into a temporary and creates an UnsafeMutablePointer to that. Then, after the

Re: Identify image file count in directory

2015-11-14 Thread Jens Alfke
> On Nov 14, 2015, at 10:15 AM, Jonathan Taylor > wrote: > > Thanks for your reply. Do you know for sure that this should be significantly > faster, or were you just guessing? You didn't say which particular API you > had in mind, but some reading has led me to the fts APIs. These appear to b

Re: How are email apps written in iOS?

2015-11-10 Thread Jens Alfke
> On Nov 10, 2015, at 7:37 PM, Nicholas Acosta > wrote: > > Sent from my iPad hi, I have been wondering how to write a email app for iOS. > I have been searching the technologies in iOS and don't know what framework > to use. Would I use the message you I framework for this? Thank you. Messa

Re: Storing files into the Documents folder

2015-11-10 Thread Jens Alfke
> On Nov 10, 2015, at 1:54 PM, Samuel Williams > wrote: > > A while ago I seem to recall reading on Apple's documentation that > applications storing log files, save games, and other related data-files > automatically into ~/Documents/ was not recommended IMHO you shouldn’t hardcode writing an

Re: The joys of people using valueForKey to get objects out of a dictionary.

2015-11-10 Thread Jens Alfke
> On Nov 10, 2015, at 10:52 AM, Alex Zavatone wrote: > > Here's a great reason to use objectForKey: wherever possible instead of > valueForKey: - valueForKey: with an unknown key will throw > NSUnknownKeyException saying "this class is not key value coding-compliant > for the key ". Yes, but

Re: The joys of people using valueForKey to get objects out of a dictionary.

2015-11-10 Thread Jens Alfke
> On Nov 10, 2015, at 8:32 AM, Alex Zavatone wrote: > > Looking for reasons why I can explain "yeah, I know it works, but here's why > it's a terrible idea to use to access a dictionary's objects". I don’t know any reason why it would be bad, although I don’t typically use it. On a related no

Re: Instancetype and refactoring methods

2015-11-09 Thread Jens Alfke
> On Nov 9, 2015, at 10:58 AM, Alex Zavatone wrote: > > Before I give it a shot, is this a case where using instancetype to return > the instance of the object that holds the method a better choice than id? It sounds like your delegate API is using the old “informal protocol” mechanism where

Re: -clickedRow

2015-11-05 Thread Jens Alfke
> On Nov 5, 2015, at 12:35 PM, Raglan T. Tiger wrote: > > In -rightMouseDown I call [self clickedRow] which always returns -1 in a row > or not in row Yeah, you’re getting control before the base class has had a chance to set the clickedRow property. (Have you tried calling the superclass met

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