Re: Exception on launch when clicking on an NSUserNotification

2015-02-26 Thread Jens Alfke
> On Feb 26, 2015, at 6:17 PM, Alex Kac wrote: > > However I'm having a problem on launching the app by tapping on the > notification. My app gets an applicationWillFinishLaunching, and then gets an > exception before it hits applicationDidFinishLaunching. > > https://www.dropbox.com/s/nmf6q

Re: Exception on launch when clicking on an NSUserNotification

2015-02-26 Thread Jens Alfke
> On Feb 26, 2015, at 6:49 PM, Alex Kac wrote: > > It would be a fantastic clue! Except … its not printed in the console, or in > the xcode console, or anywhere. Yeah, it’s getting caught by something that doesn’t log it. You can usually find the exception object when you’re stopped at the br

Re: Create a NSURL as a way to validate urls - not working

2015-03-02 Thread Jens Alfke
> On Mar 2, 2015, at 3:55 PM, Juanjo Conti wrote: > > Ok, I wanted to validate that the url is an absolute one. Is there > something in Swift standard lib to do this? I typically check whether url.scheme is a non-nil, non-empty string. You may also want to check the scheme if you need to restr

Re: Create a NSURL as a way to validate urls - not working

2015-03-02 Thread Jens Alfke
> On Mar 2, 2015, at 4:52 PM, Keary Suska wrote: > > That depends on what you mean by "validate." If you simply mean checking > whether it well-formed, you can do that easily with a regular expression > match, such as (written in email): > ^http://(?:[a-z0-9-]+\.){1,}[a-z]{2,4} It’s rea

Re: NSWorkSpace performFileOperation (a)synchronousness

2015-03-05 Thread Jens Alfke
> On Mar 5, 2015, at 2:36 AM, Aandi Inston wrote: > > My question relates to asynchronousness (is that a word)? It looks like a > synchronous method as it returns a success or failure. But the documentation > says of the tag variable "a positive integer if the operation was performed > asynchron

Re: NSString stringByAbbreviatingWithTildeInPath and Sandboxing

2015-03-05 Thread Jens Alfke
> On Mar 5, 2015, at 9:30 AM, Jon Baumgartner > wrote: > > That bug has gotten no response whatsoever from Apple. Any advice on how to > proceed? I wouldn’t expect a response from Apple in ‘only’ a month, except perhaps to notify you that it’s a duplicate. If they do fix the bug, you won’t

Re: Cocoa GUI app getting slower on MacPro or MacMini when disconnecting all screens

2015-03-11 Thread Jens Alfke
> On Mar 11, 2015, at 3:40 PM, Matthieu Beghin > wrote: > > if I do nothing in the timer, it's called as often as when a screen is > connected (120 times per second) > if I do some processing, it gets called 20 times per second, but CPU usage > is very low This sounds like some kind of Qt

Re: Swift Keypress KeyDown NSResponder input function needed.

2015-03-11 Thread Jens Alfke
> On Mar 11, 2015, at 5:09 PM, Mutlu Qwerty wrote: > >self.nextResponder = super.nextResponder //insert self into the > Responder chain That just sets the object's nextResponder property; it doesn’t insert the object into the responder chain. I think you want to set the _view’s_ nex

Re: NSSharedWorkspace Notification Question

2015-03-12 Thread Jens Alfke
> On Mar 12, 2015, at 8:15 AM, Dave wrote: > > Is this expected behaviour? Doesn’t seen right to me, since I would have > thought that an Applications is “Launched” and then “Activated”, is this not > the case? I think it activates before it _finishes_ launching. —Jens __

Re: Finding the use of a private API

2015-03-16 Thread Jens Alfke
> On Mar 16, 2015, at 3:52 PM, Michael Crawford wrote: > > would it work to use a binary editor - that is, a hex editor - to > alter the name of the symbol you're linking to, at which point you > call abort(), divide by zero, or call a method that exists only so you > can set a breakpoint in it?

Re: Official or correct explanation of numbers on the 1st column for every method/function call in process sample?

2015-03-17 Thread Jens Alfke
> On Mar 17, 2015, at 1:52 PM, JongAm Park wrote: > > I know that questions on tools are not relevant for this cocoa-dev, but I > couldn’t find any relevant mailing list xcode-users is the list for discussion of all development/debugging/testing tools. > By looking at the numbers on children

Re: Scrolling Text Field Class for Logging?

2015-03-18 Thread Jens Alfke
> On Mar 18, 2015, at 10:34 AM, Dave wrote: > > Is there a Class/Subclass available to do this or do I need to write my own? You need to write your own, but it’s not hard. Just check the scroll position before appending the text; if it was at the bottom before, scroll it to the bottom again.

