Re: Category errata in Objective-C

2019-04-03 Thread David Hoerl
I've had to do some funky things with categories in the past, in at least one case because some framework had added one but for complex reasons could not import. So, similar to what Jens said: The interface description of the category is for the sole purpose of helping the compiler generate a

Is "-init" really needed?

2017-08-07 Thread David Hoerl
I recently saw some code where an object was alloced but there was no init: Foo *foo = [Foo alloc]; foo.bar = ... My blood pressure soared! My pulse quickened! I started breathing rapidly! But then I though - heck, if Foo has NSObject as its super class, gee, maybe -init isn't really

Repository of older (outdated) PDF Guides?

2017-04-25 Thread David Hoerl
I've googled til my fingers are black and blue, but no luck finding some of the older PDF guide documents. I could never express in words how disappointed I am that Apple discontinued producing readable documentation - I use to crow about it to all my non-Apple dev friends. Anyway, does

Re: How to update UI from a background thread

2016-09-21 Thread David Hoerl
> How can I update my UI from a background thread? > > I have a method that does a LOT of intense processing, it calls a delegate method in my Window Controller which appends it to a Logging Scroll View, however nothing shows up in the Scroll View although it NSLog’s the string ok. ---

SOLVED: NSAttributedString: how to add an underline (dotted line) between tab stops?

2016-02-17 Thread David Hoerl
Is there a mechanism to do this? Even a gray solid underline that visually aligns the items works too (background image?) Serach the documentation for NSUnderlinePatternDot —Graham Thanks, What I had wanted was to place the underline style in the white space between two items that are

NSAttributedString: how to add an underline (dotted line) between tab stops?

2016-02-12 Thread David Hoerl
I want to build a table with a left identifier, then a tab stop (well actually a few), each having some text in it. What I'd dearly love to do is add a dotted line style underline that goes from the right position of the left most text then butts up to the tab stop to its right, up to the

UINavigationController, hidesBarsWhenVerticallyCompact, and "unhandled taps" - how to "handle" them

2015-11-10 Thread David Hoerl
Title pretty much says it - I have a UICollectionView, hidesBarsWhenVerticallyCompact = true. Rotate to hide the nav bar works fine. I can press and drag to scroll, no change. But if I tap on a cell, even if my code "handles the tap" by implementing the collection view delegate, the nav bar

Best practice for adjusting UIScrollView contentOffset in 'willTransitionToTraitCollection'

2015-11-10 Thread David Hoerl
I have a UIScrollView scrolled to the bottom of content - so the content bottom is at the bottom of the view - in a compact environment. When the view rotates to regular, the contentOffset is too large - so the bottom of the content appears in the middle of the view. Without hard coding nav

SOLVED: 'barHideOnSwipeGestureRecognizer' works with two UIScrollViews but not with two others

2015-11-08 Thread David Hoerl
On 11/6/15 1:17 PM, David Duncan wrote: On Nov 6, 2015, at 8:04 AM, David Hoerl <dho...@mac.com> wrote: I know this is an esoteric question. I enabled 'hidesBarsOnSwipe' in my MMSpreadSheet view controller. This UIView subclass has 4 UICollectionViews in it - two up top and two

'barHideOnSwipeGestureRecognizer' works with two UIScrollViews but not with two others

2015-11-06 Thread David Hoerl
I know this is an esoteric question. I enabled 'hidesBarsOnSwipe' in my MMSpreadSheet view controller. This UIView subclass has 4 UICollectionViews in it - two up top and two below. The top left 'corner' controller does not scroll, and the top right does not scroll vertically. Out of the box

Re: [SOLVED] How to get a condensed San Francisco UIFont?

2015-10-08 Thread David Hoerl
On 10/7/15 7:27 PM, Jens Alfke wrote: On Oct 7, 2015, at 4:01 PM, David Hoerl <dho...@mac.com <mailto:dho...@mac.com>> wrote: then add a "condensed" attribute: let fd2 = fd1.fontDescriptorByAddingAttributes[ the magic sauce ] I haven’t used this API, but from looking

