Re: Stupid objective-c question

2016-09-21 Thread Jens Alfke
> On Sep 21, 2016, at 4:44 PM, Gabriel Zachmann wrote: > > My question is: how can the compiler know that '==' in this case is a > NSString comparison? It doesn’t. In Obj-C, “==“ is always a pointer comparison even if it’s applied to objects. It is NOT the same as -isEqual:. This idiom with

Re: Stupid objective-c question

2016-09-21 Thread Jens Alfke
> On Sep 21, 2016, at 6:36 PM, Graham Cox wrote: > > Which is yet another reason why void* is such a shitty concept. Apple could > easily have insisted that parameter was id without any real > problems, so void*… sheesh. It’s not an object! It’s just an opaque ‘cookie’ that you can use to rec

Re: Stupid objective-c question

2016-09-21 Thread Jens Alfke
> On Sep 21, 2016, at 7:00 PM, Doug Hill wrote: > > As to the context type, I would be interested to know of cases where the > observer doesn't have control over the context. My understanding is that the > context is something that the observer sets itself when calling addObserver, > and it i

Re: Stupid objective-c question

2016-09-21 Thread Jens Alfke
> On Sep 21, 2016, at 9:19 PM, Jeff Evans wrote: > > Is it really true what Jens says, that [[NSArray alloc]init] always > returns the same pointer? > If that is the case, how can one declare two separate arrays? NSArray is immutable, so any two empty NSArrays are equal/identical.

Re: Stupid objective-c question

2016-09-21 Thread Jens Alfke
> On Sep 21, 2016, at 9:47 PM, Jeff Evans wrote: > > One would have to init it with objects to be useful at all, and then it > presumably would point to different data than another NSArray (even > nonmutable) inited with objects. Yup. Another fun fact is that the non-mutable classes all imple

Re: How to update UI from a background thread

2016-09-22 Thread Jens Alfke
> On Sep 22, 2016, at 5:20 AM, Dave wrote: > > So I’m wondering if it is something to do with the AppleScript handling? AFAIK, AppleScripts can only be run on the main thread. But it’s been many OS releases since I worked with them. Even if it’s legal to run them from a background thread now

Re: Maximum image size ?

2016-09-22 Thread Jens Alfke
> On Sep 22, 2016, at 10:03 AM, Gary L. Wade > wrote: > > If you are dealing with truly astronomical image data, consider that "trying > it yourself" may require multiple machines and/or multiple dedicated GPUs > similar like how you see those multi-monitor displays shown at conferences > an

Re: Stupid objective-c question

2016-09-22 Thread Jens Alfke
> On Sep 22, 2016, at 3:45 PM, Gabriel Zachmann wrote: > > I don't see why that should not be possible in Obj-C - I just would need a > mechanism to add tell the system the names / function pointers to be > registered as observers. That’s more like the way NSNotificationCenter works — you spe

Re: NSTextView read real text content (without 0xA added by wordwrap)

2016-09-27 Thread Jens Alfke
> On Sep 27, 2016, at 2:07 AM, Graham Cox wrote: > > Are you sure about that? I’ve never seen the text view add line endings to > the underlying raw text - that’s just not how text layout works. +1. I’ve been using NSTextView since 2001 and I know for a fact that it doesn’t insert meta-charac

Re: Lifecycle for custom NSURLProtocol properties

2016-09-27 Thread Jens Alfke
> On Sep 26, 2016, at 10:42 PM, Allan Odgaard > wrote: > > I am making use of NSURLProtocol’s `setProperty:forKey:inRequest:` but it > seems that my custom properties outlive the URL request, and even if I > explicitly call `removePropertyForKey:inRequest:` after my request is done, > it wou

Re: Multipeer between macOS Sierra and iOS 10

2016-10-01 Thread Jens Alfke
> On Sep 29, 2016, at 11:27 AM, Eric E. Dolecki wrote: > > Is this some kind of bug that needs corrected behind the scenes or are > these errors genuine and require me to worry about? It sounds like another case where someone at Apple left debug logging on. Either that or there’s something sub

Re: progress bar not updating

2016-10-06 Thread Jens Alfke
> On Oct 6, 2016, at 10:04 AM, J.E. Schotsman wrote: > > Its doubleValue is bound to the progress value of my ProgressController > class, so is “animating" and “indeterminate". > ... > The progress value and other values are changed on a background thread. That means that KVO is going to call

Re: progress bar not updating