Why is NSString.UTF8String unavailable in Swift?

2015-03-21 Thread Jens Alfke
I’m writing Swift code to call a C function that takes a string in the form of a char*. The value I have is a String, obviously. I thought this would work: import Foundation let s = “……” some_function(s.UTF8String) but this fails to compile, with an error “‘String’ does not

Re: Why is NSString.UTF8String unavailable in Swift?

2015-03-21 Thread Jens Alfke
> On Mar 21, 2015, at 2:13 PM, Quincey Morris > wrote: > > Well, “String” is not “NSString”. Sure, but it’s bridged with NSString. The “Using Swift With Cocoa” book says: “Swift automatically bridges between the String type and the NSString class. This means that anywhere you use an NSString

Re: Why is NSString.UTF8String unavailable in Swift?

2015-03-21 Thread Jens Alfke
—Jens > On Mar 21, 2015, at 5:09 PM, Kevin Meaney wrote: > > But the bridging only happens if you import Foundation, otherwise there is no > NSString to bridge with. I did import Foundation. I showed that clearly in the code snippets in my first message. --Jens ___

Re: Why is NSString.UTF8String unavailable in Swift?

2015-03-21 Thread Jens Alfke
> On Mar 21, 2015, at 4:58 PM, Quincey Morris > wrote: > > When you used “cStringUsingEncoding”, you weren’t bridging to the NSString > method, you were using String’s native method of the same name. Aha. That was not at _all_ clear from the docs. The implication there is that String inheri

Re: Why is NSString.UTF8String unavailable in Swift?

2015-03-21 Thread Jens Alfke
> On Mar 21, 2015, at 8:43 PM, Charles Srstka wrote: > > If you convert between String and NSString a lot, it’ll have performance > implications (which is why bridging to NSString just to get -UTF8String isn’t > really a good idea). Then what would be the best way, given a String, to pass it

Re: All of a sudden, app security exception?

2015-03-27 Thread Jens Alfke
> On Mar 27, 2015, at 3:20 PM, Rick Mann wrote: > > Okay, but something is still suddenly different. I didn't change my exception > configuration. Some change in your compiled code caused a different code path through the OS's code-signing verification code, and that code path happens to invo

AVCaptureView not showing any preview video

2015-03-28 Thread Jens Alfke
I’m using an AVCaptureView on OS X 10.10 to read a QR code from the camera (i.e. the built-in one on my MacBook Pro.) Everything’s working — my delegate receives frames, and using a CIDetector it can read a QR code held up to the camera — except that the view doesn’t show the video from the came

Re: Drawing in a view with alpha < 1.0 shows windows behind

2015-03-31 Thread Jens Alfke
> On Mar 31, 2015, at 5:39 AM, Eyal Redler wrote: > > For some reason the view is showing through the windows/desktop behind the > window where my view is located. > Surly this is a manifestation of one of the (somewhat unwanted IMO) features > of Yosemite Nope, it’s always been that way. I r

Re: Swift: How to determine if a Character represents whitespace?

2015-04-02 Thread Jens Alfke
> On Apr 2, 2015, at 4:54 AM, Charles Jenkins wrote: > > What would be nice is a way to count leading and trailing characters in place > while the thing is still an NSAttributedString--without using > NSAttributedString.string to convert to a Swift string in the first place. If > there were n

Re: Assuring KVO compliance.

2015-04-07 Thread Jens Alfke
> On Apr 7, 2015, at 7:04 AM, Alex Zavatone wrote: > > The code that I've inherited has an enum (not an NSEnum) that represents the > app's connected state, 0, 1 or 2. There’s no difference. NS_ENUM is just a macro that defines a C enum, but uses some newer (C99?) syntax to specify the intege

Re: Where is my bicycle?

2015-04-07 Thread Jens Alfke
> On Apr 6, 2015, at 2:09 PM, Jack Brindle wrote: > > Have you checked the Font you are using to display the character string to > see if it contains the bicycle character? If not, you probably won’t get the > character you seek. Fonts have nothing to do with it; they’re an aspect of renderin

Re: Making an array property without a backing store. How?

2015-04-07 Thread Jens Alfke
> On Apr 7, 2015, at 11:55 AM, Quincey Morris > wrote: > > The problem is that this approach doesn’t actually work, not in this form. > There’s a little bit of Doing It Wrong™, but mostly this is pretty badly > broken in Cocoa. What Quincey said. I banged my head against this a lot back in 2

Re: Where is my bicycle?

