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

2015-06-13 Thread Carl Hoefs
> On Jun 13, 2015, at 3:27 PM, Paul Scott wrote: > > Swift insinuates itself into the developer community with typical grandiose > marketing hype. But what practical value does it really offer? What failing, > besides a distaste of Objective-C by some — excluding myself — required a > whole n

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

2015-06-13 Thread Carl Hoefs
Thanks for the informative listing. So Swift offers refinements (not a paradigm shift like object orientation over functional), many of which could be added to ObjC, and many of which I wouldn’t want. I guess I was trying to find the main, overwhelming purpose driving the adoption of Swift. I th

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

2015-06-15 Thread Carl Hoefs
Consider: If you were tasked to choose a language for a project based only on a "features list", you'd still have no assurances the language would be appropriate for the project or that you would be able to accomplish the project in a timely manner. Features do not equate to usability or product

Obtaining an CIImage from an unbounded CIFilter?

2015-06-19 Thread Carl Hoefs
I'm using CoreImage in a Cocoa app and I’m trying to obtain the outputImage (CIImage) of a CICircleSplashDistortion CIFilter. I know that there are certain filters whose output is unbounded, such as this one. So how do I manage such a filter’s outputImage? : CGImageProviderCreate: invalid image

Changing the color of an NSWindow’s titlebar text

2015-06-22 Thread Carl Hoefs
I’m trying to change the color of an NSWindow’s titlebar text. The background of the window is dark gray, making the default black color of the titlebar text unreadable. Is there a programmatic way to do this? Or in IB a user defined runtime attribute keypath? -Carl _

Re: Changing the color of an NSWindow’s titlebar text

2015-06-22 Thread Carl Hoefs
ted a [NSWindow setTitleColor:]. There’s been no activity on that bug > since, but if you file a new one it might get marked as duplicate! > > On Jun 22, 2015, at 2:32 PM, Carl Hoefs > wrote: > >> I’m trying to change the color of an NSWindow’s titlebar text. The >> bac

Changing NSImageView's default background fill color

2015-06-22 Thread Carl Hoefs
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. Is there any way I can change that background fill color? To either 0 alpha or black? The fol

Re: Changing the color of an NSWindow’s titlebar text

2015-06-22 Thread Carl Hoefs
> On Jun 22, 2015, at 4:31 PM, Quincey Morris > wrote: > > On Jun 22, 2015, at 16:17 , Carl Hoefs <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> Thanks. It looks like that’s what I will have to do! > > Other possibilities that occur to me: &g

Re: Changing NSImageView's default background fill color

2015-06-22 Thread Carl Hoefs
> On Jun 22, 2015, at 4:45 PM, Jens Alfke wrote: > > >> On Jun 22, 2015, at 4:25 PM, Carl Hoefs > <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> I have a (subclassed) NSImageView in an NSWindow, and when it displays an >> image that doesn

Re: Changing the color of an NSWindow’s titlebar text

2015-06-22 Thread Carl Hoefs
> On Jun 22, 2015, at 4:49 PM, Quincey Morris > wrote: > > On Jun 22, 2015, at 16:39 , Carl Hoefs <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> Where might I find info on the API that Safari uses? > > It’s not Safari-specific, it’s a new

Errors resulting from Cocoa datatype changes 10.9 -> 10.10

2015-07-06 Thread Carl Hoefs
We have a legacy Cocoa library of mathematical algorithms that has worked fine since OS X 10.6, but running this same code on 10.10 results in odd numerical errors (that is, incorrect results). I'm thinking this could be the result of differences in ILP32 vs LP64? The code variables are ints and p

iOS 8.4: Converting a URL into a PHAsset

2015-07-28 Thread Carl Hoefs
I'm trying to get an NSURL into PHAsset form, but I keep coming up with null. PHAsset fetchAssetsWithALAssetURLs: takes an NSArray of NSURLs: "An array of NSURL objects, each an asset URL previously retrieved from an ALAsset object." Apparently, this is not a simple array of NSURL objects. How c

Re: iOS 8.4: Converting a URL into a PHAsset

2015-07-29 Thread Carl Hoefs
> On Jul 28, 2015, at 11:59 PM, Ben Kennedy wrote: > > On 28 Jul 2015, at 7:17 pm, Carl Hoefs wrote: >> >> I'm trying to get an NSURL into PHAsset form, but I keep coming up with >> null. PHAsset fetchAssetsWithALAssetURLs: takes an NSArray of NSURLs: "A

Re: iOS 8.4: Converting a URL into a PHAsset