How to get a condensed San Francisco UIFont?

2015-10-07 Thread David Hoerl
I'd like to do is get a condensed - or better yet - a bold (semi-bold) condensed version of the "San Francisco" system font. What I propose to do is get a "starter" font: let font = UIFont.preferredFontForTextStyle(UIFontTextStyleHeadline) then get the font descriptor: let fd1 =

Re: Anyone recommend Dash?

2015-07-09 Thread David Hoerl
I've been doing all my coding in Swift, and frankly, I couldn't live without Dash. It imports the Swiftdoc.org docset, and thus you have a handy reference to essentially all of the Swift.h file. For instance, you are working with an Array, and want to see all options to create one, etc. I

Can an use introspection to determine if its a production app from the App Store?

2014-10-30 Thread David Hoerl
Can an iOS app examine some property to determine if its been installed as a development style app (ie Test Flight, or Xcode, etc), or was installed via the App Store. [I support a library where the app is suppose to pass a flag, but clients are making errors...] David

Re: Can an use introspection to determine if its a production app from the App Store?

2014-10-30 Thread David Hoerl
); sandboxReceipt is also the name of the receipt file when running builds locally. On Thu, Oct 30, 2014 at 10:38 AM, David Hoerl dho...@mac.com mailto:dho...@mac.com wrote: Can an iOS app examine some property to determine if its been installed as a development style app (ie Test

iBeacons - can 100 different devices be active and seen by one device?

2014-07-16 Thread David Hoerl
I was talking to someone about an idea of giving everyone at a gathering - say 100 people - iBeacon pendants. An app would have a translation of everyone there along with their beacon ID, and show the 10 closest people to any given iOS device.. Would iOS be capabile of detecting 100 or so

Re: [ANN] WFBezierCombinatorics

2014-03-08 Thread David Hoerl
On 3/7/14, 10:43 PM, cocoa-dev-requ...@lists.apple.com wrote: I’ve written a category on NSBezierPath that allows boolean operations on paths (union, intersection, subtraction) which preserves curved elements throughout the operation and does not require flattening paths into line segments

Re: Mismatched viewWillAppear/viewDidDisapper calls possible?

2014-02-03 Thread David Hoerl
Date: Mon, 03 Feb 2014 10:42:47 -0800 From: Matt Neuburg m...@tidbits.com To: Rick Mann rm...@latencyzero.com Cc: cocoa-dev@lists.apple.com Dev cocoa-dev@lists.apple.com Subject: Re: Mismatched viewWillAppear/viewDidDisapper calls possible? Message-ID:

Autolayout wrt Cassowary

2013-10-25 Thread David Hoerl
There have been numerous posts on the internet saying that Apple used Cassowary as the basis of Autolayout. If so, then why isn't there any mention of this in the Autolayout document. Or was this a white room re-write? Cassowary is open source and as far as I can tell requires no

Re: Autolayout wrt Cassowary

2013-10-25 Thread David Hoerl
I believe there are other fora for shooting the breeze. — F NOTE: BELOW IS NOT A TECHNICAL POST PER SE - WILL BE LAST ONE FROM ME I hope this doesn't waste anyone else's time. This is absolutely technical in the sense that if so, it provides another resource to better understand the

How to get variably sized header in a UICollectionView supporting both orientations

2013-10-04 Thread David Hoerl
Becoming increasingly adept at autolayout but currently stumped. What I am trying to do is design a UICollectionView header that using constraints is suitable for portrait and landscape. I have a bunch of views in it, each grouped into a container view. What I'd like to do is when the view

Re: How to get variably sized header in a UICollectionView supporting both orientations

2013-10-04 Thread David Hoerl
I have a bunch of views in it, each grouped into a container view. What I'd like to do is when the view rotates, move the container views around. Currently this seems impossible because the size of the header (and footer) must be specified to the Flow Layout before the view is even created,

Re: How to get variably sized header in a UICollectionView supporting both orientations

2013-10-04 Thread David Hoerl
On 10/4/13 5:09 PM, Steve Christensen wrote: On Oct 4, 2013, at 1:52 PM, David Hoerl dho...@mac.com wrote: But its really odd - and I'm thinking about a bug report on this - that the delegate has to provide the size before the view is even created. It make sense if you think about it: it's

Re: Instruments, how to fix leak in C Lib

2012-05-02 Thread David Hoerl
Look at Valgrind - it works on the Mac now. What you do is have a demo app or even a GUI that launches, runs, then quits. You enter your app and args as arguments to valgrind when you run it. Valgrind monitors every malloc, and when the app/program quits tells you not only what leaks you

Cannot modify autoresizing with some iOS views

2011-11-18 Thread David Hoerl
I have a Xcode 4.2 project with a dozen or so nibs. I'm in the process of assuring that all the resizing is set up properly. I find that a small number of primary views - the one attached to the view outlet - have fixed autoresizing masks, and while I can set or unset the four outter

Why does changing a UIScrollView's contentInset change contentOffset?

2011-11-08 Thread David Hoerl
I just had a lovely time trying to figure out why my UITableView was snapping back to 0,0 when the keyboard was going away. In the end I had recently modified my code to use contentInset (and scrollIndicatorInsets) when the keyboard was visible. Using lldb with a breakpoint on

Can I jsut use @2x images without supplying a @1x image?

2011-10-21 Thread David Hoerl
I noticed by accident that everything seems to work just fine if I supply a im...@2x.png in my iOS code, reference as normal [UIImage imageNamed:@image.png], even if I'm targetting code at a non-retina iPhone. So, is this really acceptable? In virtually every image I have, the 1x image is

NSManagedObject subclass mysteriously notifies observers for non-modeled properties

2010-05-21 Thread David Hoerl
Before doing my latest project, I poured over the Model Object Implementation Guide and the NSManagedObject Class Reference. Both documents state categorically that NSManagedObjects do NOT automatically provide KVO notification unless one overrides +(BOOL)automaticallyNotifiesObserversForKey.

Re: NSManagedObject subclass mysteriously notifies observers for non-modeled properties

2010-05-21 Thread David Hoerl
On 5/21/10 9:10 AM, Mike Abdullah wrote: What does +contextShouldIgnoreUnmodeledPropertyChanges return for your class? I am wondering if the two are interlinked. This was an oversight on my part - this app is targeted at 10.5 (and thus uses the 10.5 SDK.) That Class method is not defined for

Scripting Bridge to Mail using predicates question

2010-05-19 Thread David Hoerl
I'd like to use Scripting Bridge to find messages in Mail's Inbox that have attachments with a certain suffix (e.g., txt) and ultimately retrieve just those. When I get a reference to Inbox, what I want (in plain English) is ALL messages that have at least one attachment whose name ends in

Re: Zeroing out instance variables

2010-04-17 Thread David Hoerl
This probably takes more time than allocating a new object :-) My company uses it to scramble memory for invalidated objects that hang around for a while, to force crashes if accessed (id object addresses will be bogus). David --- void clearIvars(id obj) { unsigned int outCount = 0;

NSPredicate/NSExpression - can they solve this Core Data problem?

2010-04-02 Thread David Hoerl
Objects: - NSManagedObject *item - some managaged object - NSArray *attributes - an array of the item's attributes Desired Result: - a possibly smaller array of attribites where [item valueForKey:an attribute] != nil. In code, I can simply iterate over the keys, perform the valueForKey,

Re: NSPredicate/NSExpression - can they solve this Core Data problem?

2010-04-02 Thread David Hoerl
Having the array of attributes unrolled separately is a little odd. Do you mean you have an array of attribute names from, say the entity, and you want to ask a MO for all its non-nil attribute values and get back an array of matching attribute names for those non-nil values? - Ben

NSCollectionView and animating spinner crash

2010-03-08 Thread David Hoerl
I am getting consistent crashes when a newly created NSCollectionViewItem has a view with an animating spinner (the animation property is enabled through bindings that kick in immediately on creation). It happens on 10.5 as well as 10.6. [ rdar://7727603 bug has demo project included]. Log

Re: programatically show NSSegmentedCell menu?

2010-03-06 Thread David Hoerl
[This is for the archives - to finish off an unresolved thread] [Keywords programatically show display NSSegmentedCell NSSegmentedControl menu performClick ] The way to have the segmented cell open a menu is to do it in two steps: [segmentedControl setSelectedSegment:0]; // set the desired

Binding to a released object results in crash - how do find the observer?

2010-02-23 Thread David Hoerl
I had an issue (since resolved) where an object set a property to nil directly, without providing KVO notification. Later, the app crashed: Running with debug and Zombies enabled got me here: -[NSKeyValueObservance retain]: message sent to deallocated instance In the end, I discovered that

Re: capturing a partial screen.

2009-09-04 Thread David Hoerl
The solution is (using the original OpenGLScreenCapture project code) to modify this statement in FrameReader.m: glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, 0, 0, mWidth, mHeight); to glCopyTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, 100, 50, mWidth+100, mHeight+50); where