2015-04-07 Thread Jens Alfke
> On Apr 7, 2015, at 12:59 PM, Charles Srstka wrote: > > I really want to see a Cyrillic version of Papyrus now. ;-) http://ihateyouare.deviantart.com/art/Papyrus-Plain-Cyrillic-165111766 You’re welcome :) —Jens ___

Re: objc_msgSend() selector name: tableView:objectValueForTableColumn:row:

2015-04-09 Thread Jens Alfke
Use NSZombieEnabled. Looking at registers isn’t going to help you because the offending memory address probably isn’t a pointer to the object (most likely it’s some bogus address found at the location where the deceased object’s ‘isa’ pointer used to be.) —Jens _

NSProgress: is there really no API to find its children?

2015-04-09 Thread Jens Alfke
I just started using NSProgress. I’m going to use it as the mechanism for my framework to report the progress of a complex upload/download operation which can involve many files and other HTTP resources: the object representing this operation will have a public “progress” property exposing an NS

Re: Implement multi-tabs with WebView

2015-04-08 Thread Jens Alfke
> On Apr 8, 2015, at 1:24 PM, Juanjo Conti wrote: > > Hi! I'd like to use a WebView instance to handle a multi-tabs browser-like > desktop app. Is it possible using only one WebView instance? Or should I > need to use once per tab? You’ll need one per tab. You’ll also want to join the webkit-sd

Re: Crash when move open document based app file to trash

2015-04-13 Thread Jens Alfke
> On Apr 13, 2015, at 7:01 AM, Mike Abdullah wrote: > > I’m not sure how careful that monitoring is, though, whether it happens > continuously, or only at the moment the app or document regains focus. Even if it’s continuous, it can’t be continuous enough, since the OS is multithreaded. There

Re: Scattered NSProgress use

2015-04-13 Thread Jens Alfke
> On Apr 11, 2015, at 12:49 PM, Daryle Walker wrote: > > We have to make sure that the automatic parent/nesting aspect doesn’t make > sibling & cousin progress objects, whose actions will be interlaced, > interfere with each other. It’s only automatic while an NSProgress is made the currentPr

Re: Crash when move open document based app file to trash

2015-04-13 Thread Jens Alfke
> On Apr 13, 2015, at 9:36 AM, Jonathan Mitchell > wrote: > > Of these lack of network support is probably the killer. But I will dig a bit > deeper. In my experience, relying on file locking on networked filesystems is playing with fire. There are too many situations where it doesn’t work c

Re: My Phone does not work upside down

2015-04-14 Thread Jens Alfke
> On Apr 14, 2015, at 4:57 AM, Roland King wrote: > > Read the manual. +1. In addition to what Roland said, it’s also staring you right in the face in the General tab of the target settings as a set of friendly checkboxes. —Jens ___ Cocoa-dev mai

Re: My Phone does not work upside down

2015-04-14 Thread Jens Alfke
> On Apr 14, 2015, at 8:44 AM, Roland King wrote: > > The one thing I’ve never understood is why ‘upside down portrait’ is > discouraged on the phone. I think it’s because holding your phone upside down is a really bad idea when you try to use it as a _phone_*. So maybe Apple wants to keep i

Re: Scattered NSProgress use

2015-04-17 Thread Jens Alfke
> On Apr 17, 2015, at 8:07 AM, Daryle Walker wrote: > >> If you’d rather, you can make everything explicit by _never_ making an >> NSProgress current, and instead passing it in as the parent when you create >> new child instances. > > You can’t do that (for now). A progress object’s parent mu

Re: Crash at iOS App Startup - What Could Have Gone Wrong?

2015-04-21 Thread Jens Alfke
> On Apr 21, 2015, at 5:35 AM, Michael Crawford wrote: > > The reason I haven't been using version control is that I prefer to > operate my own servers - but then I have to set them up, and it's > quicker just to roll a tarball. You don’t have to have a server to use Git. In fact it’s only goin

Re: Crash at iOS App Startup - What Could Have Gone Wrong?

2015-04-21 Thread Jens Alfke
> On Apr 21, 2015, at 1:04 PM, Michael Crawford wrote: > > I've configured svn repositories a few times, it is a PITA. Me too, and I agree. Leave SVN behind and learn Git or Mercurial; they are so much nicer to use. There’s a bit of a learning curve* but they will save you so much time and ag

Re: Converting to Window Coordinates