2015-07-29 Thread Carl Hoefs
> On Jul 28, 2015, at 11:59 PM, Ben Kennedy wrote: > >> PHAssetChangeRequest *assetRequest = [PHAssetChangeRequest >> creationRequestForAssetFromVideoAtFileURL: self.sourcePlayListItem.url]; >> PHObjectPlaceholder *assetPlaceholder = >> assetRequest.placeholderForCreatedAsset; >> /* treat asse

Re: iOS 8.4: Converting a URL into a PHAsset

2015-07-29 Thread Carl Hoefs
> On Jul 29, 2015, at 10:26 AM, Ben Kennedy wrote: > > On 29 Jul 2015, at 8:47 am, Carl Hoefs wrote: > >> Ultimately, I'm simply trying to delete the asset: >> [PHAssetChangeRequest deleteAssets:@[asset]]; > > But you don't yet HAVE an asset; you see

Re: iOS 8: Can any of you guys think of why an async creation of a UIAlert would generate an exception on a show?

2015-07-29 Thread Carl Hoefs
Could this issue be due to whatever reason Apple deprecated UIAlertView in iOS 8? "Important: UIAlertView is deprecated in iOS 8. (Note that UIAlertViewDelegate is also deprecated.) To create and manage alerts in iOS 8 and later, instead use UIAlertController with a preferredStyle of UIAlertCon

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

2015-07-29 Thread Carl Hoefs
> On Jul 29, 2015, at 10:30 PM, Joar Wingfors wrote: > >> On 29 Jul 2015, at 16:52, Jens Alfke wrote: >> >>> On Jul 29, 2015, at 4:32 PM, Roland King 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 bot

Recurrent NSInvocationOperations on an NSOperationQueue?

2015-08-14 Thread Carl Hoefs
I'm trying to automatically re-queue an NSInvocationOperation to an NSOperationQueue every n seconds, but I can't get it to work. For the purpose of serializing exclusive access to a specific resource, I have a single-threaded background NSOperationQueue with parameters: - maxConcurrentOperation

Re: Recurrent NSInvocationOperations on an NSOperationQueue?

2015-08-14 Thread Carl Hoefs
> On Aug 14, 2015, at 4:15 PM, Ken Thomases wrote: > > You'll need to create a new operation each time you want to queue a > particular invocation. Yes, I'm doing that. The problem is finding a mechanism to re-queue a new operation from the current one after it is done, so the queue can be em

Re: Recurrent NSInvocationOperations on an NSOperationQueue?

2015-08-14 Thread Carl Hoefs
> On Aug 14, 2015, at 5:46 PM, Carl Hoefs > wrote: > > >> On Aug 14, 2015, at 4:15 PM, Ken Thomases wrote: >> >> You'll need to create a new operation each time you want to queue a >> particular invocation. > > Yes, I'm doing that.

Re: Recurrent NSInvocationOperations on an NSOperationQueue?

2015-08-14 Thread Carl Hoefs
> On Aug 14, 2015, at 6:24 PM, Ken Thomases wrote: > > On Aug 14, 2015, at 8:07 PM, Carl Hoefs > wrote: > >> Here's what I'm trying to do, but in code rather than words: >> >> . . . >> [self doStatusChecks]; // start endless checking

Re: Recurrent NSInvocationOperations on an NSOperationQueue?

2015-08-14 Thread Carl Hoefs
> On Aug 14, 2015, at 7:01 PM, Ken Thomases wrote: > > On Aug 14, 2015, at 8:43 PM, Carl Hoefs > wrote: > > You can use a serial GCD queue for the same purpose with my above > suggestions. But even if you want to keep using an NSOperationQueue, you can > still use

Using alarm(3) on background NSOperationQueue threads

2015-08-20 Thread Carl Hoefs
From within a background NSOperationQueue thread, the effects of alarm(3) seem to be ignored. (I use alarm() to interrupt certain system calls like connect() when they stall.) The alarm fires, the alarm handler is invoked, but the ongoing sys call is not interrupted, as it would be normally. Is

Re: Using alarm(3) on background NSOperationQueue threads

2015-08-21 Thread Carl Hoefs
> On Aug 20, 2015, at 5:55 PM, Ken Thomases wrote: > > On Aug 20, 2015, at 7:29 PM, Carl Hoefs > wrote: >> >> From within a background NSOperationQueue thread, the effects of alarm(3) >> seem to be ignored. (I use alarm() to interrupt certain system calls like

-forceCancel an NSOperation

2017-03-01 Thread Carl Hoefs
The NSOperation -cancel and NSOperationQueue -cancelAllOperations methods merely set a property that needs to be periodically and cooperatively checked and acted upon by the receiving NSOperation. Normally, that is sufficient. But under some circumstances, it's possible for an executing NSOper

Re: -forceCancel an NSOperation

2017-03-01 Thread Carl Hoefs
> On Mar 1, 2017, at 2:56 PM, Doug Hill wrote: >> >> On Mar 1, 2017, at 2:44 PM, Wim Lewis wrote: >> > On Mar 1, 2017, at 2:32 PM, Ken Thomases wrote: Very sound reasoning, all. Thanks much for your insights! This is a multi-tasking server of sorts that runs different analysis algorithms o

NSMutableData +dataWithLength: sets errno?

2017-03-14 Thread Carl Hoefs
macOS 10.12.3, Xcode 8.2.1, ObjC I'm finding the following line to be problematic: NSMutableData *myData = [NSMutableData dataWithLength:80]; I assume this ends up calling calloc(3) to allocate and zero out the data. But for some reason, it's always setting errno to a seemingly random nonze

Re: NSMutableData +dataWithLength: sets errno?

2017-03-14 Thread Carl Hoefs
> On Mar 14, 2017, at 4:27 PM, Greg Parker wrote: > >> >> On Mar 14, 2017, at 4:08 PM, John McCall > <mailto:rjmcc...@apple.com>> wrote: >> >>> On Mar 14, 2017, at 7:00 PM, Carl Hoefs >> <mailto:newsli...@autonomy.caltech.edu>> wrot

UITextField width of UIAlertController -addTextFieldWithConfigurationHandler:

2017-03-20 Thread Carl Hoefs
iOS 10.2.1 I'm using UIAlertController -addTextFieldWithConfigurationHandler: to display an alert with a textfield. Is there any way to shorten the width of the displayed textfield? I've tried setting its frame/bounds, but it has no effect. -Carl _

Re: UITextField width of UIAlertController -addTextFieldWithConfigurationHandler:

2017-03-21 Thread Carl Hoefs
wrote: > > I haven’t tested this, but have you tried calling [self layoutIfNeeded] in > the completion block of [self presentViewController:animated:completion]? > > Saagar Jha > >> On Mar 20, 2017, at 16:09, Carl Hoefs > <mailto:newsli...@autonomy.ca

Re: UITextField width of UIAlertController -addTextFieldWithConfigurationHandler:

2017-03-21 Thread Carl Hoefs
cting. - Carl > On Mar 21, 2017, at 12:12 PM, Carl Hoefs > wrote: > > Thanks for the hint. In the debugger I discovered that what looks to be a > UITextField displayed across the bottom of the alert is actually implemented > as a private object of class UIAlertControllerTextField.

Re: UITextField width of UIAlertController -addTextFieldWithConfigurationHandler:

2017-03-21 Thread Carl Hoefs
houldBeginEditing. > Saagar Jha > >> On Mar 21, 2017, at 12:24, Carl Hoefs > <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> Alternately, is there a way to configure the alert to defer the launch of >> the keyboard until/unless the user wants to edit the te

Binary floating point format

2017-03-30 Thread Carl Hoefs
I have megabytes of raw legacy science datasets that I'm trying to read into my app and ingest into an array of doubles. The data is supposed to be organized as a stream of 8-byte doubles. I do not know how these datasets were generated, so I don't know what format (big/little endian, byte swapp

Re: Binary floating point format

2017-03-30 Thread Carl Hoefs
> On Mar 30, 2017, at 6:40 PM, Steve Bird wrote: > > >> On Mar 30, 2017, at 8:25 PM, Carl Hoefs >> wrote: >> >> I have megabytes of raw legacy science datasets that I'm trying to read into >> my app and ingest into an array of doubles. The data

Re: Binary floating point format

2017-03-30 Thread Carl Hoefs
> On Mar 30, 2017, at 7:04 PM, Greg Parker wrote: > > Simply shuffling VAX bytes and interpreting as an IEEE double would be > misleadingly close but still wrong. You are right. Without anything to go on, it's a hopeless task. I really need to bump this back and try to get a hold of somebody

Re: Binary floating point format

2017-03-30 Thread Carl Hoefs
> On Mar 30, 2017, at 8:10 PM, Greg Parker wrote: > >> >> On Mar 30, 2017, at 7:09 PM, Carl Hoefs > <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> >>> On Mar 30, 2017, at 6:40 PM, Steve Bird >> <mailto:sb...@culverson.com>

Re: Binary floating point format

2017-03-30 Thread Carl Hoefs
> On Mar 30, 2017, at 9:06 PM, Greg Parker wrote: > > >> On Mar 30, 2017, at 9:03 PM, Carl Hoefs > <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >>> On Mar 30, 2017, at 8:10 PM, Greg Parker >> <mailto:gpar...@apple.com>>

Re: How to validate Core Data attributes ? (example in official doc doesn't work)

2017-06-14 Thread Carl Hoefs
> On Jun 14, 2017, at 12:26 AM, Quincey Morris > wrote: > > On Jun 13, 2017, at 23:54 , Glen Huang wrote: >> >> what do you use instead of Core Data? > > I ended up writing my own object graph framework. Interestingly, many parts > of the implementation fell naturally into the same mechanis

AVCaptureMovieFileOutput + encryption

2017-06-22 Thread Carl Hoefs
iOS 10.3.2 Using AVFoundation, I've set up an AVCaptureSession, and added an AVCaptureMovieFileOutput to it. This stores the recorded video in the sandbox as a movie file. Is it possible to add encryption to this chain, so the movie file is written out encrypted? -Carl

Re: AVCaptureMovieFileOutput + encryption

2017-06-23 Thread Carl Hoefs
> On Jun 22, 2017, at 11:30 PM, Jens Alfke wrote: > >> On Jun 22, 2017, at 5:18 PM, Carl Hoefs > <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> Is it possible to add encryption to this chain, so the movie file is written >> out encrypted?

Re: AVCaptureMovieFileOutput + encryption

2017-06-23 Thread Carl Hoefs
> On Jun 23, 2017, at 10:33 AM, Steve Bird wrote: > >> On Jun 23, 2017, at 1:22 PM, Carl Hoefs >> wrote: > >> I'm currently recording 1280x720 at 240fps H.264 video on the iPhone > > Just curious - can you tell us what you are recording at 240 fps ? &g

Re: AVCaptureMovieFileOutput + encryption

2017-06-23 Thread Carl Hoefs
> On Jun 23, 2017, at 11:18 AM, Quincey Morris > wrote: > > On Jun 23, 2017, at 10:51 , Carl Hoefs <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> it analyses specific processes in the body which are indicative of a certain >> pathology >

Re: AVCaptureMovieFileOutput + encryption

2017-06-23 Thread Carl Hoefs
> On Jun 23, 2017, at 11:58 AM, Jens Alfke wrote: > >> On Jun 23, 2017, at 10:22 AM, Carl Hoefs > <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> At this high frame rate, I'm expecting that callbacks would not be able to >> keep up in

Single-channel video recording in iOS?

2017-06-23 Thread Carl Hoefs
iOS 10.3.2 I'd like to do monochrome (or single channel red) video recording, but it seems iOS does not support this. According to AVCaptureVideoDataOutput -availableVideoCVPixelFormatTypes, the only supported pixel format types available for the iPad Pro in iOS 10.3.2 are: '420v' - kCVPix

Re: Is "-init" really needed?

2017-08-07 Thread Carl Hoefs
> On Aug 7, 2017, at 5:17 PM, じょいすじょん > wrote: > >> >> On Aug 8, 2017, at 9:09, Jens Alfke wrote: >> >> >>> On Aug 7, 2017, at 5:02 PM, David Hoerl wrote: >>> >>> But then I though - heck, if Foo has NSObject as its super class, gee, >>> maybe -init isn't really need. I mean, if all of F

AirPrint in iOS 11?

2018-05-11 Thread Carl Hoefs
Is printing from iOS still possible? Is AirPrint still a viable SDK to use? I can get AirPrint to bring up a printer selection screen, but it won't actually select a printer. I present the printer selection screen: UIPrinterPickerController *printPicker = [UIPrinterPickerContro

Re: AirPrint in iOS 11?

2018-05-11 Thread Carl Hoefs
As an addendum: I've verified that I can print from the iPhone Photos app to my printer using AirPrint. The issue is doing it programmatically. > On May 11, 2018, at 5:50 PM, Carl Hoefs > wrote: > > Is printing from iOS still possible? Is AirPrint still a viable SDK to use

Re: AirPrint in iOS 11?

2018-05-11 Thread Carl Hoefs
ess. -Carl > On May 11, 2018, at 5:55 PM, Alex Zavatone wrote: > > I did it a few months ago. Have you tried the sample code? > > https://developer.apple.com/library/content/samplecode/PrintBanner/Introduction/Intro.html#//apple_ref/doc/uid/DTS40013422 > >> On Ma

Re: AirPrint in iOS 11?

2018-05-11 Thread Carl Hoefs
y/content/samplecode/PrintBanner/Introduction/Intro.html#//apple_ref/doc/uid/DTS40013422 > >> On May 11, 2018, at 7:54 PM, Carl Hoefs >> wrote: >> >> As an addendum: I've verified that I can print from the iPhone Photos app >> to my printer using AirPri

NSData from dispatch_data_t?

2018-10-30 Thread Carl Hoefs
Is it possible to create an NSData object from a dispatch_data_t? I'm interfacing to a 3rd party library that returns only a dispatch_data_t object. Once upon a time you could simply cast that to (NSData *) and work with it that way, but Xcode now flags it as an error: dispatch_data_t data_

Re: NSData from dispatch_data_t?

2018-10-30 Thread Carl Hoefs
spatch_data_get_size(dispatch_data_t) on it which would let you create an > NSData object. > > https://developer.apple.com/documentation/dispatch/1452977-dispatch_data_get_size?language=objc > > -Ryan > > On Tue, Oct 30, 2018 at 7:26 PM Carl Hoefs > wrote: > I

Re: NSData from dispatch_data_t?

2018-10-30 Thread Carl Hoefs
> On Oct 30, 2018, at 7:49 PM, Greg Parker wrote: > > NSData *nsdata = (NSData *)data_t; > Yes! That works! (I thought I had tried the explicit cast, but I guess I hadn't...) Thanks!! -Carl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple

NSImage to JPEG file?

2019-01-14 Thread Carl Hoefs
I have a background macOS daemon process (aka Foundation-based "command line tool") that needs to write out a JPEG file to local disk. The image resides in an NSImage object (or alternatively, an NSData of raw RGB image data). Short of resorting to something like libjpeg, what is the ObjC way t

Re: NSImage to JPEG file?

2019-01-14 Thread Carl Hoefs
Got it working! Thanks, that's the tip I needed. -Carl > On Jan 14, 2019, at 1:26 PM, Vince DeMarco wrote: > > Use ImageIO. > > create a CGImageDestinationRef and add the CGImage to it. > > Vince > > > >> On Jan 14, 2019, at 12:17 PM, Carl Hoe

UIImagePickerController and 48-bit photos

2019-01-15 Thread Carl Hoefs
I've been tasked with scoping out creating an iPhone app that processes "48-bit" images or photos on the newer iPhones. (I unfortunately don't have a "newer" iPhone yet to try this out.) Questions: - Does the UIImagePickerController paradigm work transparently for such images, as it does for n

Re: NSImage to JPEG file?

2019-01-15 Thread Carl Hoefs
Using NSBitmapImageRep, is it possible to write the JPEG representation out to a .JPG file on disk? -Carl > On Jan 15, 2019, at 4:01 PM, Jens Alfke wrote: > > It’s been a long time since I worked with NSImages, but it’s easy to get a > JPEG representation using just plain AppKit. > > Just l

Re: NSImage to JPEG file?

2019-01-16 Thread Carl Hoefs
Thanks Wim and Gerd. It was the NSData tie-in I didn't know. (I was expecting NSImage to have innate export capabilities, but this works too.) -Carl > On Jan 16, 2019, at 7:56 AM, Wim Lewis wrote: > > On Tue, Jan 15, 2019 at 08:10:58PM -0700, Carl Hoefs wrote: >> Using

Re: NSImage to JPEG file?

2019-01-16 Thread Carl Hoefs
> On Jan 16, 2019, at 10:43 AM, Jens Alfke wrote: > >> On Jan 16, 2019, at 8:32 AM, Carl Hoefs > <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> It was the NSData tie-in I didn't know. (I was expecting NSImage to have >> innate export capa

Questions regarding the sandbox in iOS

2019-02-04 Thread Carl Hoefs
iOS 12 Q1. In general, is an iOS app expected to determine the sandbox path to manage its files? Q2. Does the sandbox behave like the "current working directory" default on macOS? (i.e., if a function writes out a file to just "filename" with no path, does it get written automatically to the

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Carl Hoefs
her > shared folders like Music and so on. > > NSString *appLibraryFolder = > [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, > YES) objectAtIndex:0]; > NSString *appDocumentsFolder = > [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomai

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Carl Hoefs
> On Feb 5, 2019, at 10:30 AM, Jens Alfke wrote: > >> On Feb 5, 2019, at 9:25 AM, Carl Hoefs > <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> The reason for the specific sandbox questions is that my iOS app needs to >> call 3rd-party func

Re: Questions regarding the sandbox in iOS

2019-02-05 Thread Carl Hoefs
invocations. Is there a temporary area available for use? -Carl > > Regards, > Saagar Jha > >> On Feb 4, 2019, at 19:30, Carl Hoefs > <mailto:newsli...@autonomy.caltech.edu>> wrote: >> >> iOS 12 >> >> Q1. In general, is an iOS app expecte

Setting the tag of an NSCell

2019-03-16 Thread Carl Hoefs
macOS 10.12, ObjC Is it not possible to set the tag of an NSImageCell at runtime? At runtime when I do "myCell.tag = val;" I get a warning: Stub implementation of -setTag by NSCell does nothing. I have an array of 48 NSImageCells. I can't hard-code them in Xcode because don't know the tag

Re: Setting the tag of an NSCell

2019-03-16 Thread Carl Hoefs
xception. Subclasses are expected to override this > property if they support tags > > If you want to use tags, you should subclass NSImageCell and implement -tag & > -setTag: to return your own ivar. Hope that helps. > > —Rob > > >> On Mar 16, 2019, at 7:03 P

Re: Setting the tag of an NSCell

2019-03-16 Thread Carl Hoefs
Subclassing worked perfectly! Thanks Rob! -Carl > On Mar 16, 2019, at 6:08 PM, Rob Petrovec wrote: > > If you want to use tags, you should subclass NSImageCell and implement -tag & > -setTag: to return your own ivar. Hope that helps. > ___ Cocoa

Moving cells in a UITableView

2019-05-16 Thread Carl Hoefs
iOS 12.2 I want to allow the user of my iPhone app to finger-reorder the rows in a UITableView. I set tableView.editing=YES, and I receive 2 callbacks for each row in the table: (1) -tableView:editingStyleForRowAtIndexPath: --> return UITableViewCellEditingStyleNone. (2) -tableView:canMoveRow

Re: Moving cells in a UITableView

2019-05-16 Thread Carl Hoefs
The problem boils down to this: If a UITableView doesn't have inner-width autoresizing enabled, the table won't get the 'move row' ability. Q: How can I set this property on the UITableView programmatically? -Carl > On May 16, 2019, at 2:29 PM, Carl Hoefs > wrote:

Re: Moving cells in a UITableView

2019-05-17 Thread Carl Hoefs
Is this a bug, or is it documented behavior? Without the following setting: self.tableView.autoresizingMask |= UIViewAutoresizingFlexibleWidth; a UITableView won't permit reordering of the table's cells. -Carl > On May 16, 2019, at 8:38 PM, Carl Hoefs > wrote: >

Re: Crashing in NSTabView

2019-05-22 Thread Carl Hoefs
> On May 22, 2019, at 11:31 AM, Daniel DeCovnick wrote: > > You can always subclass, turn off ARC for that file, and override -release or > -autorelease to breakpoint in. How does one turn off ARC for a specific file? -Carl ___ Cocoa-dev mailing l

iOS 7 GUI update lag during drag touches

2013-10-03 Thread Carl Hoefs
iOS 6.1.3 & 7.0.2, newb! I'm seeing an unacceptable lag in my iOS app on drag touches, from when a finger is dragged across the screen to when my code updates the screen. I can't figure out what is causing the lag. Here's my setup. I have a -touchesBegan:withEvent: method in my view controller

Re: iOS 7 GUI update lag during drag touches

2013-10-03 Thread Carl Hoefs
I meant to say -touchesMoved instead of -touchesBegan below. - Carl On Oct 3, 2013, at 12:47 PM, Carl Hoefs wrote: > iOS 6.1.3 & 7.0.2, newb! > > I'm seeing an unacceptable lag in my iOS app on drag touches, from when a > finger is dragged across the screen to when my co

Re: iOS 7 GUI update lag during drag touches

2013-10-03 Thread Carl Hoefs
Thanks, Julius! Now there's no response lag at all! - Carl On Oct 3, 2013, at 1:11 PM, Julius Oklamcak wrote: >> CGPoint apoint=[[touches anyObject] locationInView:[self view]]; >> [layer setPosition:apoint]; > > You need to disable implicit CALayer animation(s): > > [CATransaction begin]; >

Throttling iOS 7 event callbacks

2013-10-03 Thread Carl Hoefs
Is there a way in iOS 7 to throttle the event callback rate? I'm getting a maximum of 60 event callbacks per second when I slide my finger quickly across the screen. I'd like to limit that to a max of about 10/sec or so. Does iOS offer a setting to do this, or do I need to implement a throttling

Re: Throttling iOS 7 event callbacks

2013-10-03 Thread Carl Hoefs
Done. Thanks! - Carl On Oct 3, 2013, at 4:48 PM, Seth Willits wrote: > On Oct 3, 2013, at 3:56 PM, Carl Hoefs wrote: > >> Is there a way in iOS 7 to throttle the event callback rate? I'm getting a >> maximum of 60 event callbacks per second when I slide my finger

Receiving system notifications in 10.8

2013-10-10 Thread Carl Hoefs
How does one receive notifications from 10.8's new system-wide Notification Center? Is there a framework that allows a Cocoa program to receive system notifications, i.e., the ones that show automatically in the upper right hand of the screen? - Carl __

Re: Receiving system notifications in 10.8

2013-10-10 Thread Carl Hoefs
On Oct 10, 2013, at 9:28 PM, Jens Alfke wrote: > > On Oct 10, 2013, at 7:38 PM, Carl Hoefs > wrote: > >> How does one receive notifications from 10.8's new system-wide Notification >> Center? Is there a framework that allows a Cocoa program to receive system

Correctly setting UIViewController backgView.image size

2013-10-16 Thread Carl Hoefs
iPad 2 (non-retina), iOS 7.0.2, Xcode 5.0 I have a UIViewController that I'm setting the background image of: viewController.backgView.image=[UIImage imageNamed:@"background"]; The image is sized at 768x1024, which is the resolution of the iPad display. But when I run the app on the iPad (or s

Re: Correctly setting UIViewController backgView.image size

2013-10-16 Thread Carl Hoefs
The problem seems to be that the iPad & Simulator are running the app in 2X mode, not sure why. Perhaps best moved to the Xcode list. On Oct 16, 2013, at 1:37 PM, Carl Hoefs wrote: > iPad 2 (non-retina), iOS 7.0.2, Xcode 5.0 > > I have a UIViewController that I'm setting th

NSException category?

2014-02-06 Thread Carl Hoefs
I would like to be able to add additional context info to certain exceptions that the system might generate. Since NSException's userInfo dict is nil in such cases it would be convenient to add an error context dict to the exception and then handle/display it. @try { ...; } @catch (NS

Re: NSException category?

2014-02-06 Thread Carl Hoefs
create a new exception object of your custom > class MyUnsupportedSessionResolutionException with whatever user info you > want and re-throw that one. > > Good luck! > > Doug Hill > > On Feb 6, 2014, at 10:44 AM, Carl Hoefs > wrote: > >> I would like to be able to add additional c

Re: NSException category?

2014-02-06 Thread Carl Hoefs
On Feb 6, 2014, at 12:51 PM, Jens Alfke wrote: > But it would be more straightforward to create a new NSException object with > the same attributes as the one you caught but with your own info added to its > userInfo. On Feb 6, 2014, at 1:05 PM, Uli Kusterer wrote: > What NSError does in this

Serializing NSDictionary for network transfer

2014-05-07 Thread Carl Hoefs
OS X 10.9 Newb questions re: serializing an NSDictionary for network transfer to another process. I've read over the Apple documentation, but it seems to detail the methods involved but not how to use serialization, and some methods seem to require writing archives or plist files to disk. So, I

Re: Serializing NSDictionary for network transfer

2014-05-07 Thread Carl Hoefs
On May 7, 2014, at 11:21 AM, Joseph Dixon wrote: > Consider NSJSONSerialization. Hmm, I hadn't come across NSJSONSerialization. Looks straightforward to use. Thanks! -Carl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post adm

Re: Serializing NSDictionary for network transfer

2014-05-07 Thread Carl Hoefs
On May 7, 2014, at 11:38 AM, Wim Lewis wrote: > Depending on what is *in* your NSDictionary, though, a less opaque > serialization format might be better, such as one of the property-list > formats (see NSPropertyListSerialization) or even JSON. These formats can > only hold a small, non-exte

Re: Serializing NSDictionary for network transfer

2014-05-07 Thread Carl Hoefs
On May 7, 2014, at 12:06 PM, Alex Zavatone wrote: > If your dictionary has only text values, this should be no problem with the > NSJSONSerialization, but if you're sending images, you'll need to convert the > images to 16 bit encoded NSData objects. > > I guess the bigger question is, "what a

Re: Can't set UINavigationBar tint color?

2014-06-23 Thread Carl Hoefs
FWIW, for setting the UINavigationBar color you can specify any color as long as it's white. The -tintColor method appears to specify the color of the text within the navbar button items only. -Carl On Jun 23, 2014, at 6:08 PM, Rick Mann wrote: > I'm having a heck of a time setting the tint c

Re: Can't set UINavigationBar tint color?

2014-06-23 Thread Carl Hoefs
stack to make it easier > for my contained class to modify the items in the nav bar, and now there > seems to be no way to change the color. > > On Jun 23, 2014, at 18:34 , Carl Hoefs wrote: > >> FWIW, for setting the UINavigationBar color you can specify any color as >&g

Re: Can't set UINavigationBar tint color?

2014-06-23 Thread Carl Hoefs
2014, at 18:52 , Carl Hoefs wrote: > >> Are you on iOS 7? You're describing an iOS 6 behavior. Doing the following >> on iOS 7 (in -viewDidLoad): >> >> self.navigationController.navigationBar.tintColor = [UIColor redColor]; >> >> has no effect oth

Re: Can't set UINavigationBar tint color?

2014-06-23 Thread Carl Hoefs
Ah! You're a genius! It works perfectly! -Carl On Jun 23, 2014, at 6:56 PM, Rick Mann wrote: > Found it! It's "barTintColor"! > > Thanks for getting me to look in the headers! > > On Jun 23, 2014, at 18:56 , Carl Hoefs wrote: > >> -tintColor

Re: Can't set UINavigationBar tint color?

2014-06-23 Thread Carl Hoefs
too many platforms. > > On Jun 23, 2014, at 19:00 , Carl Hoefs wrote: > >> Ah! You're a genius! It works perfectly! >> -Carl >> >> On Jun 23, 2014, at 6:56 PM, Rick Mann wrote: >> >>> Found it! It's "barTintColor"! >>

Question on NSOutputStream -write:maxLength:

2014-07-02 Thread Carl Hoefs
I'm going through the Apple NSOutputStream online documentation. Below is "Listing 2: Handling a space-available event" (from https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/WritingOutputStreams.html) - (void)stream:(NSStream *)stream handleEvent:(NSStream

ImageIO errors generating UIImage from NSData from NSImage

2014-07-09 Thread Carl Hoefs
OS X 10.8.5, iOS 7.1.2 I have an OSX app that shows NSImages. When the user selects an image, it is transferred to an iOS device as an NSData and then turned into a UIImage and displayed onscreen. The problem is I can't get the conversion of NSImage to NSData to UIImage to work. I'm using a hom

Re: ImageIO errors generating UIImage from NSData from NSImage

2014-07-09 Thread Carl Hoefs
On Jul 9, 2014, at 1:29 PM, Jens Alfke wrote: > > On Jul 9, 2014, at 11:13 AM, Carl Hoefs > wrote: > >> -imageWithData: generates odd messages and returns NULL. >> : ImageIO: PNG PNG unsigned integer out of range >> : ImageIO: PNG [00][00][00][00]: invalid chun

[NSMutableData resetDataRangeTo:(NSRange)range];

2014-07-12 Thread Carl Hoefs
Basically what I would like is an NSMutableData method like this: - (void)resetDataRangeTo:(NSRange)range Parameters range The range within the contents of the receiver to be considered the new contents. But, since that doesn't exist yet, is it safe to "shift" the contents in place of an NSMut

Re: [NSMutableData resetDataRangeTo:(NSRange)range];

2014-07-12 Thread Carl Hoefs
On Jul 12, 2014, at 1:51 PM, Matt Gough wrote: > [bigData replaceBytesInRange:NSMakeRange(0, 1024) withBytes:NULL length:0]; Wow, I would never have thought to do that! Works perfectly! Thx, -Carl ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com

Re: [NSMutableData resetDataRangeTo:(NSRange)range];

2014-07-14 Thread Carl Hoefs
is well optimized for shunting its contents around > internally. > > Matt > > > On 12 Jul 2014, at 20:36, Carl Hoefs wrote: > >> Basically what I would like is an NSMutableData method like this: >> >> - (void)resetDataRangeTo:(NSRange)range >> >>

Re: [NSMutableData resetDataRangeTo:(NSRange)range];

2014-07-14 Thread Carl Hoefs
On Jul 14, 2014, at 11:22 AM, Mike Abdullah wrote: > [bigMData replaceBytesInRange:NSMakeRange(0,0) >withBytes:newBytesPtr > length:1024]; On Jul 14, 2014, at 11:23 AM, Ben Kennedy wrote: > [bigMData replaceBytesInRan

Re: [NSMutableData resetDataRangeTo:(NSRange)range];

2014-07-14 Thread Carl Hoefs
On Jul 14, 2014, at 11:35 AM, Ben Kennedy wrote: > On 14 Jul 2014, at 11:30 am, Carl Hoefs > wrote: > >>> [bigMData replaceBytesInRange:NSMakeRange(0,0) withBytes:newBytesPtr >>> length:1024]; >> >> Wow, that's damn clever! My thinking is so cl

Re: [NSMutableData resetDataRangeTo:(NSRange)range];

2014-07-14 Thread Carl Hoefs
On Jul 14, 2014, at 11:54 AM, Jens Alfke wrote: > > On Jul 14, 2014, at 11:48 AM, Carl Hoefs > wrote: > >> Yes, I guess it's the semantics that threw me. I was attempting to >> "insertBytesInRange" not "replaceBytesInRange", so I had it

Re: [NSMutableData resetDataRangeTo:(NSRange)range];

2014-07-14 Thread Carl Hoefs
On Jul 14, 2014, at 12:57 PM, "Gary L. Wade" wrote: > where you're creating the object On Jul 14, 2014, at 12:53 PM, Jens Alfke wrote: > If you’re the one creating the NSData object in the first place, can you > create it as an NSMutableData? Certainly that makes sense enough, just hoping

<    1   2   3   >