Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar

2015-10-21 Thread Jens Alfke
> On Oct 20, 2015, at 11:49 PM, Jacek Oleksy wrote: > > Does it mean that there is no way to make custom toolbar look > native?:/ Why would *anyone* make a decision like that? Apple's HI designers decide how things should look visually, and they decided toolbars look best

Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar

2015-10-20 Thread Jens Alfke
> On Oct 19, 2015, at 11:48 PM, Jacek Oleksy wrote: > > I know that the tool is not the most precise one, but it is enough in > this case (we are talking about 10% difference here!). The height > discrepancy can be easily seen even without any tool (Peeking back into this

Re: App keeps being told to open nonexistent doc on launch

2015-10-19 Thread Jens Alfke
Arghh! I found the problem, and it’s my fault. At some point I added command-line args to the scheme, intending for them to set user defaults, but forgot the “-” before the names, so they got interpreted as file paths to open. —Jens ___ Cocoa-dev

App keeps being told to open nonexistent doc on launch

2015-10-19 Thread Jens Alfke
I’ve got a weird problem in an OS X app project I’m dusting off after a long hiatus. Every time the app launches, it pops up error alerts saying it can’t open two documents. The underlying problem is that the files for those documents don’t exist (and they have weird paths that are down inside

Re: Swift: Trying to use ViewController(). to access object

2015-10-19 Thread Jens Alfke
> On Oct 19, 2015, at 11:12 AM, Eric E. Dolecki wrote: > > I have been using NSNotificationCenter to affect objects in other classes > to good effect. I don’t understand … that class is used to register notification observers and to post notifications. What do you mean by

Re: Swift: Trying to use ViewController(). to access object

2015-10-19 Thread Jens Alfke
> On Oct 19, 2015, at 1:53 PM, Eric E. Dolecki wrote: > > I am asking if there is a way to call a method or set a property on an > ViewController object from another class. Sure, you just need a reference to it. > let foo = ViewController() > foo.object.hidden = true >

Re: How OS X's system-wide "look up" feature is implemented?

2015-10-16 Thread Jens Alfke
> On Oct 16, 2015, at 9:11 AM, Nick > wrote: > > Is it possible to add my own "widget/button/tab" to this popover somehow? > Even using an undocumented way? There should be... OS X does it somehow. Implement a service. —Jens

Re: App Transport Security has blocked a cleartext HTTP for a local IP

2015-10-15 Thread Jens Alfke
What’s the exact URL that failed to load? —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.com

Re: CGContextShowTextAtPoint

2015-10-14 Thread Jens Alfke
> On Oct 14, 2015, at 8:54 AM, Raglan T. Tiger wrote: > > I did all the above ... now my text prints upside down andI cannot get it to > size up regardless of the font size. The view is probably using flipped coordinates. Look up flipped coordinates in the Cocoa view

Re: Handling http:// URLs

2015-10-14 Thread Jens Alfke
> On Oct 14, 2015, at 4:26 AM, Greg Weston wrote: > > You could contrive a use case for just about any behavior you could imagine. > Lacking the aforementioned concrete example, I can't come up with any of my > own that aren't handled at least as well by a more "normal"

Re: More Swift issues, NSURLComponents

2015-10-12 Thread Jens Alfke
> On Oct 12, 2015, at 2:00 PM, Rick Mann wrote: > > In all this discussion, I forgot to bring up the containers: are they > special? A "let" container can't be reassigned, nor can its contents be > changed. How is this implemented? No, they’re not special, but they’re

Re: NSButton with NSTexturedRoundedBezelStyle outside of NSToolbar

2015-10-11 Thread Jens Alfke
> On Oct 11, 2015, at 2:07 PM, Jacek Oleksy wrote: > > The problem can be seen after creating a new project in XCode, adding > toolbar and putting a button on it (with proper style) and then > putting another button on the view. The height differs (24px vs 22px). A button in

Re: Dead Reckoning

2015-10-09 Thread Jens Alfke
> On Oct 9, 2015, at 9:24 PM, Graham Cox wrote: > > Does it actually replace a function call with an inline constant multiply? Sure. With optimizations enabled, the compiler is likely to inline the function calls, which will turn them into a simple multiplication.

Re: How to get a condensed San Francisco UIFont?

2015-10-07 Thread Jens Alfke
> On Oct 7, 2015, at 4:01 PM, David Hoerl wrote: > > then add a "condensed" attribute: > let fd2 = fd1.fontDescriptorByAddingAttributes[ the magic sauce ] I haven’t used this API, but from looking at the header, I would try: let fd2 =

Re: Value of type '[AnyObject]!' has no member 'Generator'

2015-10-05 Thread Jens Alfke
> On Oct 4, 2015, at 4:53 PM, Graham Cox wrote: > > The explanation as to why Swift doesn’t suck doesn’t fit any notion in > compuer science that I have ever heard of in almost 40 years of programming. https://en.wikipedia.org/wiki/Option_type Optionals (under

Re: More Swift issues, NSURLComponents

2015-10-05 Thread Jens Alfke
> On Oct 5, 2015, at 6:03 PM, Rick Mann wrote: > > No errors! But url3 is "let." Why is it allowed here? NSURLComponents is a class, not a struct, so ‘url3’ is a reference, not a value, and ‘let’ just means you can’t reassign ‘url3’ to point to another object. —Jens

Re: More Swift issues, NSURLComponents

2015-10-05 Thread Jens Alfke
> On Oct 5, 2015, at 6:59 PM, Rick Mann wrote: > > Huh. I continue to be bothered by the ambiguity/variability of "let"*. Is the > reference immutable or the thing it points to? A variable (var or let) doesn’t “point to” a struct. It _contains_ the struct. I.e. it’s a

Re: Drawing many different strings quickly

2015-10-01 Thread Jens Alfke
> On Oct 1, 2015, at 12:02 AM, Ben wrote: > > Using NSString's drawInRect:withAttributes: wants a Swift dictionary of > attributes. Instruments showed a lot of time spend accessing the elements of > this dictionary and converting back to Objective-C land. >

Re: Mac OSX 10.11 and XCode

2015-10-01 Thread Jens Alfke
> On Oct 1, 2015, at 9:20 AM, Dave wrote: > > I’ve installed 10.11 and XCode 7.0.1, now every now and then for no apparent > reason while in XCode, suddenly all 4 of my monitors go black and the machine > hangs for maybe 30 seconds then suddenly I get presented with

Re: How to override properties

2015-10-01 Thread Jens Alfke
> On Oct 1, 2015, at 9:28 PM, Gerriet M. Denkmann wrote: > > I don’t think that I want ’stuff’ to be implemented by its superclass. Rather > I want it to be overridden. So I am not sure, whether @dynamic is the right > thing to do. Implement -stuff and -setStuff: in the

Re: questions on WebView for Mac apps

2015-09-30 Thread Jens Alfke
> On Sep 30, 2015, at 10:43 AM, Conrad Shultz wrote: > > WKWebVew is the preferred API. > > If WKWebView is missing API that prevents you from adopting it (on either iOS > or OS X) please file a bug at https://bugreport.apple.com > .

Re: questions on WebView for Mac apps

2015-09-30 Thread Jens Alfke
> On Sep 29, 2015, at 10:35 PM, dangerwillrobinsondan...@gmail.com wrote: > > Then you realize it's a performance and security thing and it's pretty much > the same as the Safari Extensions API . Web views in WKWebView are actually a > separate process pool you don't own. > So you can

Re: Drawing many different strings quickly

2015-09-30 Thread Jens Alfke
> On Sep 28, 2015, at 6:07 PM, dangerwillrobinsondan...@gmail.com wrote: > > If not, NSImage has a nice API for drawing to the image context. Then you > just have an NSImage. Let AppKit do the work. It will cache the drawing of > that image until you change it. That would be trading CPU for

Re: questions on WebView for Mac apps

2015-09-30 Thread Jens Alfke
> On Sep 30, 2015, at 2:20 PM, Alex Hall wrote: > > Thanks everyone. I'm now using WKWebView, but it's… odd. I see only WebView > in the object library in Xcode, no WKWebView at all. Just because, I changed > the class of a WebView object to WKWebView, but am now seeing my

Re: questions on WebView for Mac apps

2015-09-30 Thread Jens Alfke
> On Sep 30, 2015, at 2:37 PM, Alex Kac wrote: > > Are you sure you’ve looked at WKWebView in its entirety? I was looking at > converting a UIWebView and WKWebView seems to have 10x MORE API than > UIWebView. Its just sprinkled about in a lot more classes and

Re: Implications of disabling ATS?

2015-09-30 Thread Jens Alfke
> On Sep 30, 2015, at 7:06 AM, Alex Hall wrote: > > However, before I go doing that, does anyone know of a better way? Are there > security implications I'm overlooking? I don't know what users will do with > this web view, and yes, some may log into sites or give other

Re: Where did NSSession put my file ?

2015-09-29 Thread Jens Alfke
> On Sep 28, 2015, at 9:54 PM, Gerriet M. Denkmann wrote: > > NSURLSessionDelegate and NSURLSessionTaskDelegate methods get called (as > expected) but none of the NSURLSessionDownloadDelegate methods ever get > called. Your NSURLSessionDataDelegate should be getting

Re: questions on WebView for Mac apps

2015-09-29 Thread Jens Alfke
> On Sep 29, 2015, at 8:15 PM, Roland King wrote: > > is WebView the go-to guy these days or is it WKWebView, which comes with all > the things you love about the Safari browsing experience built-in? That seems > pretty easy to use. There was a WWDC video on it if I remember

Re: questions on WebView for Mac apps

2015-09-29 Thread Jens Alfke
> On Sep 29, 2015, at 7:03 PM, Alex Hall wrote: > > 1. What class do I want to use when making an outlet for my web view UI > element? Don’t use a custom object. There should be a WebView item in the Interface Builder object palette already. > but "WebView" gives me an

Re: NSColorPanel and close box

2015-09-29 Thread Jens Alfke
What’s the host app? It sounds like something’s going wrong with event dispatching. Or, you’re not using a modal runloop mode, are you? —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: NSThread subclass get blocked on 'start' method call

2015-09-28 Thread Jens Alfke
> On Sep 28, 2015, at 9:29 AM, Alexey Belkevich > wrote: > > Here is the source code of Example - > https://www.dropbox.com/s/r5k8o28pocu7afk/aptest.zip?dl=0 > Can you isolate this down to something less

Re: Background Helper app - brings up UI element, needs CMD-C/X/V

2015-09-28 Thread Jens Alfke
> On Sep 28, 2015, at 1:05 PM, Alex Kac wrote: > > The problem is that without a menu bar, none of the CMD key functions for > text fields works now. Stuff like cut, copy paste. So with that in mind, how > do I enable that to work? You may need to capture the key events

Re: How to get remote metadata

2015-09-28 Thread Jens Alfke
> On Sep 27, 2015, at 10:43 PM, Gerriet M. Denkmann > wrote: > > The NSHTTPURLResponse allHeaderFields dictionary contains keys like: > “Content-Length” and “Last-Modified”. > Are these standardized or might other sites use other keys like > “Modification-Date” or

Re: Drawing many different strings quickly

2015-09-28 Thread Jens Alfke
> On Sep 28, 2015, at 1:41 AM, Ben wrote: > > When scrolling vertically, there could be up to 100,000 strings to be drawn, > horizontally, much fewer, less than 10,000. I'm assuming a maximum grid size > of 100 columns and 10k rows. This should be a worst-case

Re: NSThread subclass get blocked on 'start' method call

2015-09-28 Thread Jens Alfke
So, the problem actually begins _before_ you create the second thread. If you look at all of the running threads, you’ll see the first thread you created (“Thread 6” on my simulator) locked up inside its dealloc method: (lldb) bt * thread #6: tid = 0x7b7198, 0x000104b4ed92

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Jens Alfke
> On Sep 27, 2015, at 6:50 AM, Jerry Krinock wrote: > > I mean that if it is possible for -[NSThread start] to block indefinitely, it > is not a useable API. It’s not. The new thread will start when the kernel's scheduler gives it time. That’s technically indefinite, but

Re: Drawing many different strings quickly

2015-09-27 Thread Jens Alfke
Use an NSTableView. It knows how to manage unlimited numbers of rows efficiently. --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

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Jens Alfke
—Jens > On Sep 27, 2015, at 8:49 PM, Jerry Krinock wrote: > > My point is that if we can’t at least rely on -[NSThread start] returning > before the secondary starts, there is no way for a seconary thread to call > back to the main thread without possibility of deadlock.

Re: Continue application processing with mouse down on a menu

2015-09-26 Thread Jens Alfke
> On Sep 26, 2015, at 7:11 AM, Programmingkid wrote: > > It has seem like a rule that has been in place forever that an application > pauses processing when the mouse is down on a menu. Is there a way to make > the application continue processing even with the mouse

Re: Continue application processing with mouse down on a menu

2015-09-26 Thread Jens Alfke
> On Sep 26, 2015, at 10:03 AM, Eric Schlegel wrote: > > However, there are the usual ways around this: > - an event loop timer (using NSEventTrackingRunLoopMode) I guess that’s why I’ve never noticed that it blocked the main thread — my apps never do anything on the main

Re: Continue application processing with mouse down on a menu

2015-09-26 Thread Jens Alfke
> On Sep 26, 2015, at 10:55 AM, Programmingkid > wrote: > > I think the reasoning for this is the user interface is expected to be > responsive and if other processes are running, then the interface will be > sluggish. Not at all. All processes are always running

Re: Continue application processing with mouse down on a menu

2015-09-26 Thread Jens Alfke
> On Sep 26, 2015, at 10:51 AM, Programmingkid > wrote: > > When I click on a menu, the application pauses. That seems pretty much like a > smoking gun that things haven't changed much with the Mac OS. “The application pauses” is a pretty vague statement. If you’ve

Re: Continue application processing with mouse down on a menu

2015-09-26 Thread Jens Alfke
> On Sep 26, 2015, at 2:28 PM, Programmingkid wrote: > > What is the right runloop mode to use? Um, scroll back up to Eric Schlegel’s reply from earlier today, where he said what it is. (I don’t have it in my mailbox anymore.) Something like

Re: Continue application processing with mouse down on a menu

2015-09-26 Thread Jens Alfke
> On Sep 26, 2015, at 11:19 AM, Programmingkid > wrote: > > I just wish there were an easy way for the a task on the main thread to > continue to work even if the user is looking at a menu. Using multiple > threads has a lot of problems associated with it. Well,

Re: Odd Crash

2015-09-24 Thread Jens Alfke
This is a pretty common type of crash. You’ve got an NSTableView whose dataSource has been dealloced, so it tried to call the dataSource and crashed. If you want to catch this in the debugger, turn Zombie Objects on. Most likely the problem is that the window got closed but not released, so it

Re: Toolbar Template Image help

2015-09-23 Thread Jens Alfke
> On Sep 23, 2015, at 1:31 AM, Costas Chatzinikolas > wrote: > > Hi everyone. > > I want to design my toolbar icon images for my segmented control and i want > to start from somewhere. It sounds like you’re looking for an image of the background of the

Re: Beep ( duration, frequency )

2015-09-23 Thread Jens Alfke
> On Sep 23, 2015, at 8:11 PM, Raglan T. Tiger wrote: > > After I frustrated myself I realized your recommendation. Now I want to make > arbitrary sounds (am I a recording engineer to?) to use with +soundNAMED so > any suggestions while I Alphabet? For general sound

Re: Beep ( duration, frequency )

2015-09-23 Thread Jens Alfke
> On Sep 23, 2015, at 9:05 PM, dangerwillrobinsondan...@gmail.com wrote: > > There is also AVAudioEngine added in Yosemite. > It's a higher level Objective-C API around Core Audio. > The docs still kind of don't tell you much and at times the API makes more > sense if you know a little about

Re: Beep ( duration, frequency )

2015-09-23 Thread Jens Alfke
> On Sep 23, 2015, at 4:13 PM, Raglan T. Tiger wrote: > > Is there anything this easy for OS X? Well, NSBeep() is pretty easy if you just want to play a sound to alert the user. There’s no simple way to play ugly-sounding poorly-timed square waves, like the Windows

Re: Beep ( duration, frequency )

2015-09-23 Thread Jens Alfke
> On Sep 23, 2015, at 4:41 PM, Raglan T. Tiger wrote: > > I want code that is this simple on Windows: > > DWORD freq = 587; > if(!something) freq = 659; > if(another) freq = 523; > Beep(freq, 150); No, there’s no simple API for this. This API in Windows is a relic of

Re: Is it possible to transfer data by using light

2015-09-21 Thread Jens Alfke
> On Sep 21, 2015, at 8:54 AM, Sixten Otto wrote: > > Especially given that recent versions of iOS can detect and decode QR codes > automatically, much like face detection. And Mac OS, too. I just looked up some code I wrote a few months ago to do QR-code scanning. Here’s

Re: Is it possible to transfer data by using light

2015-09-20 Thread Jens Alfke
I don't think the ambient light sensor would be sensitive enough for this anyway, so the camera is the right thing to use. Look into the AVFoundation framework; it has some classes for setting up a video feed from the camera and receiving frames. I believe there's sample code. But honestly, if

Re: Generics Problem

2015-09-19 Thread Jens Alfke
> On Sep 19, 2015, at 11:26 AM, Quincey Morris > wrote: > > It looks like Swift is incapable of resolving the specialization of U when > there is more than one generic type specifier: Maybe it’s because the second type-spec T isn’t defined when the

Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface

2015-09-16 Thread Jens Alfke
> On Sep 16, 2015, at 4:00 AM, Jean Suisse wrote: > > Additionally, I was unable to find any leaks with Instruments (but I barely > know how to use it) Probably the next step would be to learn more about Instruments. > and the amount of memory reported by Instruments is

Re: Is it possible to transfer data by using light

2015-09-16 Thread Jens Alfke
> On Sep 16, 2015, at 9:06 PM, Jonathan Hull wrote: > > The big question would be why you want to do it. It is most likely easier to > transfer via wifi (also traveling at the speed of light, and optimized for > data transfer) or bluetooth. Secure pairing, as you said, is

Re: Working with NSTextFields

2015-09-15 Thread Jens Alfke
> On Sep 15, 2015, at 9:11 AM, Alex Hall wrote: > > * When I call myField.stringValue="some text", that string ("some text") > appears as expected, but it's highlighted. That means that, when the user > starts typing, it disappears, defeating the purpose of the app putting

Re: best way to implement a clickable grid?

2015-09-14 Thread Jens Alfke
I would probably just implement it as a custom NSView. Then it doesn’t even have to be represented in memory as a grid; you just remember the level for each x coord and fill in the appropriate squares when drawing. > Or is there a better way to handle click events on a simple NSView? Just

Re: Detecting second launch of the "LSUIElement=1"-application

2015-09-11 Thread Jens Alfke
> On Sep 11, 2015, at 1:12 PM, Nick wrote: > > Can I somehow detect that my application has been launched again, when it > is already running (it has an icon in NSStatusBar, but no icon in Dock)? The usual way is to implement the NSApplication delegate method

Re: SOAP Server library/framework for Objective C

2015-09-10 Thread Jens Alfke
> On Sep 10, 2015, at 4:25 PM, Nick wrote: > > Basically I would like to have other client apps "talk" to my Mac > application using SOAP. Do you have an existing dependency that requires using SOAP? Because otherwise I’d recommend something more modern and, well,

Re: SOAP Server library/framework for Objective C

2015-09-10 Thread Jens Alfke
ike I will have to implement a soap server myself. > > As an option I am considering using Delphi (it supports development OS X, and > has great out of box support for WebServices), but this is a "last resort". > > 2015-09-11 3:34 GMT+03:00 Jens Alfke <j...@mooseyard.

Re: Progress Bar Gripe

2015-09-09 Thread Jens Alfke
> On Sep 8, 2015, at 11:28 PM, Michael David Crawford > wrote: > > I invite you to continue our friendly debate. Then start a blog, enable comments, and post about these topics there. Cocoa-dev is not the right forum for high-level debate about Apple’s bug

Re: Display USB Video Camera output : AVFoundation?

2015-09-09 Thread Jens Alfke
> On Sep 9, 2015, at 9:22 PM, Jerry Krinock wrote: > > In a Mac app, I need to display real-time video (as in “movies”) from a USB > camera on the screen. Can someone please confirm that AVFoundation the way > to go? I can confirm that it’s easy to use AVFoundation to

Re: NSURLSessionUploadTask and resuming

2015-09-08 Thread Jens Alfke
> On Sep 8, 2015, at 4:05 PM, James Gale wrote: > > What I would like to know is there a way to make the NSURLSessionUploadTask > start from an offset of the file (such as setting a range header), or getting > the NSURLSessionUploadTask with stream to allow me to send

Re: Anyway to make a generic out of instancetype?

2015-09-04 Thread Jens Alfke
> On Sep 4, 2015, at 4:47 PM, Rick Mann wrote: > > I have some class methods that return NSArray*. I wanted to have them return > NSArray*, but the compiler doesn't seem to like that. Is it > worth trying to do? Well, it should be instead (the ‘*’ is

Re: How to terminate an NSTask whenever my app terminates?

2015-09-01 Thread Jens Alfke
> On Aug 31, 2015, at 11:44 PM, Bavarious wrote: > > There was a 2010 cocoa-dev thread about this: > http://www.lists.apple.com/archives/cocoa-dev/2010/Aug/msg00512.html > Yes, this seems to be what

Re: Mantaining legacy APIs in a framework

2015-08-31 Thread Jens Alfke
> On Aug 31, 2015, at 4:09 PM, Graham Cox wrote: > > So the framework needs to arrange that if -foo:withBar: wasn’t overridden, > but -foo: was, it should invoke the older override for backward compatibility > until the client code is revised. One way to do it is

How to terminate an NSTask whenever my app terminates?

2015-08-31 Thread Jens Alfke
(I know this has come up here before, but I can’t get the right combination of search terms to find an answer…) I’m writing a little GUI wrapper app around a command-line-based server. It uses NSTask to launch the server. I want to ensure that when the app exits, the server process exits too.

Re: setting tab stops in swift

2015-08-29 Thread Jens Alfke
On Aug 29, 2015, at 12:18 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: The second init *is* in the 10.11 Obj-C header, right down the end in the deprecations section. D’oh, you’re right. I see my mistake now — I had pressed Cmd-Shift-O, typed “inittype:loc”, and it

Re: Impossible leak warning in OS X init method

2015-08-29 Thread Jens Alfke
That code looks fine to me, and it’s exactly the same style of init method that I use (except that I now use ARC so I don’t have to write the [self release] call.) Is it possible that, in removing details from your code, you left out some detail that’s what’s causing the warning? Do you mind

Re: setting tab stops in swift

2015-08-29 Thread Jens Alfke
On Aug 29, 2015, at 11:36 AM, Boyd Collier bcoll...@mail.sdsu.edu wrote: Thanks very much for the suggestions. Re the possible error in my Obj-C code: Apple's documentation for NSTextTab shows 2 ways to create an NSTextTab; the first is initWithType:location: (which is what I used in

Re: setting tab stops in swift

2015-08-27 Thread Jens Alfke
On Aug 27, 2015, at 5:32 PM, Boyd Collier bcoll...@mail.sdsu.edu wrote: I’ve tried let theTabStop: NSTextTab = NSTextTab(NSLeftTabStopType, loc, (tabInterval * cnt)) but am told that NSLeftTabStopType is an “unresolved identifier”, which I understand has to do with enums being

Re: Will iOS app accepted on App Store if 80% of UI is rendered on UIWebView and 20% being native OCR

2015-08-20 Thread Jens Alfke
On Aug 19, 2015, at 11:21 PM, Devarshi Kulshreshtha devarshi.bluec...@gmail.com wrote: Will Apple accept my iOS app in App Store if I have 80% of flow, UI rendered on UIWebView and remaining 20% being integration and use of native vendor SDKs for OCR capabilities? Sure, why not? There

Re: Crash help?

2015-08-20 Thread Jens Alfke
On Aug 20, 2015, at 2:16 AM, Mike Abdullah mabdul...@karelia.com wrote: You can repro? That’s a great start! Considering it’s a crash in objc_msgSend, my first suspicion is a zombie. Yup. A valuable things to know in Obj-C debugging is that: * 99% of the time, a crash in objc_msgsend

Re: Private Methods

2015-08-20 Thread Jens Alfke
On Aug 20, 2015, at 4:10 AM, Jeremy Pereira jeremy.pere...@aptosolutions.co.uk wrote: The (Obj-C) compiler knows if a superclass declares a method with the same selector. Only if the method is declared in in @interface that has been imported. It could have been declared in a private

Re: Private Methods

2015-08-18 Thread Jens Alfke
On Aug 18, 2015, at 9:53 AM, Richard Charles rcharles...@gmail.com wrote: OBJC_PRINT_REPLACED_METHODS logs methods replaced by category implementations. If the replaced method is not in a category then it does not work. :-( Yeah, there’s no way for the runtime to tell the difference

Re: Private Methods

2015-08-18 Thread Jens Alfke
On Aug 18, 2015, at 11:32 AM, Maxthon Chan m...@maxchan.info wrote: The compiler knows absolutely NOTHING. The (Obj-C) compiler knows if a superclass declares a method with the same selector. So in some cases it can tell that you’re overriding. The problem is that it can’t tell if your

Re: Xcode warning from linking to a third-party framework in both app and in framework included in app?

2015-08-18 Thread Jens Alfke
On Aug 18, 2015, at 8:48 AM, Steve Mykytyn smyky...@gmail.com wrote: I'm linking to the Parse.com http://parse.com/ frameworks in both my app and in a private framework of my own included in the app. This generates the linker warning below. If Parse provides their library in the form of

Re: Thread-safe atomic property for array

2015-08-15 Thread Jens Alfke
On Aug 15, 2015, at 6:50 AM, Sandy McGuffog mcguff...@gmail.com wrote: Well, in my experience, in multithreaded code, if you can’t guarantee that something won’t happen, sooner or later it will, so you better code around it. Murphy’s law is particularly strong as regards multithreading :)

Re: Tech update avoiding legacy code

2015-08-14 Thread Jens Alfke
Do you have a definite business need to keep supporting 10.5? I can’t believe you have many customers still running it — it came out in 2007 (the last release I worked on at Apple!) In terms of priorities, I think ARC is the biggest win, followed by GCD. Some people might rate auto-layout

Re: Tech update avoiding legacy code

2015-08-14 Thread Jens Alfke
On Aug 13, 2015, at 11:27 PM, Appa Rao Mulpuri appar...@ivycomptech.com wrote: Thanks for the priority order. In GDC Vs ARC, GCD is the first one to opt unless if you are app has more memory leaks. Correct me If I am wrong. ARC will simplify your source code, make new code easier to

Re: Tech update avoiding legacy code

2015-08-14 Thread Jens Alfke
On Aug 14, 2015, at 1:00 PM, Rick Aurbach r...@aurbach.com wrote: I may be missing something here I think you are. This thread so far has been talking about Mac OS X, not iOS. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: Thread-safe atomic property for array

2015-08-14 Thread Jens Alfke
On Aug 14, 2015, at 4:59 PM, Trygve Inda cocoa...@xericdesign.com wrote: How can I do this safely? The problem here is that if myArray is being replaced in the main thread after [hostObject myArray] is called but before objectAtIndex:2 is called, than myArray will disappear out from

Re: Referring to self in property initializer

2015-08-14 Thread Jens Alfke
On Aug 14, 2015, at 4:32 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: No, there’s no instance here. “Enclosing” doesn’t really make any sense. It’s in the declaration of the ivar, I mean ‘stored property’, backgroundSession, so there is an instance. But I just realized

Re: Referring to self in property initializer

2015-08-14 Thread Jens Alfke
On Aug 14, 2015, at 4:24 PM, Rick Mann rm...@latencyzero.com wrote: I really would've hoped that since the closure is defined within the scope of an instance of the class, that it would have a self made available to it. I've seen similar code that used [unowned self] in to use a weak

Re: Referring to self in property initializer

2015-08-14 Thread Jens Alfke
On Aug 14, 2015, at 3:44 PM, Rick Mann rm...@latencyzero.com wrote: What is the type of self in the initializer closure, Wow, I didn’t even think you could use ‘self’ in such a context, since you’re not inside a method, just a closure. But it looks as though ‘self’ has type 'MyDelegate -

Re: Initialisation pattern

2015-08-12 Thread Jens Alfke
On Aug 12, 2015, at 8:07 PM, André Francisco andre.frate...@hotmail.com wrote: I've been reading about object initialisation in Objective-c, as well as the recent additions of NS_UNAVAILABLE and NS_DESIGNATED_INITIALIZER. It's been confusing what the correct approach would be, mostly

Re: Unsigned Modulo

2015-08-12 Thread Jens Alfke
On Aug 12, 2015, at 6:06 AM, Scott Ribe scott_r...@elevated-dev.com wrote: % is remainder NOT modulus. There was a long (too long…) thread about that last year, either on this list or xcode-users or objc-language, which pretty much beat the issue into the ground. If anyone feels strongly

Re: ARC and Manual Memory Management

2015-08-10 Thread Jens Alfke
On Aug 10, 2015, at 8:35 AM, Dave d...@looktowindward.com wrote: That’s fair enough, I was wondering if there was any deep reason. The thing is I have library classes that I use in older projects that are non-ARC, I was trying avoid having two sets of more or less identical files. Just

Re: ARC and Manual Memory Management

2015-08-10 Thread Jens Alfke
On Aug 10, 2015, at 12:12 PM, Dave d...@looktowindward.com wrote: If it just ignored those constructs, it was be much less confusing, simply because there would only one set of source code. It would be a mess, honestly. If you build + test a source file with ARC it’d be very easy to break

Re: Improve performance of data structure saved to disk

2015-08-06 Thread Jens Alfke
On Aug 5, 2015, at 8:42 PM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: IMO, Core Data is a terribly painful technology that will make you very, very miserable, not to mention adding many months to your project. I’m not _quite_ as down on it, but my attempts to use it circa

Re: Improve performance of data structure saved to disk

2015-08-06 Thread Jens Alfke
On Aug 6, 2015, at 6:36 AM, Juanjo Conti jjco...@carouselapps.com wrote: I've checked the number of entries and is only 350. They are regular cookies for well known sites like google, new relic, twitter... With only 350 objects you should be fine using a ‘dumb’ archived dictionary. I’ve

Re: Swift enums and NSNotificationCenter

2015-08-06 Thread Jens Alfke
On 06 Aug 2015, at 02:19, Rick Mann rm...@latencyzero.com wrote: On Aug 5, 2015, at 17:14 , Jens Alfke j...@mooseyard.com wrote: It’s part of the language design that only classes support inheritance, not structs or enums. Basically, subclassing pass-by-value types is problematic

Re: Swift enums and NSNotificationCenter

2015-08-05 Thread Jens Alfke
On Aug 5, 2015, at 5:00 PM, Rick Mann rm...@latencyzero.com wrote: On Aug 5, 2015, at 16:57 , Charles Srstka cocoa...@charlessoft.com mailto:cocoa...@charlessoft.com wrote: I get that error any time I try to subclass *any* enum. I don’t think enums are supposed to be subclassable.

Re: Init String with bytes

2015-07-31 Thread Jens Alfke
On Jul 31, 2015, at 12:32 PM, Jan E. Schotsman jesc...@xs4all.nl wrote: But the NSString Reference says: convenience init?(bytes bytes: UnsafePointerVoid, length length: Int, encoding encoding: UInt ) NSString ≠ String. It’s not toll-free bridging like you’re used to with CF. String and

Re: FSFileManager strange behaviour on OS X

2015-07-31 Thread Jens Alfke
On Jul 31, 2015, at 11:46 AM, Tim Fletcher timothy.m.fletc...@gmail.com wrote: I have a Chose File dialog for the user to select a file (directory in this case). I retrieve the absolute path of the chosen directory. However, am not able to list the contents of the directory. Is your

Re: problem with rangeOfString debugger warning

2015-07-30 Thread Jens Alfke
On Jul 30, 2015, at 1:11 AM, 2551 2551p...@gmail.com wrote: In the docs under ‘Special Considerations’ it says This method detects all invalid ranges (including those with negative lengths). For applications linked against OS X v10.6 and later, this error causes an exception; for

Re: NSManagedObject, NSString property retain vs copy

2015-07-30 Thread Jens Alfke
On Jul 30, 2015, at 9:03 AM, Trygve Inda cocoa...@xericdesign.com wrote: It seems Apple is using retain rather than copy for NSString properties in an NSManagedObject subclass. So, you’re saying that if you store an NSMutableString into a dynamic NSManagedObject property, and then mutate

Re: Timeouts in NSURLSession

2015-07-30 Thread Jens Alfke
On Jul 29, 2015, at 5:55 PM, Rick Mann rm...@latencyzero.com wrote: It seems the only workaround is to make the timeoutIntervalForRequest very long, too, which is gross, as a single request may legitimately time out in a short amount of time, but the large set of tasks could take much

Re: Regarding these Olivia messages. Can we do something about the list security?

2015-07-29 Thread Jens Alfke
On Jul 29, 2015, at 4:32 PM, Roland King r...@rols.org wrote: That's what I think to and the filth spread to the xcode list, or spread from the xcode list. I wrote to the admins on both lists and asked them to remove this scum feeder from all apple lists. I don’t think there’s any way to

Re: Techniques for limiting concurrent downloads via NSURLSession

2015-07-29 Thread Jens Alfke
On Jul 29, 2015, at 4:46 PM, Rick Mann rm...@latencyzero.com wrote: In my application I have to download hundreds to maybe a thousand files for each thing that gets downloaded. I tried just kicking off a bunch of download tasks in a loop, but eventually I either get Too many open files

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