Re: Cocoa and email (SMTP/POP3)

2009-06-24 Thread David Hoerl
Look at the EDMessage class: http://www.mulle-kybernetik.com/software/EDFrameworks/ . You need its sibling class EDCommon too. With that Cocoa framework, you can send email through a SMTP access point using various types of security - it works with .mac and google too. I know these work as I

Programmatically creating a NSMatrix with a prototype cell question

2009-06-20 Thread David Hoerl
Create a NSTextFieldCell and customize it. Create a NSMatrix using the prototype init version, and display it. All the custom formatting is gone - all cells are vanilla NSTextFieldCells. Loop through the matrix, and set each cell to a copy of the cell I used as a prototype, using the

Re: microsoft file formats in cocoa

2009-05-17 Thread David Hoerl
The libxls open source project on sourceforge.net allows you to read and parse .xls files. This library works under OSX - I know, I'm one of the developers :-) David ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Implementing NSOutlineView autosaveExpandedItems with CoreData

2009-04-03 Thread David Hoerl
[for the archives - old thread] This is a brute force mechanism to save the expanded NSOutlineView items prior to changing a Managed Object context and then restoring them after the modification. - (id)expandedState { NSMutableArray *state = [NSMutableArray array]; NSInteger count =

NSTreeController with useLazyEvaluation failure

2009-03-25 Thread David Hoerl
Using 10.5.6, my inspection panel has a NSTreeController that has two bindings - ContentSet and Parameter (the first to a set of objects, the latter to the manageObjectContext). Using NSLog's I have verified the bindings are correct. The problem comes when I set Uses Lazy Evaluation (ala

Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate

2009-03-06 Thread David Hoerl
[following up to a Jan 08 thread] is it possible to modify the width of the NSTextField representing a Number in a NSPredicateEditorRowTemplate ? Yes, but not yet in Interface Builder. To do so programatically, get the row template, get the text field as the last member of the row

Re: Exel and PowerPoint (??????? ???????)

2009-03-02 Thread David Hoerl
Hello. Are there any abstractions in Cocoa to open and handle Exel and PowerPoint files? Thank you. Timofey. Well, there are ways to read and write excel files - look on sourceforge for libxls and xlslib (the first library can read an .xls file, and xlslib can write one). I contribute to

Re: NSRunloop performSelector needs CFRunLoopWakeUp ?

2009-01-25 Thread David Hoerl
Thanks to those who have posted on this, and suggested workarounds. However, in a simple non-threaded app, this call should work, no? And perhaps the 0 time timer would also suffer the same fate. The project has a checkbox so the user can enable the CFWakeup. To convince myself this was not

NSRunloop performSelector needs CFRunLoopWakeUp ?

2009-01-24 Thread David Hoerl
I have a few hundred tasks to handle, and am using NSRunLoop's performSelector to get the scheduled: -(void)nextTask:(SEL)sel { [[NSRunLoop mainRunLoop] performSelector:sel target:self argument:nil order:0 modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]]; CFRunLoopRef crf

Re: Cocoa Support for Mail

2009-01-07 Thread David Hoerl
Cocoa provides the NSMailDelivery class to support sending email from a Cocoa application. Is there an analog for receiving email? what is the best way for the application to receive emails? Look at EDMessage - for historical information look at this page:

cocoadev.com status?

2008-11-25 Thread David Hoerl
I recently tried to update a page on cocoadev.com, but the changes didn't take. I looked at the Recent Changes page and the latest is October 23rd. There is no obvious contact - I did send a email to Panic but have not heard back. Anyone know what's going on? David

CATextLayers text alignment?

2008-10-11 Thread David Hoerl
I'm using a CATextLayer to display some text which the user can change the font size of. When the user changes the font size, I still want my text to be centered, both vertically and horizontally. As far as I know you can only set the the CATextLayers alignmentMode to kCAAlignmentCenter to

No action msg after NSPathControl Choose

2008-09-09 Thread David Hoerl
The NSPathControl.h file says that when in Popup mode, the control will send a action message. However, I cannot get it to work. I've tried using no types, and a type of public.folder. Is this a known problem? I was able to create a hack work-around: use the NSPathControl delegate method -

Re: Regular Expressions?

2008-06-06 Thread David Hoerl
dream cat7 wrote: I agree that to be able to use that syntax is highly desirable, and indeed missing from all the cocoa libraries that I have looked at. One way would be a category addition to NSString class, which would call the perl -pe 's/\b(.*?)/\u\L$1/g' for you and return the

Re: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-04 Thread David Hoerl
There is an open source option in the works. Look at EDMessage on: http://www.mulle-kybernetik.com/software/EDFrameworks/ You will see three open source frameworks. EDMessage provides equivalent if not more functionality than NSMailDelivery by directly interacting with a SMTP server.

[SOLVED2] Code to convert NSDictionary to binary plist file?

2008-06-04 Thread David Hoerl
[For the archives, or anyone else interested in this topic] Ken Thomases provided a shorter version, by having the NSData instance write the file. Jean-Daniel Dupas suggested using CFPropertyListWriteToStream to bypass the intermediate NSData object (a speed and memory footprint improvement)

Code to convert NSDictionary to binary plist file?

2008-06-03 Thread David Hoerl
I'm using [NSDictionary writeToFile:...] to save a fairly large dictionary as a text plist file. I found a quick and dirty hack to convert it into a binary formatted file: strcpy(command, /usr/bin/plutil -convert binary1 ); strcat(command, fileName); ret = system(command); Yeah, I

[SOLVED] Code to convert NSDictionary to binary plist file?

2008-06-03 Thread David Hoerl
I never did get a pointers to code to convert a NSDictionary to a binary formatted plist, but did get pointers to look at NSPropertyListSerialization - something I had already (mis)read a few times. The description for the dataFromPropertyList class method seems confusing if you don't

Re: How to send email without using email client

2008-05-09 Thread David Hoerl
I have the same need and am trying to resurrect EDMessage (whose project does not now even compile). Just a quick note - this capability is of great value when your code is running on some server inside a firewall, and you want to get periodic status messages (and that server itself does not

[ANN] Media App Developer position (Northern NJ)

2008-04-25 Thread David Hoerl
Position: Media Application Developer - MacOS Expert Location: Northern, NJ Duration: Contract – 2 – 3 months with possible extension To apply for this position please forward your resume in WORD format referring the position the position title above to: [EMAIL PROTECTED] Due

Core Data and indexed attributes question (from a CD noobie)

2008-03-08 Thread David Hoerl
I cannot find nothing in the Xcode user documentation, the Core Data documentation, nor on this list that explain what the Indexed checkbox in Xcode 3's Attribute panel is for. A link or short explanation would be helpful. Thanks! David ___