2016-10-06 Thread Jens Alfke
> On Oct 6, 2016, at 11:36 AM, J.E. Schotsman wrote: > > CoreAnimation: warning, deleted thread with uncommitted CATransaction; set > CA_DEBUG_TRANSACTIONS=1 in environment to log backtraces. Definitely looks like a threading problem — the view tried to use CA on the background thread, but th

Re: Logging in macOS 12

2016-10-07 Thread Jens Alfke
> On Oct 7, 2016, at 7:56 AM, Gerriet M. Denkmann wrote: > > Some app with NSLog (not running in Xcode) does not show anything in > Console.app. > Only when Iog in as administrator I can see the NSLog lines. Huh, you’re right… The Console app’s help has a link to developer docs on logging[1],

Re: How to count Atoms

2016-10-07 Thread Jens Alfke
> On Oct 7, 2016, at 1:14 AM, Quincey Morris > wrote: > > One straightforward way is to use dispatch_semaphore. IIRC it’s lightweight > unless it blocks (that is, unless its count is zero when you wait), so it’s > good for this situation where actual contention is rare (assuming actual > con

Re: Help - Epic Browser SPDY Encrypted Proxy Failing in Sierra

2016-10-08 Thread Jens Alfke
> On Oct 7, 2016, at 2:25 PM, a...@hiddenreflex.com wrote: > > For some mysterious reason our SPDY encrypted proxy fails in our chromium > based browser only in Mac OS X Sierra. It works fine in every other > operating system. We're getting a "CERTIFICATE_INVALID_ERROR" even though > our certifi

Re: Directory enumeration gives wrong file type for aliases

2016-10-08 Thread Jens Alfke
> On Oct 7, 2016, at 5:03 PM, Gabriel Zachmann wrote: > > One thing that surprised me a little, in light of the fact that aliases are > completely different from symlinks, > is that > [url getResourceValue: &isAlias forKey: NSURLIsAliasFileKey error: nil] > yields true for both aliases and s

Re: progress bar not updating

2016-10-08 Thread Jens Alfke
> On Oct 7, 2016, at 6:51 PM, Quincey Morris > wrote: > > Looking at the documentation a bit more carefully, though, I think it’s > implicit. Each thread, it says, can have a “current” NSProgress object, but > there can be parent-child relationships between NSProgress objects across > thread

Re: How to count Atoms

2016-10-08 Thread Jens Alfke
> On Oct 7, 2016, at 10:05 AM, Quincey Morris > wrote: > > Surely “anyone reading the code” is going to recognize “dispatch_semaphore” > as something to do with a semaphore, including people from other platforms? You’re right; I was [mis]remembering a classic semaphore as being a simple mute

Re: Font alignment when using bold variant of system font

2016-10-12 Thread Jens Alfke
It looks as though the bold style of the font has a higher cap height, which causes the text view to move the baseline farther down to make room. I’ve seen occasional glitches like this in fonts. (What font are you using?) You might be able to work around this by setting a custom NSParagraphStyl

Re: NSTextView tab stop count

2016-10-14 Thread Jens Alfke
> On Oct 14, 2016, at 6:43 AM, tridiak wrote: > > How does Xcode & Text Wrangler pull it off? Xcode pretty heavily customizes the Cocoa text engine; even back in the ProjectBuilder days they had a bunch of custom editing subclasses. I wouldn’t be surprised if they implement their own tabbing

Re: Optimization Level

2016-10-17 Thread Jens Alfke
> On Oct 17, 2016, at 11:35 AM, Raglan T. Tiger wrote: > > void x::Clear(apointList &list) > { >if ( ! &list ) >return; > } It’s not valid for a C++ reference value to refer to null. So the optimizer is allowed to assume that `&list` is a non-null pointer, and the test in the `

Re: iOS: Preventing a singleton from being deallocated when the app is in the background.

2016-10-19 Thread Jens Alfke
> On Oct 19, 2016, at 11:41 AM, Alex Zavatone wrote: > > I have seen on discussion where people suggest keeping a private strong > property in the singleton with a reference to self to prevent this from > happening. Bad idea: it relies on the implementation detail that the runtime can’t detec

Re: iOS: Preventing a singleton from being deallocated when the app is in the background.

2016-10-19 Thread Jens Alfke
> On Oct 19, 2016, at 12:54 PM, Alex Zavatone wrote: > > Is there anything wrong with what I'm doing? Looks fine to me. Is any of this code using manual ref-counting? If so, I’d suspect an over-release. > should I be using [GeofenceControllerSingleton alloc] init] instead of [[self > alloc

Re: iOS: Preventing a singleton from being deallocated when the app is in the background.

2016-10-19 Thread Jens Alfke
> On Oct 19, 2016, at 1:23 PM, Steve Mills wrote: > > Pardon my obvious question, but this isn't a matter of your app napping while > in the background, is it? Or something like that? Why would that cause a singleton to be dealloced? The app just stops getting CPU time for a while. —Jens ___

Re: iOS: Preventing a singleton from being deallocated when the app is in the background.

2016-10-19 Thread Jens Alfke
> On Oct 19, 2016, at 2:04 PM, Doug Hill wrote: > > Presumably if the app is terminated due to inactivity everything would be > dealloc'd including singletons. No idea if that is happening or not in this > case though. No, nothing would be dealloced. The whole process would just be killed, an

Re: iOS: Preventing a singleton from being deallocated when the app is in the background.

2016-10-19 Thread Jens Alfke
> On Oct 19, 2016, at 2:14 PM, Jens Alfke wrote: > > No, nothing would be dealloced. The whole process would just be killed Sorry, I misspoke — I got it mixed up with termination for using too much memory. If the app gets quit in the background it does get notified that it’s quit

Re: iOS: Preventing a singleton from being deallocated when the app is in the background.

2016-10-19 Thread Jens Alfke
> On Oct 19, 2016, at 8:41 PM, Alex Zavatone wrote: > > Yet we are seeing log output indicating the init method getting executed > twice. Set a breakpoint on it? Or add a counter to the init method so it crashes on the second call, so you get a crash log with a backtrace? —Jens ___

Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/

2016-10-22 Thread Jens Alfke
Smells like an OS bug, or a bug in the ObjC-to-Swift bindings. Try to build a minimal test to reproduce it, i.e. narrow down which of the URLResourceKeys triggers the crash, and which specific file being returned by the enumerator. Then see what if anything is unusual about that file. Then proba

Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/

2016-10-22 Thread Jens Alfke
> On Oct 22, 2016, at 11:42 AM, Jean Suisse wrote: > > To add a little more information: it happens when encountering any directory > that the user can’t read. > My app should get an access denied error (the enumerator should be nil for > instance). It shouldn’t crash. Try writing the same co

Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/

2016-10-22 Thread Jens Alfke
> On Oct 22, 2016, at 12:11 PM, Jean Suisse wrote: > > To refine, what difference is there between ObjC’s > for (NSURL* file in enumerator) > and swift’s > while let file = enumerator?.nextObject() as? URL That’s irrelevant. Look at the backtrace of the crash — the problem has to d

Re: EXC_BAD_INSTRUCTION when enumerating /.DocumentRevisions-V100/

2016-10-22 Thread Jens Alfke
> On Oct 22, 2016, at 2:21 PM, Jean Suisse wrote: > > I don’t know if it’s so irrelevant, because in the backtrace the swift code > calls -[NSURLDirectoryEnumerator nextObject]. Maybe the ObjC code doesn’t. > Hence my question. Obj-C for…in loops use NSFastEnumeration, which is equivalent to

Re: initWithRequest:delegate:startImmediately

2016-10-24 Thread Jens Alfke
> On Oct 24, 2016, at 5:47 PM, Sal Conigliaro wrote: > > Check out the WWDC videos on what's new in app security. In a nutshell you > need to specify (in the imno.plist) the specific domains that you want to > turn off ATS. Even that is just a stopgap. The real solution is to use HTTPS. If t

Re: CoreData headaches

2016-10-28 Thread Jens Alfke
> On Oct 27, 2016, at 8:49 PM, Dave Fernandes > wrote: > > But what managed object are you dealing with? Is the Asset a managed object? > If so, you can only access its properties from the queue of its managed > object context. So if it is a main queue context, you can only access the > MO’s

Re: CoreData headaches

2016-10-28 Thread Jens Alfke
> On Oct 28, 2016, at 1:20 PM, Steve Mills wrote: > > No, I'm sure I *would* do something like that. :) To me, the CoreData docs > are just a pile of confusion with no human explanation that I can understand. Well, the general rule in a nutshell is that you should only use a CoreData object o

Re: Crash in addSubview: when compiled with SDK > 10.9

2016-11-02 Thread Jens Alfke
Have you run with Zombies enabled? Or with the address sanitizer? —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.appl

Re: How to ResolvingSymlinksInPath ?

2016-11-03 Thread Jens Alfke
The docs for -stringByResolvingSymlinksInPath say that “for absolute paths, all symbolic links are guaranteed to be removed.” If it doesn’t actually do that, then there's either a bug in the implementation or a bug in the docs; either way, you should file a Radar. (I’m not sure why you need to

Re: Programmatically Clear Dirty NSDocument

2016-11-07 Thread Jens Alfke
> On Nov 7, 2016, at 10:46 AM, Richard Charles wrote: > >[doc performSelector:@selector(updateChangeCount:) > withObject:@(NSChangeUndone) > afterDelay:0]; That one definitely won’t work. The parameter to updateChangeCount: is an integer (enum) value, not an objec

Re: Programmatically Clear Dirty NSDocument

2016-11-07 Thread Jens Alfke
Why not just call [doc revertToContentsOfURL:[doc url] ofType:[doc fileType] error:&error], which is what the docs for -revertDocumentToSaved: say it does after the user confirmation? —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Pleas

iOS apps losing filesystem access when launched in background

2016-11-18 Thread Jens Alfke
Since iOS 10 shipped we’ve been getting some bug reports from developers using our framework, that indicate that we’re unable to access files. (The errors are from SQLite, but they imply that SQLite can’t open or access the database file.) It seems that the OS’s behavior has changed; maybe it’s

Re: iOS apps losing filesystem access when launched in background

2016-11-18 Thread Jens Alfke
> On Nov 18, 2016, at 4:57 PM, Alex Zavatone wrote: > > You're not using the NSFileSystemProtectionComplete entltlement by any > chance, are you? These aren’t my apps, they’re 3rd party apps using my framework, so the entitlements they use are up to them. Which entitlement are you talking abo

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-01 Thread Jens Alfke
> On Dec 1, 2016, at 7:58 AM, Andreas Falkenhahn wrote: > > My app supports external plugins. On macOS, Linux, and Windows those plugins > are just shared objects/dylibs (or DLLs) loaded via dlopen() (or LoadLibrary() > on Windows) at runtime. Does iOS still not support dlopen? I thought that,

Re: Accessing the bundle of the call-site

2016-12-01 Thread Jens Alfke
Introspecting the call stack is possible, if somewhat ugly, using the backtrace and backtrace_symbols functions (on macOS/iOS.) But all you get is a list of PC and stack addresses, or function names. I don’t know how you’d go from those to an NSBundle object. On cursory inspection I didn’t see a

Re: Accessing the bundle of the call-site

2016-12-02 Thread Jens Alfke
> On Dec 1, 2016, at 10:21 PM, Rick Aurbach wrote: > > Thank you for confirming my suspicions. I know that Bundle won’t help. What I > was hoping for was a Swift runtime call that returned the current module name. Something equivalent to [NSBundle bundleForClass: [self class]]? I don’t think

Re: Drag and drop on table view

2016-12-02 Thread Jens Alfke
> On Dec 2, 2016, at 5:36 AM, J.E. Schotsman wrote: > > I am still not sure if I am doing this the right way (extending NSTableView) > because Xcode says "Subclassing NSTableView is usually not necessary”. NSTableView has a whole set of delegate calls for implementing drag & drop; you should

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Jens Alfke
> On Dec 2, 2016, at 6:37 AM, Andreas Falkenhahn wrote: > > So how does that work in practice? Should I create a Cocoa Touch Framework, > code sign > it, include it in the "Embedded binaries" section in Xcode in my project and > select > "Optional" for that framework in the "Linked frameworks

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Jens Alfke
> On Dec 2, 2016, at 2:17 PM, Andreas Falkenhahn wrote: > > Well, just because apps that use undocumented features aren't rejected from > the > app store doesn't make it official for me. dlopen is hardly undocumented; it’s part of the core BSD Unix library. It’s got a man page and everything.

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-04 Thread Jens Alfke
> On Dec 4, 2016, at 12:41 PM, Andreas Falkenhahn > wrote: > > However, it seems like *all* symbols are exported to the dylib > inside the Cocoa Touch Framework. How can I configure Xcode to > export only certain symbols? I want to name the symbols that > should be exported explicitly. Use a “

Re: Large "Data" support

2016-12-05 Thread Jens Alfke
> On Dec 5, 2016, at 4:12 PM, Daryle Walker wrote: > > For the Swift 3 "Data" type, if I want to represent a multi-gigabyte file, it > won't try to do it all in memory, would it? The Data type specifically represents in-memory data, so yeah, it would. (Where by “memory” I mean “address spac

Re: Representing an object graph

2016-12-05 Thread Jens Alfke
> On Dec 5, 2016, at 4:18 PM, Daryle Walker wrote: > > I've heard that Core Data is a object graph and persistence library. What if > you want just the first part? You can use the XML-based store instead of SQLite, and just not bother to write the XML anywhere… —Jens __

Re: Large "Data" support

2016-12-06 Thread Jens Alfke
> On Dec 6, 2016, at 12:32 AM, Alastair Houghton > wrote: > > 1. If you mmap() data, you don’t actually have to read all of it; it’s read > from disk on demand. I was assuming Daryle wanted to create the Data from scratch, not read it from a file. If the data is read from a file, then I agre

Re: Documentation Workflow

2016-12-06 Thread Jens Alfke
> On Dec 6, 2016, at 3:45 PM, Carl Hoefs wrote: > > Just now I was looking for a list of NSString method signatures to peruse. Open NSString.h? —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moder

Re: Elementary NSUserDefaults Question

2016-12-07 Thread Jens Alfke
> On Dec 7, 2016, at 11:33 AM, Sean McBride wrote: > > I'm not sure I follow. I don't know hardly anything about audio playback, > but converting between bookmarks/paths/URLs is pretty trivial as they all are > basically different representations of the same concept. IIRC, in iOS you can get

Re: NSOpenPanel stopped working in some apps on Sierra

2016-12-07 Thread Jens Alfke
> On Dec 7, 2016, at 3:16 PM, Leo wrote: > > Any attempt to call it with runModal results with the following errors: > >[General] *** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for > empty array >[General] (null) What’s the backtrace? Chances are there’s something messed up

Re: NSTouchBar in Carbon

2016-12-12 Thread Jens Alfke
I haven’t used NSTouchBar at all yet, but from the API in the header file, it looks like you can instantiate one with -init, configure it, and then assign it to the touchBar property of the NSApplication instance. (I'm assuming that even a Carbon-based app process has an NSApplication these day

Re: Requires High Performance Graphic Card - Why?

2016-12-16 Thread Jens Alfke
> On Dec 15, 2016, at 11:19 PM, Alastair Houghton > wrote: > > This is one of those things that you just need to know. You need to add the > key NSSupportsAutomaticGraphicsSwitching to your app’s Info.plist; see > > https://developer.apple.com/library/content/qa/qa1734/_index.html >

Re: Requires High Performance Graphic Card - Why?

2016-12-16 Thread Jens Alfke
… and by total coincidence, I just received the iOS Dev Weekly newsletter, which links to a blog post written a few days ago describing this in great detail: http://supermegaultragroovy.com//2016/12/10/auto-graphics-switching

Re: AVFoundation and the main thread

2016-12-20 Thread Jens Alfke
I’ll also argue that if you’re needing to do this kind of thing from a background thread, your code isn’t factored properly. Managing the UI of the app is far too complex a task to try to coordinate among multiple threads. The current best practices for concurrent programming suggest that you s

Re: What should we do if file-opening takes a long time?

2016-12-31 Thread Jens Alfke
> On Dec 31, 2016, at 12:52 AM, Daryle Walker wrote: > > Let’s assume we’re using a NSDocument-based application. If we’re opening a > big file, like a gigabyte or more, does the system code automatically show a > progress bar dialog? Or does the user look at a whole bunch of nothing (i.e.

Re: Cocoa-dev Digest, Vol 14, Issue 7

2017-01-04 Thread Jens Alfke
> On Jan 4, 2017, at 2:42 PM, Lorenzo Thurman wrote: > > What you have to do is when you get the didselect notification in the one > table, you need to unselect from the other table. There are a couple of small > issues with this still, and you lose the selection in the first table, if > that

Re: How does chromium simulate keyboard events using CGEventPost in pre login agent?

2017-01-05 Thread Jens Alfke
I am not an admin, but… This is not a question about Cocoa APIs, so it seems off-topic on this list. Also, the type of code you’re asking about can equally well be used for malware, so I’m really uncomfortable with discussing it. (I wasn’t aware that there is a way to get control of event handl

Re: How does chromium simulate keyboard events using CGEventPost in pre login agent?

2017-01-05 Thread Jens Alfke
> On Jan 5, 2017, at 10:58 AM, Sai Prasanna wrote: > > If coregraphics API are not meant for this mailing list please point me to > the correct list. I don’t know what the right list is because I don’t use those APIs, but the complete list of lists is at https://lists.apple.com/mailm

Weird NSPredicate structure when using "first" in keypath

2017-01-09 Thread Jens Alfke
I’m writing code that walks through an NSPredicate and generates an alternate form of query from it (similar to what CoreData and Realm do.) I’m seeing some very weird undocumented behavior when format strings are compiled into NSPredicates, if the format string includes a key-path with a prope

Re: Weird NSPredicate structure when using "first" in keypath

2017-01-09 Thread Jens Alfke
> On Jan 9, 2017, at 6:38 PM, Aaron Tuller wrote: > > Try doing > name.#first > as FIRST and LAST are reserved words and need escaping: Thanks for the answer. Unfortunately this is a library that will allow developers to provide their own predicate strings, and I can imagine this causing conf

Re: On NSIncrementalStore UUID Uniqueness

2017-01-11 Thread Jens Alfke
> On Jan 10, 2017, at 2:00 PM, Jean-Daniel wrote: > > UUID means Universally unique identifier and it must be unique: > https://en.wikipedia.org/wiki/UUID > > > To generate an UUID, u

Re: NSNetServiceBrowser vs. mDNSResponder

2017-01-13 Thread Jens Alfke
> On Jan 13, 2017, at 1:40 AM, Gerriet M. Denkmann wrote: > > SERVICE_TYPE = 1 to 63 ascii chars; no spaces; no ‘.’; no ‘[‘; can use ‘_' > or '-'; case insensitive > Note: I did not find these rules documented anywhere, they are just the > result of trial and error. These are DNS names, so I

Re: Seeing nil passed to isEqual:, despite non-null declaration

2017-01-13 Thread Jens Alfke
> On Jan 13, 2017, at 9:46 AM, Sean McBride wrote: > > Anyone ever seen nil passed to isEqual:? Is the SDK declaration maybe wrong? Check the class documentation, not just the header. The parameter is declared as: anObjectThe object to be compared to the receiver. May be nil,

Re: Seeing nil passed to isEqual:, despite non-null declaration

2017-01-13 Thread Jens Alfke
> On Jan 13, 2017, at 10:43 AM, Ben Kennedy wrote: > > NSObject.h (from which Sean was quoting) begins with NS_ASSUME_NONNULL_BEGIN > which, to my understanding, makes everything in the file be non-nullable > unless otherwise annotated. You’re looking at . But the -isEqual: method is actually

Re: On NSIncrementalStore UUID Uniqueness

2017-01-14 Thread Jens Alfke
> On Jan 14, 2017, at 2:41 AM, Daryle Walker wrote: > > I’m seemingly stuck since the data format doesn’t have a UUID field within > it and I can’t base a UUID off of a hash of the file since it would change > after each edit. There’s really no way to store any custom metadata in the file? I

Re: Weird NSPredicate structure when using "first" in keypath

2017-01-18 Thread Jens Alfke
> On Jan 17, 2017, at 7:18 PM, Chris Hanson wrote: > > Then if your users want to use a predicate string (rather than an > NSPredicateEditor or other form of direct instantiation) they still trivially > can, but it's on them to get the syntax correct rather than on you to try to > figure out

Re: Swift: Draw a circle with tic marks at it's edge?

2017-01-18 Thread Jens Alfke
I’m not sure what you’re asking. This is just a circle and a couple of lines, with some basic trig to compute the endpoints of the lines. Are you asking how to use the CG graphics APIs? —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Ple

Re: Rotary knob with table-like momentum

2017-01-23 Thread Jens Alfke
> On Jan 22, 2017, at 6:27 PM, Eric Dolecki wrote: > > Does anyone have a control (knob) that you can turn with a horizontal swipe, > but snaps to detents. Check on https://www.cocoacontrols.com … they have links to thousands of iOS (and macOS) open-source con

iOS app groups sharing SQLite databases, notifications

2017-01-23 Thread Jens Alfke
I’m looking into the feasibility of sharing a SQLite database between multiple iOS apps by the same developer, using an “app group”. The app group entitlement grants a shared directory where the database file can be stored, but SQLite also relies on file locking and shared memory (via a mapped

Re: Math question

2017-01-24 Thread Jens Alfke
> On Jan 24, 2017, at 10:45 AM, Eric E. Dolecki wrote: > > So I am looking for a number between 100 and 200 which ends up being > between 1.0 and 3.0. Are you talking about linear interpolation? That would be Set up the constants, as given in your email: let dist0 = 100, dist1 = 200

Re: Math question

2017-01-24 Thread Jens Alfke
> On Jan 24, 2017, at 11:36 AM, Eric E. Dolecki wrote: > > Never mind on that one. with a 0-100, it's super simple. But if it's 0 - 15 > that could be quite different. I'll noodle on that. The formula I gave is general purpose for mapping any input range to any output range. —Jens _

Re: PDF to Word ( docx) Conversion

2017-01-24 Thread Jens Alfke
> On Jan 24, 2017, at 11:54 AM, Peter Hudson wrote: > > But the bottom line is, I think, to get a Word doc that really behaves like a > Word doc ( in word ) I need to export straight to docx format. Have you tried exporting to RTF? It’s a simple text-based markup format, and imports well into

Re: PDF to Word ( docx) Conversion

2017-01-24 Thread Jens Alfke
> On Jan 24, 2017, at 12:58 PM, Peter Hudson wrote: > > I wondered about RTF - but I've built everything into a view and I can't see > a method on NSView to produce rtf. > I've done it previously with, I think, an NSText. I meant producing it programmatically. It’s a markup language, around

Predicate syntax for a conditional expression?

2017-02-06 Thread Jens Alfke
[Re-sending now that the lists are back up] Conditional NSExpressions (NSConditionalExpressionType) were added in 2015, but Apple’s predicate format syntax document* hasn’t been updated, so I can’t find any description of what the syntax is for them in a predicate string. By reverse-engineering

Re: Xcode Framework wrapper for Library ( Exposing library headers)

2017-02-06 Thread Jens Alfke
> On Feb 6, 2017, at 2:04 PM, Mr steve davis > wrote: > > Undefined symbols for architecture x86_64: > "_OBJC_CLASS_$_MyLibrary", referenced from: > objc-class-ref in ViewController.o > ld: symbol(s) not found for architecture x86_64 This is a link error, not a compile error, so it has n

Re: Xcode Framework wrapper for Library ( Exposing library headers)

2017-02-06 Thread Jens Alfke
> On Feb 6, 2017, at 2:46 PM, Mr steve davis > wrote: > > Thanks for the reply. However, it all seems to be in place. > > MyProject->'Ljnk Binary with Libraries’ = MyFramework > MyFramework->'Ljnk Binary with Libraries’ = libMyLibrary.a Ah — I think you are running into a linker ‘feature’ whe

Re: Use WKSessionFile as Data for AVAudioPlayer?

2017-02-07 Thread Jens Alfke
> On Feb 7, 2017, at 6:49 PM, Eric E. Dolecki wrote: > > Now, I want to instantiate an AVAudioPlayer and play that sent file. I know > that it's received (didFinish file transfer fires in the Watch Extension). > How do I do that? I don't know how to make that file Data. Can’t you just create th

Re: Mobile Cross Platform Solutions

2017-02-08 Thread Jens Alfke
> On Feb 8, 2017, at 3:34 AM, Dave wrote: > > I’ve been asked to look at doing a Mobile App for a museum, basically the App > needs to show info (text, pictures and movies) for each exhibit. I’m > wondering the best way to make it work for iOS, Android and Windows Phone > (maybe). The content

Re: Use WKSessionFile as Data for AVAudioPlayer?

2017-02-08 Thread Jens Alfke
> On Feb 8, 2017, at 5:48 AM, Eric E. Dolecki wrote: > > try self.player = AVAudioPlayer(contentsOf: file.fileURL!) Why are you trying to load it into memory? You want to avoid that if possible with media data. Just initialize AVAudioPlayer with the URL itself and let it strea

Re: What generates NSURLErrorUnsupportedURL?

2017-02-08 Thread Jens Alfke
> On Feb 8, 2017, at 10:38 AM, Steve Christensen wrote: > > The time between when the request is made and when it completes with an error > might be a minute or so, so the framework is immediately bailing on the > request. I'm wondering what part of the process generates the error. Does the >

Re: Intercept Save when closing NSDocument

2017-02-10 Thread Jens Alfke
> On Feb 10, 2017, at 9:19 AM, Keary Suska wrote: > > I would start by overriding -saveDocument: and -saveDocumentAs: in your > NSDocument subclass with a breakpoint so I can see what is being done. Even easier: wait for the save dialog to appear, then hit the Pause button in the debugger and

Re: Are instances of a NSManagedObject subclass usable as regular objects?

2017-02-14 Thread Jens Alfke
> On Feb 14, 2017, at 3:16 PM, Daryle Walker wrote: > > How do I give managed objects enough permanence to be used with systems > expecting normal objects? Managed objects are regular NSObjects and are ref-counted the same way. To keep one around, just use a regular strong reference. —Jens _

Re: Swift Threads

2014-08-23 Thread Jens Alfke
> On Aug 23, 2014, at 12:46 AM, Gerriet M. Denkmann > wrote: > Works fine and is twice as fast. That approach is a bit naive, as it's going to spawn a huge number of dispatch queues (something like O(n) of them, I think.) Also, once the array sizes start getting smaller than a cache line the

Re: iOS database within sandbox

2014-08-23 Thread Jens Alfke
> On Aug 23, 2014, at 9:57 AM, Carl Hoefs > wrote: > > However, specifically on iOS, I take it that SQLite is the *only* database > available It's the only one built into the OS with a public API. But there are a lot of options if you're willing to build and link in your own database — Tokyo

Re: Swift Threads

2014-08-23 Thread Jens Alfke
> On Aug 23, 2014, at 11:23 AM, Jens Alfke wrote: > > it's going to spawn a huge number of dispatch queues (something like O(n) of > them, I think.) Oops, I meant 'dispatched blocks'. Which still have overhead because the block contexts

Re: Crash from NSURLConnection if delegate released too soon?

2014-08-25 Thread Jens Alfke
> On Aug 25, 2014, at 9:40 AM, Howard Moon wrote: > > Ok, I fixed it. I was using the connection object as a member of my class, > and releasing that, when I should have been releasing the connection that is > given to me inside didFailWithError and connectionDidFinishLoading, not > making it

Re: iOS database within sandbox

2014-08-25 Thread Jens Alfke
> On Aug 25, 2014, at 1:21 PM, Tim Anglade wrote: > > We did publicly commit to open-sourcing the core under the Apache 2.0 > license [1]. I had not seen that FAQ when I did my initial evaluation of Realm about a month ago. Thanks for pointing it out, and I'm glad to hear you'll be opening the

Re: Crash from NSURLConnection if delegate released too soon?

2014-08-25 Thread Jens Alfke
> On Aug 25, 2014, at 1:43 PM, Howard Moon wrote: > > The Apple docs show simply setting the connection and receivedData to nil, > instead of calling release on them. Do you have a strong [sic] reason to be using manual retain/release? If not, I'd _really_ recommend switching to ARC, at leas

Re: Extending KVO to scalar struct types?

2014-08-28 Thread Jens Alfke
> On Aug 28, 2014, at 8:25 PM, Graham Cox wrote: > > The problem here is being able to get to the struct's field at runtime given > its name as a string. Is that even possible? Not in C. The closest you can get is the @encode(…) directive, which at compile-time evaluates to the type-encoding

Re: Power Nap/wakeup

2014-09-01 Thread Jens Alfke
> On Sep 1, 2014, at 4:46 PM, Jerry Krinock wrote: > > Register an observer of NSWorkspaceWillSleepNotification. This will fire immediately _before_ the system sleeps, not _during_ sleep. (And if your handler doesn't return quickly enough, it'll prevent the OS from going to sleep.) —Jens ___

Best practice for creating a temporary file

2014-09-02 Thread Jens Alfke
I'm downloading data that will eventually be saved as a file in a specific directory. During the download I write the data to a temporary file since it can be arbitrarily large; then on completion I move the temporary file to its final location. So I need to locate a temporary-files directory th

Re: Best practice for creating a temporary file

2014-09-02 Thread Jens Alfke
> On Sep 2, 2014, at 10:45 AM, Kyle Sluder wrote: > > .TemporaryItems doesn't get cleaned up automatically AFAIK, so I don't > think you'll gain anything by trying to use it. On my system right now there's nothing in it older than 2 days or so, so I suspect it does get cleaned up (at least on

Re: Best practice for creating a temporary file

2014-09-02 Thread Jens Alfke
> On Sep 2, 2014, at 4:05 PM, Quincey Morris > wrote: > > I get a URL to a new folder in the private (secure) temporary directory, and > *not* in the parent of ‘importURL’. I don’t know why you’re seeing something > different. This is on iOS. (On Mac OS I do see the file appear in the tempor

Re: Best practice for creating a temporary file

2014-09-02 Thread Jens Alfke
> On Sep 2, 2014, at 4:18 PM, Quincey Morris > wrote: > > Then is there any downside to letting it appear beside the final location? It's not the location that bugs me, so much as that it never gets cleaned up. So the parent directory starts accumulating more and more of these empty "(Docum

Re: NSURLDownload with Authentication

2014-09-04 Thread Jens Alfke
> On Sep 4, 2014, at 5:44 AM, Appa Rao Mulpuri wrote: > > I am trying to add the authentication logic for the existing code with the > NSURLDownload, but download:canAuthenticateAgainstProtectionSpace and > download:didReceiveAuthenticationChallenge: are not being called with the > below sam

Re: problem with NSWorkspace running apps

2014-09-04 Thread Jens Alfke
> On Sep 4, 2014, at 8:55 PM, Scott Ribe wrote: > > It is as though the runningApplications method returns a cached list which is > only updated when events are processed, thus I won't see the newly-launched > app until the next pass through the runloop, thus cannot launch an app and > immedi

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