2015-04-22 Thread Jens Alfke
> On Apr 22, 2015, at 9:46 AM, Scott Ribe wrote: > > On Apr 22, 2015, at 10:10 AM, Dave wrote: >> >> I really can’t understand why it was ever defined to be bottom left, does >> anyone know why? > > Normal Cartesian coordinates. (I agree the other way made sense, measuring > from the menu b

Re: UIAlertView won't set password field as first responder

2015-04-22 Thread Jens Alfke
> On Apr 22, 2015, at 1:34 PM, Kyle Sluder wrote: > > Accessing the subviews of a view you do not own is by definition > "messing with the internals". > ... > Just because a method exists doesn't mean that it is OK for arbitrary > clients to access it. Kyle, you may have forgotten that -textFie

Re: Stupid ! and ?

2015-04-25 Thread Jens Alfke
> On Apr 25, 2015, at 7:59 AM, William Squires wrote: > > 1) Explicitly state that object references must be tested for nil before use > (like C,C++, etc…), Because it’s extremely unsafe and leads to crashes or heap corruption, and at worst, catastrophic security holes. If you’re keeping up w

Re: Running AppleScripts from an App using NSAppleScript

2015-04-27 Thread Jens Alfke
> On Apr 27, 2015, at 6:52 AM, Dave wrote: > > At the moment, I setup the Text for the Script, Compile it and then Run it > each time. I’m wondering if there is anyway to be able to just compile the > Script once, and then pass the Parameters to the Script as it seems a bit > time-consuming t

Re: time of the build

2015-04-29 Thread Jens Alfke
> On Apr 29, 2015, at 7:51 AM, Torsten Curdt wrote: > > Having the explicit __DATE__ in the binary as string makes it a little bit > too easy to change. If someone’s determined enough to patch the binary, there’s nothing you can do about it. No matter how carefully you encode/hide the timestam

Re: Dumb question about view controllers

2015-05-02 Thread Jens Alfke
> On May 2, 2015, at 11:18 AM, William Squires wrote: > > why doesn't Xcode generate a template view controller (code) for the UILabel > (that is, UILabelViewController), just like there's a view controller for the > main view (usu. ViewController.h and ViewController.m, or - in swift, just >

Re: Swift and 10.9 base SDK

2015-05-03 Thread Jens Alfke
SDK version != deployment version. Set the SDK to 10.10 and the deployment version to 10.9, and your app will run on 10.9. —Jens > On May 3, 2015, at 6:54 AM, Jonathan Mitchell wrote: > > I was wanting to try inserting some Swift into my Obj-C app but didn’t get > too far on Xcode 6.3.1 befo

Re: What is ~/Library/Caches//<...> for?

2015-05-04 Thread Jens Alfke
> On May 4, 2015, at 8:05 PM, Graham Cox wrote: > > Does anyone know what these are for? I'm pretty sure that's Foundation's URL-loading cache — anything that loads resources over HTTP using NSURLSession or NSURLConnection will end up storing data there. > I’ve been tracking down a problem w

Help: NSScrollView is resizing its documentView down to (0, 0)

2015-05-05 Thread Jens Alfke
I haven't done much AppKit work in a while. Right now I have a small app where I'm trying to do something very simple: put a custom NSView in a window and make it scrollable. The view determines its own frame size based on the content it needs to display. So all I did was create a new window in

Re: malloc(0) returns a pointer, not NULL

2015-05-05 Thread Jens Alfke
The Clang static analyzer will warn about potential calls to malloc(0). —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)list

Re: Issues with implementing WYWIWYG font menu

2015-05-05 Thread Jens Alfke
> On May 5, 2015, at 2:21 PM, David Durkee wrote: > > 1) The first time the menu is opened, it takes as much as two seconds for it > to appear. And it might take a lot longer than that, for a user with a lot of fonts installed. (I have nearly 2000.) It can also allocate a ton of RAM for glyph

Re: Help: NSScrollView is resizing its documentView down to (0, 0)

2015-05-05 Thread Jens Alfke
> On May 5, 2015, at 4:26 PM, Graham Cox wrote: > > I don’t know, but I also find setting up simple constraints baffling. Even > the most straightforward cases seem to be really hard to get right. Glad to know I'm not the only one. It wouldn't be so bad if there were some real documentation I

Re: Core Data sync between iOS and Mac apps

2015-05-05 Thread Jens Alfke
> On May 5, 2015, at 2:31 PM, davel...@mac.com wrote: > > I'm looking into options for building an iOS and Mac app that can sync/share > Core Data between them. I'm well aware of the issues with Core Data iCloud > syncing in iOS 5 and 6 and that it is supposedly better so I'm willing to try >

Re: Help: NSScrollView is resizing its documentView down to (0, 0)

2015-05-05 Thread Jens Alfke
> On May 5, 2015, at 5:54 PM, Roland King wrote: > > Constrain the scrollview to something above it if it needs it, if it’s the > whole window, probably doesn’t. > Constrain the clipview to all 4 sides of the scrollview. > Constrain your view to the top, right and left of the clipview but not

Re: Help: NSScrollView is resizing its documentView down to (0, 0)

2015-05-05 Thread Jens Alfke
> On May 5, 2015, at 6:17 PM, Luther Baker wrote: > > Not exactly the same but I found this doc helpful. > > https://developer.apple.com/library/ios/technotes/tn2154/_index.html > I knew about that technote, but UIScrollVi

Re: Help: NSScrollView is resizing its documentView down to (0, 0)

2015-05-06 Thread Jens Alfke
> On May 6, 2015, at 8:36 AM, Uli Kusterer wrote: > > So you're not setting a constraint on the *document* view? How do you expect > it to know how to constrain that view otherwise? The size of the document view is fundamentally unrelated to the size of the clip or scroll view — the whole poi

Re: iOS firing an event in the future when an app is in the background

2015-05-06 Thread Jens Alfke
> On May 6, 2015, at 9:08 AM, Alex Zavatone wrote: > > I'm looking into performing an event in the future on iOS very likely when > the app may be in the background, possibly up to 24 hours in the future. Keep in mind that your app isn’t even running when it’s in the background on iOS. It’s n

Re: Help: NSScrollView is resizing its documentView down to (0, 0)

2015-05-07 Thread Jens Alfke
> On May 6, 2015, at 9:10 PM, Luther Baker wrote: > > I'm probably missing something ... but fundamentally, the whole point of > constraints between the scrollview and its children is so that the scrollview > knows how big to make its contentSize. It sounds like you've got this flipped > ...

Re: Drawing many thin vertical lines is very slow

2015-05-07 Thread Jens Alfke
> On May 7, 2015, at 9:43 PM, Michael David Crawford > wrote: > > If I autorotate, redrawing the vertical lines takes hundreds > of times as long as redrawing the horizontal lines. That makes sense > as one can draw a horizontal line by incrementing a pointer into the > image buffer. To draw

Re: Drawing many thin vertical lines is very slow

2015-05-07 Thread Jens Alfke
> On May 7, 2015, at 9:43 PM, Michael David Crawford > wrote: > > Another way would be for me to render the entire view in an offscreen > image buffer, which I expect I could do far more efficiently than by > making many calls into UIRectFill or even CoreGraphics. Actually, no. Rendering in so

Re: Core Data sync between iOS and Mac apps

2015-05-10 Thread Jens Alfke
> On May 10, 2015, at 6:16 AM, davel...@mac.com wrote: > > Also thanks to Jens Alfke for his reply about Couchbase Lite > (http://www.couchbase.com/nosql-databases/couchbase-mobile). I may look into > it but after skimming the site, I couldn't tell exactly what I would ne

Re: Core Data sync between iOS and Mac apps

2015-05-12 Thread Jens Alfke
> On May 12, 2015, at 6:00 AM, davel...@mac.com wrote: > > I’m not sure I understand your concerns about Dropbox. The app is single user > so when the iOS enters the background, I can upload the data (if there’s a > network connection at the moment) for modified files to Dropbox. A single-user

Re: How to draw a NSView on top of a WebView and don't get overriden trying

2015-05-12 Thread Jens Alfke
> On May 12, 2015, at 1:44 PM, Juanjo Conti wrote: > > If I add it as a subView of WebView or if I add it as a subView of the > WebView's superView, it's shown for a while but if the WebView gets > scrolled or if I load sites gmail.com or twitter (without > logging in), the

Re: Aggravation trying to implement NSValueTransformer subclasses in Swift

2015-05-12 Thread Jens Alfke
> On May 12, 2015, at 2:29 PM, William Squires wrote: > > but the example in the documentation is in ObjC, not Swift, and refers to id, > not to "Bool"s or "String"s. Hints, anyone? ‘id’ in Obj-C is ‘AnyObject’ in Swift. You’ll need to use the “as” or “as?” operator to type-cast it to NSNumbe

Re: Optionals? A better option!

2015-05-14 Thread Jens Alfke
With all due respect, I think you’re falling into the common engineer pitfall of jumping to the conclusion that there’s a trivial solution without first understanding the problem. (Sometimes expressed as “any bug in your program is trivial; any bug I have to fix is intractable.”) Which is to say

Re: Optionals? A better option!

2015-05-15 Thread Jens Alfke
> On May 15, 2015, at 4:34 AM, has wrote: > > Lisp has a `nil` object. That's not the same thing as a nil pointer. The > first is an actual Thing; the second is a promise to give you a thing that > instead drops you down a hole when you actually ask for it. Yes, but when you evaluate (cdr nil

Re: Optionals? A better option!

2015-05-15 Thread Jens Alfke
> On May 15, 2015, at 10:12 AM, Scott Ribe wrote: > > As in the olden days of OS 9 & before, when you could freely read & write > through location 0, usually leading to great hilarity… Especially since the 68k CPU interrupt vectors were stored in low memory a few bytes from 0, so a memcpy or

Re: NSNotificationQueue Question

2015-05-20 Thread Jens Alfke
> On May 20, 2015, at 10:18 AM, Richard Charles wrote: > > This works but the problem is that there are undesirable side effects to > running the runloop once when this call is made. Yup. Manually spinning the runloop in any non-custom mode is generally a bad idea. > What I would like to do

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Jens Alfke
> On May 20, 2015, at 1:04 PM, Alex Zavatone wrote: > > Many times in the classes, an ivar is defined in the @interface of the class. > Sometimes not. In the old days, before about 2006, the ivars had to be defined in the @interface. Nowadays it’s best to put them in the @implementation si

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Jens Alfke
> On May 20, 2015, at 4:08 PM, Eric Wing wrote: > > You could use the Objective-C runtime to find out which things are properties. You could, but isn’t it a lot easier to just look at the character before the name and check whether it’s a “.”? —Jens ___

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-20 Thread Jens Alfke
> On May 20, 2015, at 4:57 PM, Eric Wing wrote: > > It depends on how pedantic you want to be. As little as possible, honestly. Did you go back and read the original question? The OP is having trouble with basic property-vs-ivar distinctions, and dropping a whole bunch of science on him isn’

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-21 Thread Jens Alfke
> On May 21, 2015, at 6:43 AM, Alex Zavatone wrote: > > Also, you can turn it off autosynthesis? How? That would be a big help for > me to straighten out this iOS project where the original developers thought > everything needed to be a java bean. As Graham said, go to the build settings an

Re: Stupid Cocoa question. How can you tell if the object you are looking at is a property or an ivar?

2015-05-21 Thread Jens Alfke
> On May 21, 2015, at 9:28 AM, Alex Zavatone wrote: > > @synthesize thing = _thing; > Which makes the internal and private ivar to be _thing while the property > becomes thing. > In my case, this helps to uncover where the original code is accessing the > ivar as opposed to the property. I al

Re: NSFontPanel swamping the responder chain (and crashing)

2015-05-21 Thread Jens Alfke
> On May 21, 2015, at 9:51 AM, Quincey Morris > wrote: > >> 5 AppKit +[NSSavePanel _crunchyRawUnbonedPanel] > > The only way it could be any better is if it were huggable, too. Ha! That’s actually a reference to the Monty Python “Whizzo Candy Assortment” sketch: Inspector: People won't ex

Re: Disabling auto-synthesis of property accessors.

2015-05-21 Thread Jens Alfke
> On May 21, 2015, at 10:40 AM, Fritz Anderson wrote: > > I must have misinterpreted the question. I had understood Alex wanted a build > option to turn off the auto-synthesis of properties, so the compiler could > complain at every conflation of ivars with @propertys. The warning causes the

What is overwriting 'isa' with 0xbaddc0dedeadbead ?

2015-05-22 Thread Jens Alfke
I’m trying to debug a mysterious crash in a Swift init method. At the end of the method there are some calls to objc_release generated by the compiler, and it’s the first of these that crashes: the object being released has has its ‘isa’ pointer replaced by the value 0xbaddc0dedeadbead. This is

Re: What is overwriting 'isa' with 0xbaddc0dedeadbead ?

2015-05-23 Thread Jens Alfke
> On May 23, 2015, at 9:20 AM, Greg Parker wrote: > > free() does that sometimes. If zombies doesn't find anything then try guard > malloc. Good suggestion! I’d forgotten about guard malloc. This changes the crash; now the parameter to objc_release points to unmapped memory, implying that the

Re: What is overwriting 'isa' with 0xbaddc0dedeadbead ?

2015-05-23 Thread Jens Alfke
I’m now convinced this is a Swift code-gen error. I’ve confirmed that the object that’s prematurely freed is the temporary NSString created by swift_convertStringToNSString. It’s being freed by a call to swift_release that occurs inside the method that the NSString gets passed into. In other wor

Re: What is overwriting 'isa' with 0xbaddc0dedeadbead ?

2015-05-23 Thread Jens Alfke
> On May 23, 2015, at 3:31 PM, Jens Alfke wrote: > > I’m not sure I can simplify this into a test case, but I’ll try. FYI, I’ve boiled it down into a small test case and submitted it as rdar://21090194 . I’ve also found some workarounds, so I can get on with my life no

Re: Disabling auto-synthesis of property accessors.

2015-05-26 Thread Jens Alfke
> On May 26, 2015, at 10:24 AM, Alex Zavatone wrote: > > For any nonmutable class, should I be using copy instead of strong or is this > just with NSString? Well, only for classes that implement NSCopying. And if it’s truly an immutable value class; for example you probably wouldn’t want an I

Re: Problem with Outline View and Manual Memory Management

2015-05-26 Thread Jens Alfke
> On May 26, 2015, at 11:34 AM, Dave wrote: > > The SourceView project is built using ARC, but my App uses Manual Memory > Management. When I moved the code over, I changed it to use release etc. and > changed any properties or iVar’s to use retain or assign. Why not leave the source files a

Re: NSPathControl

2015-05-27 Thread Jens Alfke
> On May 27, 2015, at 2:46 PM, Raglan T. Tiger wrote: > > I can setObjectValue: for the path; now I want to know what path component > the users selects. I am using Pop Up style. It’s an NSControl. Wire up the target/action to your IBAction method, either in IB or programmatically. —Jens _

Re: Looking at self = [super init].

2015-05-29 Thread Jens Alfke
> On May 29, 2015, at 11:02 AM, Alex Zavatone wrote: > > Regarding Daniel's next email, yeah, I kind of really dislike the extra > indent for the entire init function. It just seems so wrong. That’s sort of a religious issue. Some people think early returns from functions are wrong, because

Re: Looking at self = [super init].

2015-06-02 Thread Jens Alfke
> On Jun 2, 2015, at 12:13 PM, Charles Srstka wrote: > > That can be handy, if you’re not colorblind. If you are, the coloring isn’t > much help. It depends on what the colors are. Almost no one is entirely colorblind; usually it’s just red and green that are problematic. But yes, you might

Extending or replacing standard font panel?

2015-06-02 Thread Jens Alfke
Does anyone know whether it’s possible to extend or override the standard Mac font panel (NSFontPanel) across all apps? I’m guessing the answer is “not without nasty hacks that involve injecting code into all processes”, i.e. the sort of thing that DefaultFolder and other open/save panel utilit

Re: Looking at self = [super init].

2015-06-02 Thread Jens Alfke
> On Jun 2, 2015, at 1:28 PM, Charles Srstka wrote: > > Dogs don’t completely lack color vision. Also, calling a person a dog could > really come across in a way that you’re not intending. Sorry, not intended! I was thinking more of “On cocoa-dev, no one knows you’re a dog”. > Anyway, yes, o

Re: Strange Warning Message from the Analyzer?

2015-06-09 Thread Jens Alfke
> On Jun 9, 2015, at 6:54 AM, Dave wrote: > > I was just about to post as I figured it out, the thing is that malloc should > never return NULL and I thought the analyzer knew that, I guess it’s safer to > test anyway. It’s sort of a gray area. In a 64-bit Darwin process I think it’s extremel

Re: Strange Warning Message from the Analyzer?

2015-06-09 Thread Jens Alfke
> On Jun 9, 2015, at 9:51 AM, Quincey Morris > wrote: > > I might be misremembering, but I think this has come up before, and one other > way is that malloc is allowed to return NULL if the requested size is 0. > (Whether or not it does so is standard-library-implementation-dependent.) I thi

Re: for case and if case (Swift 2)

2015-06-12 Thread Jens Alfke
> On Jun 12, 2015, at 9:29 AM, Quincey Morris > wrote: > > On Jun 12, 2015, at 01:15 , Roland King wrote: >> >> So you mean the slide lied. > > The more I think about it, the more I want to believe that the current form > is just an oversight, and the intended syntax is what’s on the slide.

Re: Language options: Objective-C, Swift, C or C++?

2015-06-12 Thread Jens Alfke
> On Jun 12, 2015, at 7:32 PM, Carl Hoefs > wrote: > > Okay, so now there's Swift. Ugh. At first glance it looks like a throwback to > Basic (let x =), so it make me shudder. If it’s any help, I can assure you that “let” comes from LISP and has been used in tons of newer functional languages

Re: Language options: Objective-C, Swift, C or C++?

2015-06-15 Thread Jens Alfke
> On Jun 15, 2015, at 5:30 AM, Charles Jenkins wrote: > > I may have misinterpreted the WWDC ’14 announcement of Swift. Somehow I got > the impression Swift was supposed to make Mac programming easier and more fun. Can we pleease stay away from sarcasm in this thread. Language flame-wars

Re: AppDelegate vs Custom View Controllers for Download Task...

2015-06-16 Thread Jens Alfke
> On Jun 16, 2015, at 3:37 PM, Peters, Brandon wrote: > > Is there any “known” danger in making the AppDelegate a NSURL session > delegate? No, but it doesn’t sound like a good design. The app delegate is for starting up the app and responding to some events from outside. It would be cleaner

Re: Scary Stuff!

2015-06-17 Thread Jens Alfke
As usual, don’t put too much weight into the bite-size digests from the press, especially the Register, which has a track record of sensationalism. Unfortunately the actual truth is fairly bad. I recommend reading the paper: https://drive.google.com/file/d/0BxxXk1d3yyuZOFlsdkNMSGswSGs/view

Re: Language options: Objective-C, Swift, C or C++?

2015-06-17 Thread Jens Alfke
> On Jun 17, 2015, at 12:30 PM, Ariel Feinerman wrote: > > Why just do not use some clone of Smalltalk for Mac OS X before inventing > new language? Maybe because it wouldn’t achieve any of Apple’s stated goals, like high performance and type-safety? I used Smalltalk-80 extensively back in th

Re: Scary Stuff!

2015-06-17 Thread Jens Alfke
> On Jun 17, 2015, at 1:17 PM, Doug Hill wrote: > > For most of the security problems, you could rewrite your app to opt-out of > the insecure APIs, system services, etc. and use your own implementation. > (see Google Chrome not storing passwords in the Keychain anymore) Does it? I’m using Ch

Re: How to check if super exists if it doesn't without throwing an exception?

2015-06-18 Thread Jens Alfke
> On Jun 18, 2015, at 1:06 PM, Alex Zavatone wrote: > > I've got some spooky code that I'm digging into that calls an instance method > in an uninstantiated timer class I’m not clear on what that means. If the class doesn’t have any instances, how are you calling an instance method on it? >

Re: How to check if super exists if it doesn't without throwing an exception?

2015-06-18 Thread Jens Alfke
> On Jun 18, 2015, at 1:26 PM, Alex Zavatone wrote: > > Any reason you can think of why it would intermittently throw an exception? What is the exception? Can you show us the logs and a backtrace? (That should be the first thing you do in any question regarding an exception…) —Jens __

Re: Getting a server to trust the client. (iOS)

2015-06-22 Thread Jens Alfke
> On Jun 22, 2015, at 6:43 AM, Alex Zavatone wrote: > > We're all familiar with using a SSL cert to get a client to trust a server, > but we're looking at is getting a server to trust that a trusted client is > allowed to access it. Yup, that’s SSL (or TLS) client certificate authentication.

Re: Changing NSImageView's default background fill color

2015-06-22 Thread Jens Alfke
> On Jun 22, 2015, at 4:25 PM, Carl Hoefs > wrote: > > I have a (subclassed) NSImageView in an NSWindow, and when it displays an > image that doesn’t fit proportionally it will show a mid-gray background fill > color around the image, apparently by default. Did you change the imageFrameStyl

Re: C Assert in BSD Static Library

2015-06-23 Thread Jens Alfke
Define the preprocessor symbol NDEBUG, and assert( ) calls will be ignored. It’s simplest to add this in the Build Settings under “Preprocessor Macros”, only for the Release configuration. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Why would creating NSItemReplacementDirectory fail?

2015-06-24 Thread Jens Alfke
Anyone know what would cause NSFileManager (on OS X 10.10) to fail to create an NSItemReplacementDirectory? We’re using this call to create a temporary directory to save an intermediate file into, and it works fine on iOS and Mac … except for right now, when it’s started reliably failing on my M

Re: Why would creating NSItemReplacementDirectory fail?

2015-06-24 Thread Jens Alfke
Never mind, I figured it out by running fs_usage to watch what was going on. There were already 1000 of those “(A Document Being Saved By xctest %d)” directories in the TemporaryItems directory, so apparently it gave up. The underlying problem is that our code isn’t deleting those temporary dire

Re: Swift and parameter names

2015-06-24 Thread Jens Alfke
> On Jun 24, 2015, at 2:09 PM, Rick Mann wrote: > > But I don't understand the need to require the use of external names at the > call site. If there's enough information available to the compiler at the > call site to unambiguously choose a function or method to call, why must I > supply the

Re: Email editor view

2015-06-26 Thread Jens Alfke
> On Jun 26, 2015, at 1:45 PM, Nick wrote: > > Would experienced developers suggest is the best way to have an email > editor view, similar to what Apple Mail app has? What would be the best way > to give the users a similar to Apple Mail experience? You’ll need a WebView if you want to handle

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