Re: Full-screen not working

2023-08-15 Thread Gary L. Wade via Cocoa-dev
I would suggest asking your user for a system report or sysdiagnose.  It might 
glean some details about their environment.
--
Gary

> On Aug 15, 2023, at 3:30 AM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> I have one user of my macOS app (under macOS 13.4.1) 
> where the app does not want to go into full-screen mode.
> 
> It is a pretty plain app.
> 
> In the AppDelegate's method -applicationWillFinishLaunching,
> I switch to full screen like this:
> 
>   [self.window toggleFullScreen: nil];  
> 
> It works, of course, all the time on my Mac; 
> also, as far as I know, there is only one user where it does not work.
> 
> After toggleFullScreen, I could check if the window is in full-screen, but I 
> don't see I would gain anything from that.
> The toggleFullScreen does not seem to provide any error value.
> 
> I have already googled, but it seems like what that user reports does not 
> happen anywhere else.
> 
> Is there anything that could prevent a window from going into fullscreen mode?
> 
> Best regards, Gabriel

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Retrieving the EXIF date/time from 250k images

2023-01-07 Thread Gary L. Wade via Cocoa-dev
You don’t seem to understand modern filesystems or modern hardware like some of 
us.
--
Gary L. Wade
https://www.garywade.com/ <http://www.garywade.com/>

> On Jan 7, 2023, at 3:29 PM, Gabriel Zachmann  wrote:
> 
> *Maybe* ...
> that would mean that the filesystem performs predictive caching like the 
> CPU's cache / memory management does ... 
> 
> Also, I think you might even get worse performance: imagine several threads 
> reading different files *at the same time* - those files could lie on 
> different HD cylinders far apart from each other, so the disk heads would 
> have to move back and forth during those concurrent read operations, wouldn't 
> it? unless the disk would do some very clever caching / batching / prediction 
> itself ...
> 
> G.
> 
>> Since file systems and the associated hardware are designed to be efficient 
>> by caching data and knowing things like where one file or block is in 
>> relation to another, there’s a possibility these mechanisms could work to 
>> your advantage, pulling in the data while “in the neighborhood.” There’s no 
>> guarantee, of course, but I feel it’s worth considering.
>> --
>> Gary L. Wade
>> http://www.garywade.com/
>> 
>>> On Jan 7, 2023, at 10:37 AM, Gabriel Zachmann via Cocoa-dev 
>>>  wrote:
>>> 
>>> So, why would would several threads loading those images in parallel help 
>>> here? In my thinking, they will just compete for the same resource, i.e., 
>>> hard disk.
>>> 
>> 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Retrieving the EXIF date/time from 250k images

2023-01-07 Thread Gary L. Wade via Cocoa-dev
Since file systems and the associated hardware are designed to be efficient by 
caching data and knowing things like where one file or block is in relation to 
another, there’s a possibility these mechanisms could work to your advantage, 
pulling in the data while “in the neighborhood.” There’s no guarantee, of 
course, but I feel it’s worth considering.
--
Gary L. Wade
http://www.garywade.com/

> On Jan 7, 2023, at 10:37 AM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> So, why would would several threads loading those images in parallel help 
> here? In my thinking, they will just compete for the same resource, i.e., 
> hard disk.
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Retrieving the EXIF date/time from 250k images

2022-08-15 Thread Gary L. Wade via Cocoa-dev
You should do any whitespace trimming first and be sure your date formatter is 
set correctly as any deviation will almost always fail.
--
Gary

> On Aug 15, 2022, at 2:51 AM, Gabriel Zachmann  wrote:
> 
> A detail I left out in-between: whitespace trimming.
> 
> Or, does anyone know if dateFromString will handle trailing/leading 
> whitespaces gracefully?

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Retrieving the EXIF date/time from 250k images

2022-08-14 Thread Gary L. Wade via Cocoa-dev
I noticed you release the fileProps but didn’t release the image, but I don’t 
know if that’s one of those details you left out for clarity.  Also, depending 
on some factors like mutability, while the initWithString call with a 
CFStringRef might essentially be a no-op, you can just do the typecast on the 
dateref and pass it directly into dateFromString.

One thing I’d suggest is to do the work for each image asynchronously on a 
background queue and have that block (essentially all of your for-loop code) 
report its completion by some asynchronous way like posting a notification on 
the original queue along with the result you care about, the parsed date 
associated with the particular file.  Let the original queue handle how to 
store each parsed date; it would probably be best to use a dictionary where the 
key was the filename and value is the date.  To prevent memory pressure, 
allocate your background queue so that it’s concurrent and autorelease 
frequency is set to be workItem.  If you want to be sure to know when 
everything’s done, you could use a DispatchGroup to track those and you could 
choose to pass back NSNull or nil for the parsed result if the date could not 
be parsed.

Of course, this will depend on if your file system is non-network-based and 
whether it’s SSD vs HD as well as other physical system factors.
--
Gary

> On Aug 14, 2022, at 2:22 PM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> I would like to collect the date/time stored in an EXIF tag in a bunch of 
> images.
> 
> I thought I could do so with the following procedure
> (some details and error checking omitted for sake of clarity):
> 
> 
>NSMutableArray * dates_and_times = [NSMutableArray arrayWithCapacity: 
> [imagefiles count]];
>CFDictionaryRef exif_dict;
>CFStringRef dateref = NULL;
>for ( NSString* filename in imagefiles )
>{
>NSURL * imgurl = [NSURL fileURLWithPath: filename isDirectory: NO];
> // escapes any chars that are not allowed in URLs (space, &, etc.)
>CGImageSourceRef image = CGImageSourceCreateWithURL( (__bridge 
> CFURLRef) imgurl, NULL );
>CFDictionaryRef fileProps = CGImageSourceCopyPropertiesAtIndex( image, 
> 0, NULL );
>bool success = CFDictionaryGetValueIfPresent( fileProps, 
> kCGImagePropertyExifDictionary, (const void **) & exif_dict );
>success = CFDictionaryGetValueIfPresent( exif_dict, 
> kCGImagePropertyExifDateTimeDigitized, (const void **) & dateref );
>NSString * date_str = [[NSString alloc] initWithString: (__bridge 
> NSString * _Nonnull)( dateref ) ];
>NSDate * iso_date = [isoDateFormatter_ dateFromString: date_str];
>if ( iso_date )
> [dates_and_times addObject: iso_date ];
>CFRelease( fileProps );
>}
> 
> 
> But, I get the impression, this code actually loads each and every image.
> On my Macbook, it takes 3m30s for 250k images (130GB).
> 
> So, the big question is: can it be done faster?
> 
> I know the EXIF tags are part of the image file, but I was hoping it might be 
> possible to load only those EXIF dictionaries.
> Or are the CGImage functions above already clever enough to implement this 
> idea?
> 
> 
> Best regards, Gab.
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Exception not being caught in try statement

2021-03-26 Thread Gary L. Wade via Cocoa-dev
Try surrounding the call with beginEditing and endEditing on the text storage. 
If it still happens, submit a feedback to Apple with the full crash log.
--
Gary L. Wade
http://www.garywade.com/

> On Mar 26, 2021, at 4:11 AM, Mark Allan via Cocoa-dev 
>  wrote:
> 
> Hi folks,
> 
> Some users are reporting a crash that I can't reproduce, and in an attempt to 
> gain additional diagnostics from a user, I wrapped the affected line in a 
> try/catch block.  For two users it resolve the crash, but for a third, it's 
> still crashing at the same point!
> 
> The crash occurs when a user attempts to open the "About" window from my 
> app's main menu item. I'm not using the standard about panel as there's a few 
> additional items I need to display, one of which is an NSTextView which I 
> populate with the contents of an RTF file from within the app bundle.
> 
> I've symbolicated the crash log to find it's happening when populating that 
> TextView. The line in question now reads as follows:
> 
>@try {
>[self.aboutBox.creditsTextView readRTFDFromFile:[[NSBundle mainBundle] 
> pathForResource:@"Credits" ofType:@"rtf"]];
>} @catch (NSException *exception) {
>NSLog(@"Error loading the contents of the text file for the About Box. 
> %@", exception);
>//Check we have a file at the expected path 
>if([[NSFileManager defaultManager] fileExistsAtPath:[[NSBundle 
> mainBundle] pathForResource:@"Credits" ofType:@"rtf"]]){
>NSLog(@"Yes. Found the RTF credits file");
>// check the attributes in case somehow there's no permission to 
> read the file
>NSDictionary *fileAttributes =[[NSFileManager defaultManager] 
> attributesOfItemAtPath:[[NSBundle mainBundle] pathForResource:@"Credits" 
> ofType:@"rtf"] error:nil];
>NSLog(@"RTF file has following attributes %@", fileAttributes);
>}
>else {
>NSLog(@"Nope, file not found");
>}
>}
> 
> This is the crash log from the newest build (with the try/catch around that 
> line):
> 
>> Performing @selector(showAboutBox:) from sender NSMenuItem 0x60634540
>> *** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
>> reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
>> terminating with uncaught exception of type NSException
>> abort() called
>> 
>> Application Specific Backtrace 1:
>> 0   CoreFoundation  0x7fff206ea6af 
>> __exceptionPreprocess + 242
>> 1   libobjc.A.dylib 0x7fff204223c9 
>> objc_exception_throw + 48
>> 2   CoreFoundation  0x7fff2079ea9a -[__NSCFString 
>> characterAtIndex:].cold.1 + 0
>> 3   CoreFoundation  0x7fff2079c953 -[__NSArrayM 
>> insertObject:atIndex:].cold.2 + 0
>> 4   CoreFoundation  0x7fff20610421 -[__NSArrayM 
>> insertObject:atIndex:] + 1135
>> 5   UIFoundation0x7fff23c223ab 
>> __defaultTabStops_block_invoke + 161
>> 6   libdispatch.dylib   0x7fff203cd7c7 
>> _dispatch_client_callout + 8
>> 7   libdispatch.dylib   0x7fff203ce96b 
>> _dispatch_once_callout + 20
>> 8   UIFoundation0x7fff23c229d7 
>> -[NSMutableParagraphStyle setTabStops:] + 199
>> 9   UIFoundation0x7fff23c3c697 -[NSRTFReader 
>> defaultParagraphStyle] + 75
>> 10  UIFoundation0x7fff23c3c5be -[NSRTFReader 
>> _mutableParagraphStyle] + 112
>> 11  UIFoundation0x7fff23c36113 controlClass + 
>> 1757
>> 12  UIFoundation0x7fff23c356b4 -[NSRTFReader 
>> attributedString] + 76
>> 13  UIFoundation0x7fff23c311a6 
>> _NSReadAttributedStringFromURLOrData + 3213
>> 14  UIFoundation0x7fff23d46985 
>> -[NSAttributedString(NSAttributedStringUIFoundationAdditions) 
>> initWithURL:options:documentAttributes:error:] + 228
>> 15  AppKit  0x7fff23677d9a -[NSTextView 
>> readRTFDFromFile:] + 126
>> 16  MyAppHere 0x000105fa18a7 MyAppHere+ 
>> 227495
>> 17  AppKit  0x7fff230af7fd 
>> -[NSApplication(NSResponder) sendAction:to:from:] + 283
>> 18  AppKit  0x7fff231b2611 -[NSMenuItem 
>> _corePerformAction] + 413
> 
> 
> Any ideas wh

Re: How to parse a log file

2020-10-26 Thread Gary L. Wade via Cocoa-dev

Line 7 appears to show your app allocating an array with one of its objects 
being nil.
--
Gary L. Wade
http://www.garywade.com/

> On Oct 26, 2020, at 3:02 PM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> From a user, I received a log file that contains an error (see below)
> and a stack trace of my macOS app.
> 
> Is it possible to determine the exact line in the source code where the error 
> occurred?
> 
> Best regards, Gabriel
> 
> 
> Encl:
> excerpt from log.
> "ArtSaverApp"  is my macOS app.
> 
> 
> 2020-10-23 10:47:30.410560-0400 0x2318dError   0x0  
> 6750   0ArtSaverApp: (AppKit) [com.apple.AppKit:General] *** 
> -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object 
> from objects[0]
> 2020-10-23 10:47:30.433412-0400 0x2318dError   0x0  
> 6750   0ArtSaverApp: (AppKit) [com.apple.AppKit:General] (
>0   CoreFoundation  0x7fff2d796b57 
> __exceptionPreprocess + 250
>1   libobjc.A.dylib 0x7fff664475bf 
> objc_exception_throw + 48
>2   CoreFoundation  0x7fff2d84559e -[__NSCFString 
> characterAtIndex:].cold.1 + 0
>3   CoreFoundation  0x7fff2d8438c4 
> -[__NSPlaceholderArray initWithCapacity:].cold.1 + 0
>4   CoreFoundation  0x7fff2d69a8ae 
> -[__NSPlaceholderArray initWithObjects:count:] + 154
>5   CoreFoundation  0x7fff2d6fff7e __createArray + 
> 47
>6   CoreFoundation  0x7fff2d6fff41 +[NSArray 
> arrayWithObject:] + 25
>7   ArtSaverApp 0x000109f12466 ArtSaverApp + 
> 46182
>8   ArtSaverApp 0x000109f1598d ArtSaverApp + 
> 59789
>9   AppKit  0x7fff2abcd7a7 
> -[NSApplication(NSResponder) sendAction:to:from:] + 299
>10  AppKit  0x7fff2abcd642 -[NSControl 
> sendAction:to:] + 86
>11  AppKit  0x7fff2abcd574 __26-[NSCell 
> _sendActionFrom:]_block_invoke + 136
>12  AppKit  0x7fff2abcd476 -[NSCell 
> _sendActionFrom:] + 171
>13  AppKit  0x7fff2abcd3bd -[NSButtonCell 
> _sendActionFrom:] + 96
>14  AppKit  0x7fff2abc969b 
> NSControlTrackMouse + 1745
>15  AppKit  0x7fff2abc8fa2 -[NSCell 
> trackMouse:inRect:ofView:untilMouseUp:] + 130
>16  AppKit  0x7fff2abc8e61 -[NSButtonCell 
> trackMouse:inRect:ofView:untilMouseUp:] + 691
>17  AppKit  0x7fff2abc81dd -[NSControl 
> mouseDown:] + 748
>18  AppKit  0x7fff2abc65f0 
> -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:] + 4914
>19  AppKit  0x7fff2ab30e21 
> -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:] + 2612
>20  AppKit  0x7fff2ab301c9 
> -[NSWindow(NSEventRouting) sendEvent:] + 349
>21  AppKit  0x7fff2ab2e554 
> -[NSApplication(NSEvent) sendEvent:] + 352
>22  AppKit  0x7fff2a97b5bf -[NSApplication 
> run] + 707
>23  AppKit  0x7fff2a94d396 
> NSApplicationMain + 777
>24  libdyld.dylib   0x7fff675efcc9 start + 1
> )
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Relieving memory pressure

2020-06-07 Thread Gary L. Wade via Cocoa-dev
The vast majority of data used by a CGImageRef for any sufficiently 
representable image is going to be its bitmap data (a 1x1 pixel image 
wouldn’t), and you can calculate that by using CGImageGetBytesPerRow and its 
neighbor APIs.  If I recall from your previous posts, you are showing very 
detailed scans of artwork.  I believe NASA has a similar conundrum with their 
telescope data; perhaps there’s some open source solutions there that might 
help with your particular needs?  Just a thought.  Another thing I’d consider 
(which I haven’t personally done) is looking at what Metal can provide; you 
might have to drop down to that level for your needs.  And it may be just as 
important if you have a system with multiple large-format screens with so much 
data.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>

> On Jun 7, 2020, at 5:31 AM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> Good question.
> 
> Well, some users want to feed my app with image files of 100 MB, even up to 
> 400 MB (mostly jpeg compressed).
> Those images have resolutions of over 8k, sometimes over 10k.
> 
> The slideshow app needs to be able to zoom into those images with at least a 
> factor 2x scaling.
> 
> So I figured that if someone has a 4k monitor, creating thumbnails with 8k 
> resolution maximum should be sufficient.
> 
> An 8k x 8k image needs at least 200 MB (1 byte per channel).
> I don't know how CGImage stores the uncompressed images internally,
> but my experience seems to indicate that it uses significantly more memory 
> than that.
> (maybe it uses two bytes per channel, or even floats, or there is some other 
> aux data)
> 
> 
>> 
>> What do you need a 1GB thumbnail for? There is no screen that can display 
>> that. For a slideshow app you could scale your thumbnails at creation time 
>> to the users biggest screen pixel size, don’t you think?
>> 
>> Christos Konidaris
>> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Localization under Catalina

2020-05-27 Thread Gary L. Wade via Cocoa-dev
Be sure you use leading and trailing rather than left and right for things that 
can change in direction for RTL. There are some small set of cases where you 
want left and right, but unless you’re aware of those, it’s best to always use 
leading and trailing.
--
Gary L. Wade
http://www.garywade.com/

> On May 27, 2020, at 12:51 PM, Rob Petrovec via Cocoa-dev 
>  wrote:
> 
> Plus it handles positioning views automagically between Left-To-Right 
> localizations like English and Right-To-Left localizations like Hebrew.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-24 Thread Gary L. Wade via Cocoa-dev
Also, did you take advantage of one of your free tech support incidents?
--
Gary L. Wade
http://www.garywade.com/

> On Apr 24, 2020, at 8:26 AM, Gary L. Wade via Cocoa-dev 
>  wrote:
> 
> That’s a very narrow view of reality, which I know to be far broader.
> 
> What’s the feedback number?
> --
> Gary
> 
>>> On Apr 24, 2020, at 8:01 AM, Allan Odgaard via Cocoa-dev 
>>>  wrote:
>> That said, I *have* filed a report about this, but I still seek more 
>> information about the issue, which I had hoped to get from this list, 
>> because I sure as hell am not going to get it via Apple’s bug reporting 
>> system.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-24 Thread Gary L. Wade via Cocoa-dev
That’s a very narrow view of reality, which I know to be far broader.

What’s the feedback number?
--
Gary

> On Apr 24, 2020, at 8:01 AM, Allan Odgaard via Cocoa-dev 
>  wrote:
> 
> That said, I *have* filed a report about this, but I still seek more 
> information about the issue, which I had hoped to get from this list, because 
> I sure as hell am not going to get it via Apple’s bug reporting system.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-24 Thread Gary L. Wade via Cocoa-dev
Here’s two web sites that should help you get the answer you want. Try one or 
both:

https://feedbackassistant.apple.com/welcome
https://www.apple.com/jobs/us/
--
Gary
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Gary L. Wade via Cocoa-dev
Have you tried a speed check with just iCloud turned off but internet on?
--
Gary
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-19 Thread Gary L. Wade via Cocoa-dev
Regardless of whatever workaround you find, I would second Rob’s suggestion to 
go ahead and file a bug with a sysdiagnose and/or spindump along with a sample 
app that reproduces it.  This isn’t expected behavior, and the teams at Apple 
are still working and would be very interested in seeing this.  Once filed, if 
you do find a workaround, you can append that to the bug.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>

> On Apr 19, 2020, at 10:58 AM, Allan Odgaard via Cocoa-dev 
>  wrote:
> 
> On 20 Apr 2020, at 0:37, Rob Petrovec wrote:
> 
>> >> I think you are right about this being a permission / “sandbox” issue, 
>> >> because the 3 folders in question are all folders that macOS 10.15 now 
>> >> require special permission to read (even though in my case, I just 
>> >> request their display name).
>>  Yes, this is because of iCloud.  Log out of iCloud and it should go 
>> away as I suggested in my first reply.  You could also grant your app full 
>> disk access and that might ‘fix’ it for you too.  But your users would 
>> probably not want to do that.
> 
> As written previously, there is no delay when running from terminal, and 
> ~/Downloads is also causing a delay, which is not stored on iCloud.
> 
> So this very much seems to be about Apple’s file system access policies where 
> permission must be obtained to access certain folders.
> 
> But as mentioned, I have given my app full disk access, reset permissions, 
> and I have even signed and notarized the app: Still no fix for the delay.
> 
> To indulge you, I have now also tried to log out of iCloud: Still a delay.
> 
> Now I would very much appreciate if someone would try the code I included in 
> my original email to see if this is a general problem, or something limited 
> to my system.
> 
> As I think I mentioned, I am running a fairly clean install of macOS 10.15.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Catalina scroll view issues

2019-12-19 Thread Gary L. Wade via Cocoa-dev
Interesting.  This could be a layering issue then, and it could be due to a 
configuration unique to your customer’s setup.  Since you’re doing things on a 
lower level than expected, there may be some nuance you need to add or 
something Apple needs to fix that may work fine using higher level frameworks.  
Since there’s lots of little things going on, it definitely warrants a feedback 
report.  Please add its number to your reply when you submit it.

FYI, Apple has been putting a lot of effort to support RTL better; in one of 
this year’s early general presentations at WWDC, you might have seen an 
engineer talking about RTL support within the App Store on all devices (well, 
maybe not the HomePod, of course), and the labs definitely had staff there to 
help.  Where you may find your implementation better than what you see in the 
frameworks, please write as many feedback reports as needed so all developers 
can benefit from the desired changes.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>

> On Dec 19, 2019, at 6:09 AM, Redler Eyal  wrote:
> 
>>> 
>>> OK, I'll try to get the sysdiagnose from my users before submitting. I must 
>>> say I'm really skeptic regarding the relation with my use of CG. It is not 
>>> that CG is not used by CT and everything else is also using CG.
>> 
>> CG may not be the issue… and I cannot offer a better suggestion, but when I 
>> rule out a possibility without proof, it usually turns out that I over look 
>> the solution to the problem.  Good luck!
> 
> You're right, and I wasn't ruling it out. I actually sent my user a special 
> build with an defaults option to turn off page drawing (so the page views are 
> not doing any drawing CG or otherwise), the issue persists.
> 
> I also tried to see this issue while doing remote access using anyDesk, for 
> some reason, the issue never showed up, when I disconnected, it showed up 
> again.
> 
> Eyal
> 
> 
> 
>> Sandor
>> 
>>> The way it looks it seems very much related to the scrolling mechanism, the 
>>> pre-rendered portion is not rendered but for some reason the scrolling 
>>> mechanism thinks that it is. I really don't see how a core-graphic issue, 
>>> and certainly not a misuse on my part could cause a view to be partially 
>>> rendered.
>>> BTW, do you think this type of issue is appropriate for a DTS incident?
>>> 
>>>> Here’s the developer release notes for Catalina:
>>>> https://developer.apple.com/documentation/macos_release_notes/macos_catalina_10_15_release_notes
>>> 
>>> Thanks. I saw that but I recall that in the past you used to have app-kit 
>>> specific release notes which were usually more detailed. 
>>> 
>>>> As an aside, it would be helpful to know why you chose CG for text 
>>>> rendering. CT has gotten better with RTL and bidi text, but if you saw 
>>>> particular issues there, reports about those can help everyone.
>>> 
>>> When I started developing this app (2002), there was no choice other then 
>>> CG since core text didn't exist and the other technologies didn't support 
>>> Hebrew and RTL well, if at all. So I wrote my own text engine and this was 
>>> very good for me commercially as my app was the the first and only 
>>> word-processor to support Hebrew (and later Arabic) properly on Max OS X. I 
>>> had a similar experience with OpenType which was not initially supported 
>>> and that also gave me an edge. As time passed Apple did improve the RTL 
>>> support and was offering more APIs so theoretically I could have rewritten 
>>> my code to use the new APIs but in reality I actually did the opposite and 
>>> relied less on Apple's APIs (for example, parsing 'cmap' tables) because 
>>> there were always bugs and even regressions which could render my app 
>>> unusable upon an OS upgrade. Beyond the bugs, I think my RTL is better, or 
>>> at least as far as I'm concerned as a native Hebrew speaker and having such 
>>> low-level control over something that is core to my app is essential IMO.
>>> 
>>> Eyal Redler
>>> 
>>> "If Uri Geller bends spoons with divine powers, then he's doing it the hard 
>>> way."
>>> --James Randi
>>> www.eyalredler.com
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>>> Gary L. Wade
>>>> http://www.garywade.com/
>>>> 
>>>>>> On Dec 17, 2019, at 2:12 AM, Redler Eyal  wrote:
>

Re: Catalina scroll view issues

2019-12-17 Thread Gary L. Wade via Cocoa-dev
Since you’re using CoreGraphics, it’s very likely there’s an edge case with 
your customers’ systems that you aren’t encountering.  CG is pretty much the 
lowest practical level in the graphics stack. Since your app does reproduce the 
issue but in other configurations than yours, you could still add it, but if 
you can include the system configuration data from About This Mac and data 
files from those affected customers, as well as screen shots, it can help. You 
might be asked for a sysdiagnose after the problem happens, so consider asking 
your customers to provide that as well.

Here’s the developer release notes for Catalina:
https://developer.apple.com/documentation/macos_release_notes/macos_catalina_10_15_release_notes

As an aside, it would be helpful to know why you chose CG for text rendering. 
CT has gotten better with RTL and bidi text, but if you saw particular issues 
there, reports about those can help everyone.
--
Gary L. Wade
http://www.garywade.com/

> On Dec 17, 2019, at 2:12 AM, Redler Eyal  wrote:
> 
> I am drawing using core graphics. I tried turning copiesOnScroll and this 
> didn't seem to help.
> 
> I'll gladly write a feedback report but I'm not able to reproduce this so I 
> can't give an xcode project that will reproduce this... Isn't that a 
> requirement?
> 
> BTW, perhaps you know: Are there no release notes for app kit with Catalina? 
> All I can find are very general notes without mention of any specific API. I 
> could not find, for example, any mention of the deprecation of copiesOnScroll 
> and what it means (is is not always on, always off etc)
> 
> Thanks,
> 
> Eyal
> 
>> On 16 Dec 2019, at 16:07, Gary L. Wade  wrote:
>> 
>> If you’re not involving a higher level class like NSTextView or a medium 
>> level one like CoreText, it sounds like you might be going all the way down 
>> to CoreGraphics? If so, you might find your disparity between your system 
>> and your users in things like retina choice for a particular display and 
>> changes with respect to layers, especially things like the copiesOnScroll. 
>> If these don’t lead you to a solution where you say, “Oh, I really should’ve 
>> done this rather than that,” (20/20 hindsight) then write up a feedback 
>> report and add its URL here.
>> --
>> Gary L. Wade
>> http://www.garywade.com/
>> 
>>>> On Dec 16, 2019, at 1:03 AM, Redler Eyal via Cocoa-dev 
>>>>  wrote:
>>> 
>>> Thanks!
>>> I don't use CoreText or NSTextView. I pretty much ruled out RTL vs LTR 
>>> issues since this is showing up in documents containing either and both. 
>>> I'm also unable to imagine how some text drawing code could produce such 
>>> artifacts as splitting a subview in the middle.
>>> (http://eyalredler.com/stuff/catalina_glitch.png)
>>> 
>>> Eyal
>>> 
>>> 
>>> 
>>> 
>>>> On 14 Dec 2019, at 21:20, Gary L. Wade  
>>>> wrote:
>>>> 
>>>> I see from your personal web site you know Hebrew. Is it possible the 
>>>> affected/non-drawing pages contain some RTL text while those that don’t 
>>>> only contain LTR? I have seen some bugs with RTL text within NSTextView 
>>>> where the text was/wasn’t drawing in a similar manner. Do you operate at a 
>>>> CoreText level?
>>>> --
>>>> Gary L. Wade
>>>> http://www.garywade.com/
>>>> 
>>>>>> On Dec 14, 2019, at 6:17 AM, Redler Eyal via Cocoa-dev 
>>>>>>  wrote:
>>>>> 
>>>>> Hi All,
>>>>> 
>>>>> I'm getting reports from users complaining about a strange display issue 
>>>>> on Catalina with my app.
>>>>> My app is a word-processor (not based on the cocoa text system) whose 
>>>>> main display shows the pages of the document. Every page is a separate 
>>>>> view and all the pages are subviews of one big view which resides inside 
>>>>> a scroll view.
>>>>> 
>>>>> The problem is that when with some documents, sometimes, when the user 
>>>>> scrolls down the document, some pages are not drawn or even partially 
>>>>> drawn. When the user clicks the place where the page is supposed to 
>>>>> appear, it shows up.
>>>>> Another interesting bit is seems that while the scroll view background is 
>>>>> drawn, the document views (the view containing the page views) drawRect 
>>>>> is not called or at least not taking effect, I can tell because the pages 
>>>>> on this view cast a shadow wh

Re: Catalina scroll view issues

2019-12-16 Thread Gary L. Wade via Cocoa-dev
If you’re not involving a higher level class like NSTextView or a medium level 
one like CoreText, it sounds like you might be going all the way down to 
CoreGraphics? If so, you might find your disparity between your system and your 
users in things like retina choice for a particular display and changes with 
respect to layers, especially things like the copiesOnScroll. If these don’t 
lead you to a solution where you say, “Oh, I really should’ve done this rather 
than that,” (20/20 hindsight) then write up a feedback report and add its URL 
here.
--
Gary L. Wade
http://www.garywade.com/

> On Dec 16, 2019, at 1:03 AM, Redler Eyal via Cocoa-dev 
>  wrote:
> 
> Thanks!
> I don't use CoreText or NSTextView. I pretty much ruled out RTL vs LTR issues 
> since this is showing up in documents containing either and both. I'm also 
> unable to imagine how some text drawing code could produce such artifacts as 
> splitting a subview in the middle.
> (http://eyalredler.com/stuff/catalina_glitch.png)
> 
> Eyal
> 
> 
> 
> 
>> On 14 Dec 2019, at 21:20, Gary L. Wade  wrote:
>> 
>> I see from your personal web site you know Hebrew. Is it possible the 
>> affected/non-drawing pages contain some RTL text while those that don’t only 
>> contain LTR? I have seen some bugs with RTL text within NSTextView where the 
>> text was/wasn’t drawing in a similar manner. Do you operate at a CoreText 
>> level?
>> --
>> Gary L. Wade
>> http://www.garywade.com/
>> 
>>>> On Dec 14, 2019, at 6:17 AM, Redler Eyal via Cocoa-dev 
>>>>  wrote:
>>> 
>>> Hi All,
>>> 
>>> I'm getting reports from users complaining about a strange display issue on 
>>> Catalina with my app.
>>> My app is a word-processor (not based on the cocoa text system) whose main 
>>> display shows the pages of the document. Every page is a separate view and 
>>> all the pages are subviews of one big view which resides inside a scroll 
>>> view.
>>> 
>>> The problem is that when with some documents, sometimes, when the user 
>>> scrolls down the document, some pages are not drawn or even partially 
>>> drawn. When the user clicks the place where the page is supposed to appear, 
>>> it shows up.
>>> Another interesting bit is seems that while the scroll view background is 
>>> drawn, the document views (the view containing the page views) drawRect is 
>>> not called or at least not taking effect, I can tell because the pages on 
>>> this view cast a shadow which is drawn by drawing blank squares on the 
>>> document view with a transparency layer.
>>> Last bit of info, copiesOnScroll set to NO for this view and I see that 
>>> this property is deprecated on Catalina.
>>> 
>>> So far I'm struggling with this for a couple of weeks, I wasn't able to 
>>> reproduce this at all on my machine.
>>> I'm really desperate for an answer and while I'm not expecting anyone here 
>>> to provide me with one (wouldn't object, of course :-)) I would love if 
>>> people reading this might try to speculate to the causes of this or perhaps 
>>> if you have any direction as to what to test on my users machines in order 
>>> to be able to reproduce this.
>>> 
>>> Thanks
>>> 
>>> Eyal Redler
>>> 
>>> "If Uri Geller bends spoons with divine powers, then he's doing it the hard 
>>> way."
>>> --James Randi
>>> www.eyalredler.com
>> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Catalina scroll view issues

2019-12-14 Thread Gary L. Wade via Cocoa-dev
I see from your personal web site you know Hebrew. Is it possible the 
affected/non-drawing pages contain some RTL text while those that don’t only 
contain LTR? I have seen some bugs with RTL text within NSTextView where the 
text was/wasn’t drawing in a similar manner. Do you operate at a CoreText level?
--
Gary L. Wade
http://www.garywade.com/

> On Dec 14, 2019, at 6:17 AM, Redler Eyal via Cocoa-dev 
>  wrote:
> 
> Hi All,
> 
> I'm getting reports from users complaining about a strange display issue on 
> Catalina with my app.
> My app is a word-processor (not based on the cocoa text system) whose main 
> display shows the pages of the document. Every page is a separate view and 
> all the pages are subviews of one big view which resides inside a scroll view.
> 
> The problem is that when with some documents, sometimes, when the user 
> scrolls down the document, some pages are not drawn or even partially drawn. 
> When the user clicks the place where the page is supposed to appear, it shows 
> up.
> Another interesting bit is seems that while the scroll view background is 
> drawn, the document views (the view containing the page views) drawRect is 
> not called or at least not taking effect, I can tell because the pages on 
> this view cast a shadow which is drawn by drawing blank squares on the 
> document view with a transparency layer.
> Last bit of info, copiesOnScroll set to NO for this view and I see that this 
> property is deprecated on Catalina.
> 
> So far I'm struggling with this for a couple of weeks, I wasn't able to 
> reproduce this at all on my machine.
> I'm really desperate for an answer and while I'm not expecting anyone here to 
> provide me with one (wouldn't object, of course :-)) I would love if people 
> reading this might try to speculate to the causes of this or perhaps if you 
> have any direction as to what to test on my users machines in order to be 
> able to reproduce this.
> 
> Thanks
> 
> Eyal Redler
> 
> "If Uri Geller bends spoons with divine powers, then he's doing it the hard 
> way."
> --James Randi
> www.eyalredler.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Difficulties with recovering NSAttributedString attachments from saved RTFD

2019-11-29 Thread Gary L. Wade via Cocoa-dev
While it may seem redundant, what if you specify the document type in the 
document attributes?  Also, you’re storing UTF8 data in the contents but 
specifying plain text; what if you specify it as UTF8 plain text?

Also, the source code for TextEdit is available somewhere; maybe try seeing 
what it’s doing.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>

> On Nov 27, 2019, at 11:35 AM, Gary L. Wade via Cocoa-dev 
>  wrote:
> 
> You want to use a file wrapper rather than data and specify the document type 
> in the attributes as RTFD.
> --
> Gary L. Wade
> http://www.garywade.com/ <http://www.garywade.com/>
> 
>> On Nov 27, 2019, at 10:18 AM, Jeff Younker via Cocoa-dev 
>>  wrote:
>> 
>> I am having some difficulty with saving NSAttributedStrings as RTFD and
>> then recovering
>> them with attachments intact.  I generate a string containing an attachment
>> and turn that into
>> RTFD. When I turn that RTFD back into an NSAttributedString, I get the
>> .string back, and I
>> get an attachment, but the attachment's .contents is empty.
>> 
>> This is the smallest example I can come up with:
>> 
>> func testSaveAndRestoreAttachment() {
>> // Build up the string "deadbeefdeadbeef"
>> let originalContent = "foobar".data(using: .utf8)
>> let originalAttachment = NSTextAttachment(
>>   data: originalContent, ofType: "public.plain-text")
>> let originalString = NSMutableAttributedString(string: "deadbeef")
>> originalString.append(NSMutableAttributedString(attachment:
>> originalAttachment))
>> originalString.append(NSMutableAttributedString(string: "deadbeef")
>> 
>> // save string as RTFD (note that generated RTFD contains "foobar"
>> inside.)
>> let savedRtfd = originalString.rtfd(from:
>> NSRange(0..> 
>> // Recover string
>> let recoveredString = NSAttributedString(rtfd: savedRtfd,
>> documentAttributes: nil)!
>> // Implementation of attachments() can be found below.
>> let recoveredAttachments = attachments(from: recoveredString)
>> // There *is* an attachment!
>> let recoveredAttachment = recoveredAttachments[0]
>> // Want to get Data("foobar") but actually get nil :(
>> XCTAssertNotNil(recoveredAttachment.contents)
>> }
>> 
>> When I print out the RTFD I can see the document includes the attachment
>> "foobar".
>> 
>> I'm assuming that I need to pass some additional information when I
>> call NSAttributedString(rtfd:,
>> documentAttributes:)
>> but I'm at a loss here.
>> 
>> Am I missing something simple? Perhaps a magical setting to be passed in
>> documentAttributes?
>> 
>> -jeff
>> 
>> 
>> 
>> ** This is the attachments() function used above:
>> 
>> func attachments(from s: NSAttributedString) -> Array {
>>   var attachments: Array = []
>>   s.enumerateAttribute(.attachment, in: NSRange(0..>   value, range, stop in
>>   guard let a = value else {
>>  return
>>   }
>>   attachments.append(a as! NSTextAttachment)
>>   }
>>   return attachments
>> }
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Difficulties with recovering NSAttributedString attachments from saved RTFD

2019-11-27 Thread Gary L. Wade via Cocoa-dev
You want to use a file wrapper rather than data and specify the document type 
in the attributes as RTFD.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>

> On Nov 27, 2019, at 10:18 AM, Jeff Younker via Cocoa-dev 
>  wrote:
> 
> I am having some difficulty with saving NSAttributedStrings as RTFD and
> then recovering
> them with attachments intact.  I generate a string containing an attachment
> and turn that into
> RTFD. When I turn that RTFD back into an NSAttributedString, I get the
> .string back, and I
> get an attachment, but the attachment's .contents is empty.
> 
> This is the smallest example I can come up with:
> 
> func testSaveAndRestoreAttachment() {
>  // Build up the string "deadbeefdeadbeef"
>  let originalContent = "foobar".data(using: .utf8)
>  let originalAttachment = NSTextAttachment(
>data: originalContent, ofType: "public.plain-text")
>  let originalString = NSMutableAttributedString(string: "deadbeef")
>  originalString.append(NSMutableAttributedString(attachment:
> originalAttachment))
>  originalString.append(NSMutableAttributedString(string: "deadbeef")
> 
>  // save string as RTFD (note that generated RTFD contains "foobar"
> inside.)
>  let savedRtfd = originalString.rtfd(from:
> NSRange(0.. 
>  // Recover string
>  let recoveredString = NSAttributedString(rtfd: savedRtfd,
> documentAttributes: nil)!
>  // Implementation of attachments() can be found below.
>  let recoveredAttachments = attachments(from: recoveredString)
>  // There *is* an attachment!
>  let recoveredAttachment = recoveredAttachments[0]
>  // Want to get Data("foobar") but actually get nil :(
>  XCTAssertNotNil(recoveredAttachment.contents)
> }
> 
> When I print out the RTFD I can see the document includes the attachment
> "foobar".
> 
> I'm assuming that I need to pass some additional information when I
> call NSAttributedString(rtfd:,
> documentAttributes:)
> but I'm at a loss here.
> 
> Am I missing something simple? Perhaps a magical setting to be passed in
> documentAttributes?
> 
> -jeff
> 
> 
> 
> ** This is the attachments() function used above:
> 
> func attachments(from s: NSAttributedString) -> Array {
>var attachments: Array = []
>s.enumerateAttribute(.attachment, in: NSRange(0..value, range, stop in
>guard let a = value else {
>   return
>}
>attachments.append(a as! NSTextAttachment)
>}
>return attachments
> }

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Future of Cocoa

2019-11-21 Thread Gary L. Wade via Cocoa-dev
INCREDIBLY ridiculous! If I weren’t paid well and have a great, fulfilling job 
working on all of Apple’s platforms, I’d be tempted to make a competitive 
version of some of these develops’ apps to show how the difficulty in doing so 
is blown so out of proportion!

It sounds like some people need to join a weekend hackathon to exercise their 
skills! For a fun one, do a search for Flickr SharkFeed.
--
Gary L. Wade
http://www.garywade.com/

> On Nov 21, 2019, at 6:02 PM, Jim Crate via Cocoa-dev 
>  wrote:
> 
> On Nov 21, 2019, at 5:43 PM, Pascal Bourguignon via Cocoa-dev 
>  wrote:
> 
>> The Apple ecosystem implies an extraordinary maintenance load. 
>> Specifically, your application must provide enough revenue to pay for a 
>> couple of developpers only to track the changes Apple makes to the API, and 
>> update it on each new version of the system (which occur about yearly).
>> So, count about 100,000 €/year to 200,000 €/year.
>> If your application doesn’t provide this profit, then you cannot follow, 
>> and it will quickly be dropped from the the AppStore.
> 
> This is pretty ridiculous.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Future of Cocoa

2019-11-21 Thread Gary L. Wade via Cocoa-dev
I find the arguments here interesting. If I were to develop an OpenGL-based 
app, I would probably need at least a week to get something basic working, and 
I’m sure that applies to pretty much anyone. If someone can spend time learning 
an SDK like OpenGL, then I don’t see what’s the problem with studying anything 
else important for one’s work.
--
Gary L. Wade
http://www.garywade.com/

> On Nov 21, 2019, at 12:21 PM, Pier Bover via Cocoa-dev 
>  wrote:
> 
> I won't respond each of you one by one but here are a couple of
> observations.
> 
> Metal is not a cross platform technology hence why so many projects still
> rely on OpenGL in macOS (eg: Firefox).
> 
> I don't understand those "the writing was in the wall" type of comments.
> Even if you think something was obvious all along the indisputable truth is
> we only have guesses and rumors. It's mind blowing that anyone making
> business decisions would be ok with this uncertainty.
> 
> If someone can afford days/weeks to do watch WWDC sessions consistently
> every year it's great. That's not a luxury all of us can afford and it's
> ridiculous to think this should be a requirement.
> 
> Some will argue "just jump on SwiftUI". Well a) SwiftUI is not mature and
> b) best case scenario it will take 2-3 years before it has support for more
> than 60-70% of macOS users. In certain industries (such as audio) the
> majority of users will not update past Mojave for many years because that
> would imply letting go of expensive hardware.
> 
> Anyway, I won't be annoying you anymore with what I believe are valid
> concerns. It's time for me to leave this mailing list.
> 
> I wish you all the best.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Future of Cocoa

2019-11-20 Thread Gary L. Wade via Cocoa-dev
> On Nov 20, 2019, at 8:29 AM, Pier Bover via Cocoa-dev 
>  wrote:
> 
> The vast majority of developers do not go to the WWDC and do not have time
> to watch the dozens (hundreds?) of hours of videos to maybe find something
> relevant about the future of macOS dev.

In that case, scan through the online transcripts, which are searchable, and 
the keynotes of the presentations.

Really, no one has any excuse. Either use what’s available and submit feedback 
when something isn’t clear or quit developing software.
--
Gary L. Wade
http://www.garywade.com/
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Future of Cocoa

2019-11-19 Thread Gary L. Wade via Cocoa-dev
There seems to be a misunderstanding that just because the word “Cocoa” doesn’t 
appear, nor "Objective-C” in the latest WWDC videos to a great extent, that 
they are no longer relevant.  If you watch any of the videos to the end, you’ll 
notice that rather than repeating every detail every year, the sessions instead 
reference previous years’ videos.  Since previous WWDC conferences have covered 
a lot more Objective-C and core Cocoa frameworks and they’re all available and 
free, why would anyone spend time repeating things when there’s plenty of new 
things to discuss?  An enterprising user would go back and watch the previous 
years’ sessions if they need that information.

By the way, the WWDC app on iOS, tvOS, and watchOS has been updated to be the 
Apple Developer App.

Introducing the Apple Developer App 
<https://developer.apple.com/news/?id=11182019a>
View on the App Store 
<https://apps.apple.com/app/id640199958?pt=2003=da_news=8>
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa-dev Digest, Vol 16, Issue 144

2019-11-14 Thread Gary L. Wade via Cocoa-dev
You seem to be overlooking the fact that many of these current and past years’ 
videos talk about Cocoa by referencing their constituent components like 
AppKit, MapKit, Collection View, etc. You would benefit greatly by sitting down 
and watching as many of these videos as possible.
--
Gary L. Wade
http://www.garywade.com/

> On Nov 14, 2019, at 10:41 AM, Turtle Creek Software  
> wrote:
> 
> 
> >> Here’s your free advice and prognostications:
> 
> https://developer.apple.com/videos/wwdc2019/
> https://developer.apple.com/develop/
> 
> Neither of those mention Cocoa at all, just SwiftUI.  Only slight mention of 
> Objective-C in a couple of video descriptions about Clang/LLVM and profiling. 
>  That does seem like a useful prognostication.  Thanks for the links!
> 
> Casey McDermott
> TurtleSoft.com
> 
> On Thu, Nov 14, 2019 at 11:39 AM Gary L. Wade  
> wrote:
>>> On Nov 14, 2019, at 8:29 AM, Turtle Creek Software via Cocoa-dev 
>>>  wrote:
>>> 
>>> I think this gets back to the transparency issue.  If Apple were more open
>>> about the future, it would be easier to know which cliffs are real.
>>> 
>> 
>> 
>> Here’s your free advice and prognostications:
>> 
>> https://developer.apple.com/videos/wwdc2019/
>> https://developer.apple.com/develop/
>> 
>> If you choose to ignore what is available to you, you have no one to blame 
>> but yourself.
>> 
>> Oh, and by the way, if you use DeRez right, the output is very useful.  In 
>> the terminal, type this command:
>> 
>> man DeRez
>> 
>> We’ve said this before, but now it’s definitely time to move on from this 
>> non-related topic.  If you have Cocoa-related questions, please feel free to 
>> submit those.  Otherwise, find another email list.
>> --
>> Gary L. Wade
>> http://www.garywade.com/
>> 
>> 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Cocoa-dev Digest, Vol 16, Issue 144

2019-11-14 Thread Gary L. Wade via Cocoa-dev
> On Nov 14, 2019, at 8:29 AM, Turtle Creek Software via Cocoa-dev 
>  wrote:
> 
> I think this gets back to the transparency issue.  If Apple were more open
> about the future, it would be easier to know which cliffs are real.
> 


Here’s your free advice and prognostications:

https://developer.apple.com/videos/wwdc2019/ 
<https://developer.apple.com/videos/wwdc2019/>
https://developer.apple.com/develop/ <https://developer.apple.com/develop/>

If you choose to ignore what is available to you, you have no one to blame but 
yourself.

Oh, and by the way, if you use DeRez right, the output is very useful.  In the 
terminal, type this command:

man DeRez

We’ve said this before, but now it’s definitely time to move on from this 
non-related topic.  If you have Cocoa-related questions, please feel free to 
submit those.  Otherwise, find another email list.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thoughts on Objective-C++

2019-11-13 Thread Gary L. Wade via Cocoa-dev
If it takes you that long, then you need to hire new developers rather than 
wasting your time posting complaints on an email list.
--
Gary L. Wade
http://www.garywade.com/

> On Nov 13, 2019, at 11:32 AM, Turtle Creek Software via Cocoa-dev 
>  wrote:
> 
> We have to plan 5 or 10 years ahead, because it takes that long to create
> an app and sell it for long enough to get payback.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thoughts on Objective-C++

2019-11-11 Thread Gary L. Wade via Cocoa-dev
If you wish to solve the problems you perceive to exist, you should join an 
Objective-C/Objective-C++ email list or hire developers experienced in those 
nuances.
--
Gary

> On Nov 11, 2019, at 10:47 AM, Turtle Creek Software via Cocoa-dev 
>  wrote:
> 
> 
>> 
>>> Obj-C++ *is* a superset of C++, so I’m not sure what you’re wishing for.
> 
> In source files Obj-C++ works great.  No complaints there. But headers and
> method declarations are Obj-C, which is C plus its own additions.
> 
> That means no use of const. All pointers instead of & references.  Both of
> those are good at turning run-time errors into compile-time.  No multiple
> inheritance, so we had to duplicate code in several places.  No
> initializing members in headers, so mystery bugs if you initialize in the
> wrong type of init.  No public/private to manage access. Etc. It was like
> going back to the early 90s. Doing without features we learned to use the
> hard way.
> 
> Make Objective-C a complete superset of C++ rather than C and it gains all
> the fantastic work that has gone into C++ over the past 20 years. Take
> advantage of folks from many places working on the language, not just half
> or 1/4 of the engineers at Apple.
> 
> Casey McDermott
> TurtleSoft.com
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thoughts on productivity

2019-10-24 Thread Gary L. Wade via Cocoa-dev
On Oct 24, 2019, at 6:08 AM, Turtle Creek Software via Cocoa-dev 
 wrote:

> Is there a way to fix this stuff?
…
> For the rest, Apple really needs to listen to developers more.

This is how you move towards a solution.

https://developer.apple.com/account/#/feedback-assistant

https://developer.apple.com/account/#/forums
--
Gary L. Wade
http://www.garywade.com/
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thoughts on Cocoa source code

2019-10-11 Thread Gary L. Wade via Cocoa-dev
The hard thing to make work best with NSComboBox is what to have its data 
source return when a user enters something not available in the list, so there 
is that decision to make, especially if your list is very sparse. You could 
also just use a pop up button that allows both mouse selection and text 
selection of a menu item when opened.
--
Gary L. Wade
http://www.garywade.com/

> On Oct 11, 2019, at 10:10 AM, Turtle Creek Software  
> wrote:
> 
> NSComboBox was almost perfect, but we needed it to only allow existing items.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thoughts on Cocoa source code

2019-10-11 Thread Gary L. Wade via Cocoa-dev
Clarification: For long-time Mac and now available in SwiftUI, you can even 
write “no” code to do some things with bindings.
--
Gary L. Wade
http://www.garywade.com/

> On Oct 11, 2019, at 8:31 AM, Gary L. Wade  
> wrote:
> 
> For Mac and SwiftUI, you can even write “no” code to do some things with 
> bindings.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Thoughts on Cocoa source code

2019-10-11 Thread Gary L. Wade via Cocoa-dev
I’m one of the few on the list who has experienced every growing pain you’ve 
mentioned from 680x0 Macintosh now up to SwiftUI, and not only supporting a US 
English environment but even RTL UI (Arabic and Hebrew scripts) mixed with LTR 
languages across every current platform, and I will admit it’s hard.

The way I found Cocoa development to be easier was to change my way of 
thinking. In almost every case, it was better to completely separate the 
business logic from the UI handling logic. In other frameworks, the paradigm is 
to subclass a view; in Cocoa, everything is built to be as MVC as possible. Of 
course, there are exceptions, but if you find yourself wanting to subclass a 
view, think hard and look around—it might be better to compose a view of other 
views or there is a better, more Cocoa way of doing it. For Mac and SwiftUI, 
you can even write “no” code to do some things with bindings.

It’s possible to do a progressive port, but in many cases, you might find it 
easier to re-model (pun intended) your design.

True, the classes you mentioned are difficult, but I’ve seen many of their 
difficulties in thinking of them as a 1-1 replacement for comparable 
affordances in other frameworks or platforms.

Definitely use your tech support incidents, and if you find something not 
behaving as defined or not defined well, submit feedback to Apple and feel free 
to post those here. There’s also a site where you can voluntarily add your 
feedback requests to Apple, but I don’t recall it right now.
--
Gary L. Wade
http://www.garywade.com/

> On Oct 11, 2019, at 8:00 AM, Turtle Creek Software via Cocoa-dev 
>  wrote:
> 
> I checked the GNUstep project, and it does seem decently clear and
> well-commented. If Apple made it possible to see and step through some of
> the basic Cocoa classes, that would be a good starting point.  The hard
> parts for us were NSView and its subclasses (especially NSTableView &
> associates, NSTabView and NSComboBox in that order).  The whole constraint
> system.  ARC.  Getting nibs to work properly when one little setting was
> wrong.
> 
> In general, we weren't curious at all about the inner implementations of
> Cocoa.  The problems that held us back were in getting it to work for our
> app. Something is drawing solid black.  Why?
> 
> Rather than crown jewels, I think the best analogy for Cocoa should be an
> excavator or a backhoe. Some people run one full-time, but some pick it up
> from the rental place, and just want to get some stuff done over a
> weekend.  What's the best way to make it productive, quickly?  The
> long-time operators on this list know all the tricks, but Cocoa should also
> allow the rest of us to build apps relatively quickly. In our case, that
> means less than 3 years.
> 
> Casey McDermott
> TurtleSoft.com
> 
>> On Fri, Oct 11, 2019 at 9:47 AM Saagar Jha  wrote:
>> 
>> I’m sure much of the Cocoa code is quite old, but it’s mostly all
>> Objective-C. If you’re curious how it might work, but don’t want to use a
>> disassembler, the GNUstep project has a somewhat decent (though
>> incomplete) reimplementation <https://github.com/gnustep/libs-gui> that
>> you can look at.
>> 
>> Saagar Jha
>> 
>> On Oct 11, 2019, at 06:18, Turtle Creek Software via Cocoa-dev <
>> cocoa-dev@lists.apple.com> wrote:
>> 
>> If you combine otool, classdump and Hopper Disassembler, you can find
>> 
>> how some Cocoa methods are working in any Obj-C executable pretty easily.
>> 
>> Here's the thing.  We started out as construction folks who learned Excel.
>> Then HyperTalk.  Then C++. As a business, our main strength is knowing the
>> construction business, and how to talk to folks in it. Our time is best
>> spent solving business-related problems.  Along the way we have learned
>> many programming and human-interface skills, but the less time we need to
>> spend on that, the better.
>> 
>> If a programming environment requires zombies, disassemblers and other BS
>> just to make it work, that is a big problem. It's too much extra overhead.
>> Our company can't afford it.
>> 
>> I'd agree that the documentation for Cocoa is deficient.
>> 
>> CodeWarrior included a huge Inside PowerPlant book, modeled on our
>> well-worn copies of Inside Macintosh. But we rarely used it.  Having
>> clearly-written source code and good comments is probably the best form of
>> documentation. Being able to step through it easily and see it in action is
>> a huge plus.
>> 
>> I suspect that Cocoa source code is ancient C that is badly in need of a
>> refactoring. Making it open, understandable and self-documenting would be a
>> great way to improve it.  Based on our r

Re: A question in regards to AddInstanceForFactory

2019-09-26 Thread Gary L. Wade via Cocoa-dev
Are you running on Mojave or Catalina beta? I’ve found some things in some 
simulators work better when under Catalina beta.
--
Gary L. Wade
http://www.garywade.com/

> On Sep 26, 2019, at 5:37 AM, Eric E. Dolecki via Cocoa-dev 
>  wrote:
> 
> FYI: This only appears when running in a simulator.
> 
>> On Thu, Sep 26, 2019 at 8:31 AM Eric E. Dolecki  wrote:
>> 
>> I am using Xcode 11.0 (11420a), targeting iOS 13, Swift 5, and playing
>> back a local audio file. Seems simple enough, but I am getting a console
>> print:
>> 
>>let path = Bundle.main.path(forResource:
>> "Tchaikovsky_Rococo_Var_orch.mp3", ofType:nil)!
>>let url = URL(fileURLWithPath: path)
>>do {
>>player = try AVAudioPlayer(contentsOf: url)
>>player?.volume = 0.5
>>player?.numberOfLoops = -1
>>player?.play()
>>} catch {
>>print("Could not load the audio file.")
>>}
>> 
>> *[plugin] AddInstanceForFactory: No factory registered for id ...*
>> 
>> Everything runs fine, but how do I silence this? I've googled and haven't
>> seen anything.
>> 
>> Thanks,
>> Eric
>> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: CGImageSourceCopyPropertiesAtIndex fails sometimes

2019-09-25 Thread Gary L. Wade via Cocoa-dev
I don’t recall if the URL can be a remote URL in addition to a file URL, but 
regardless, check the status of the source ref with CGImageSourceStatus first. 
The index value is used for compound images like animated GIFs and PNGs.
--
Gary L. Wade
http://www.garywade.com/

> On Sep 25, 2019, at 8:10 AM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> 
> I have this piece of code in my program:
> 
>CGImageSourceRef sourceRef = CGImageSourceCreateWithURL( (CFURLRef) url, 
> NULL );
>if ( sourceRef == NULL )
>{
>... display error message 1
>return;
>}
>CFDictionaryRef fileProps = CGImageSourceCopyPropertiesAtIndex( sourceRef, 
> 0, NULL );
>if ( ! fileProps )
>{
>... display error message 2
>return;
>}
> 
> Now, occasionally, I get "error message 2" but not "error message 1",
> i.e.,  CGImageSourceCopyPropertiesAtIndex() apparently fails, while 
> CGImageSourceCreateWithURL() retuned a valid(?) image source ref.
> 
> I am wondering, how this could happen.  Does anyone have a clue?
> 
> Furthermore, when I run the program a few minutes later, without any changes 
> whatsoever, 
> both function calls work just fine, with the same image files!
> 
> 
> Puzzled, Gabriel.
> 
> PS:
> I never understood what the index in CGImageSourceCopyPropertiesAtIndex() is 
> meant for,
> and I could not find a clue in the docs, and every example uses just 0 ‒
> but probably, this is not related to the problem described above.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: ARC

2019-08-24 Thread Gary L. Wade via Cocoa-dev
Sometimes the best approach when something seems magical or extremely 
unexpected is to step away to the marker board and draw pictures and a “movie” 
storyboard of what’s going on, tallying up visually everything. Unilaterally 
using strong or weak references is not the answer. Often when I go through that 
exercise, without cutting corners or assuming stuff, a solution usually 
presents itself.
--
Gary L. Wade
http://www.garywade.com/

> On Aug 24, 2019, at 4:44 AM, Turtle Creek Software via Cocoa-dev 
>  wrote:
> 
> Our app delegate class is not deallocated.  The window controller is
> deallocated
> despite the member reference there.  If we keep the second strong reference
> to the controller,
> then the outline view is deallocated instead.  Nothing references the view
> except being in the .xib file for the window controller.
> 
> We had similar problems with a NSTabViewer.  When we futzed the build
> settings to allow
> breakpoints on retain and release, it was being retained 34 times and
> released 35 times-
> all inside Apple code.  The only way we found to fix that was to stop using
> a NSTabViewController
> and just manage it directly.
> 
>> On Fri, Aug 23, 2019 at 8:27 PM Jens Alfke  wrote:
>> 
>> 
>> 
>> On Aug 23, 2019, at 2:17 PM, Casey McDermott via Cocoa-dev <
>> cocoa-dev@lists.apple.com> wrote:
>> 
>> After we finished, the controller for our main window started being
>> deallocated some random time after launch.
>> Apparently the erroneous strong references were keeping it alive.
>> 
>> 
>> AppKit delegates, like NSWindow.delegate, are unsafe-unretained
>> references; this might be giving you trouble.
>> 
>> We allocate the controller in our app delegate class. It's a member but
>> apparently that is not a
>> strong enough reference, so the controller is released at the end of the
>> scope.
>> 
>> 
>> A member variable is a strong reference by default, so that should suffice
>> to keep it alive. Is your app delegate itself being dealloced?
>> 
>> —Jens
>> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSLog displays inconsistent format for NSDate

2019-08-20 Thread Gary L. Wade via Cocoa-dev
If you want to output a date in a predictable format, you should use a date 
formatter.  When I ran a sample app under the simulator for tvOS 13 in Xcode 11 
beta 5, I got these results for the specified locales:

2019-08-20 19:51:05.637667-0700 TestDateDescription[32894:2579867] ar_AE: The 
date is now 2019-08-21 02:51:05 +
2019-08-20 19:51:42.350744-0700 TestDateDescription[32899:2580909] fr_FR: The 
date is now 2019-08-21 02:51:42 +
2019-08-20 19:52:13.121429-0700 TestDateDescription[32905:2581496] en_US: The 
date is now 2019-08-21 02:52:13 +

This was the line of Swift I used:

NSLog("%@: The date is now %@", Locale.current.identifier, NSDate())

For a predictable format in logs, I’d suggest using NSISO8601DateFormatter.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>

> On Aug 20, 2019, at 12:50 PM, Carl Hoefs via Cocoa-dev 
>  wrote:
> 
> When printing out an NSDate using NSLog from within Xcode I get:
> 
> "Tue Aug 20 12:32:40 2019"
> 
> When the same program is run from within a shell (bash) window:
> 
> "2019-08-20 19:32:48 +"
> 
> Is the NSDate output format somehow determined by the environment? My system 
> is set to Local Time Zone (America/Los_Angeles (PDT) offset -25200 
> (Daylight)).
> 
> A code snippet that reproduces the issue follows. 
> 
> -Carl
> 
> 
> 
> - (void) testDate
> {
>NSCalendar *calendar = [NSCalendar currentCalendar];
>unsigned unitFlags = 
> NSCalendarUnitYear|NSCalendarUnitMonth|NSCalendarUnitDay|NSCalendarUnitHour|NSCalendarUnitMinute|NSCalendarUnitSecond|NSCalendarUnitTimeZone;
>NSDateComponents *dateComponents = [calendar components:unitFlags 
> fromDate:[NSDate date]];
>dateComponents.timeZone = NSTimeZone.localTimeZone;
>NSDate *configuredDate = [calendar dateFromComponents:dateComponents];
>NSLog(@"Configured date: %@",configuredDate);
> }
> 
> Xcode:
> 2019-08-20 12:32:40.828863-0700 tester[3926:1353] Configured date: Tue Aug 20 
> 12:32:40 2019
> 
> Shell:
> 2019-08-20 12:33:08.356 tester[3928:1359] Configured date: 2019-08-20 
> 19:32:48 +
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSTextField "Discard Change"

2019-04-27 Thread Gary L. Wade
From what you’ve described and shown, your expectations for discardEditing are 
not correct.  The method discardEditing is a method you implement, typically on 
your view controller that owns/manages your text field.  There’s not really any 
good sample source using discardEditing I could find to point you to, but this 
one seems to give as best as can be.

https://sourceforge.net/p/skim-app/mailman/message/22781851/ 
<https://sourceforge.net/p/skim-app/mailman/message/22781851/>

It sounds like you want to fill the field with the previous value that was in 
there, and while you could do it in a text field subclass, you’re probably 
better off managing that from its controller.  By the time your sheet shows up, 
your text field is no longer performing any editing since it’s no longer the 
first responder.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>

> On Apr 27, 2019, at 10:26 AM, Richard Charles  wrote:
> 
>> On Apr 9, 2019, at 9:40 AM, Sean McBride  wrote:
>> 
>> NSTextField in fact does *not* support commitEditing/discardEditing, as per 
>> this a decade ago:
>> 
>> <https://lists.apple.com/archives/cocoa-dev/2008/Aug/msg00529.html>
>> 
>> I don't think I ever did find another solution to my problem other than to 
>> use an NSObjectController.
> 
> 
> My testing shows you are correct. Contrary to the documentation NSTextField 
> does not support the NSEditor protocol. No App Kit user interface elements 
> that I can find support this protocol. It is only supported by NSController 
> and NSViewController.
> 
> --Richard Charles

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Drawing boxes around each digit entered in UITextField (Number Pad)

2019-02-09 Thread Gary L. Wade
Rather than using a UITextField and guessing where things are, look at 
UITextView and its underlying components to know where each character actually 
is and how to coordinate your drawing with the drawing of each grapheme.  If 
you only want to draw the boxes when editing, you could instead provide your 
own field editor that does the same thing, and drawing when not editing would 
follow the non-boxed method.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>

> On Feb 9, 2019, at 12:36 PM, Devarshi Kulshreshtha 
>  wrote:
> 
> I am trying to draw boxes around each digit entered by a user in
> UITextField for which keyboard type is - Number Pad.
> 
> To simplify the problem statement I assumed that each of the digits (0 to
> 9) will have same bounding box for its glyph, which I obtained using below
> code:
> 
> func getGlyphBoundingRect() -> CGRect? {
>guard let font = font else {
>return nil
>}
>// As of now taking 8 as base digit
>var unichars = [UniChar]("8".utf16)
>var glyphs = [CGGlyph](repeating: 0, count: unichars.count)
>let gotGlyphs = CTFontGetGlyphsForCharacters(font, ,
> , unichars.count)
>if gotGlyphs {
>let cgpath = CTFontCreatePathForGlyph(font, glyphs[0], nil)!
>let path = UIBezierPath(cgPath: cgpath)
>return path.cgPath.boundingBoxOfPath
>}
>return nil
>}
> 
> I am drawing each bounding box thus obtained using below code:
> 
> func configure() {
>guard let boundingRect = getGlyphBoundingRect() else {
>return
>}
>for i in 0.. the box
>var box = boundingRect
>box.origin.x = (CGFloat(i) * boundingRect.width)
>let shapeLayer = CAShapeLayer()
>shapeLayer.frame = box
>shapeLayer.borderWidth = 1.0
>shapeLayer.borderColor = UIColor.orange.cgColor
>layer.addSublayer(shapeLayer)
>}
>}
> 
> Now problem is -  if I am entering digits - 8,8,8 in the text field then
> for first occurrence of digit the bounding box drawn is aligned, however
> for second occurrence of same digit the bounding box appears a bit offset
> (by negative x), the offset value (in negative x) increases for subsequent
> occurrences of same digit.
> 
> I tried to solve the problem by setting NSAttributedString.Key.kern to 0,
> however it did not change the behavior.
> 
> Am I missing any important property in X axis from the calculation due to
> which I am unable to get properly aligned bounding box over each digit?
> Please suggest.
> 
> -- 
> Thanks,
> 
> Devarshi

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: C++ pointer to Cocoa object

2018-09-07 Thread Gary L. Wade
You might also find WWDC 2018, Session 409, informative.
--
Gary L. Wade
http://www.garywade.com/

> On Sep 7, 2018, at 1:44 PM, Allan Odgaard  wrote:
> 
>> On 7 Sep 2018, at 19:46, Casey McDermott wrote:
>> 
>> Problem is, with ARC turned on, the pointer is never nil, so it crashes.
>> The void pointer somehow becomes an NSAtom instead of 0.
> 
> Nil is nil, I think your issue is rather that you do not properly retain the 
> pointer before storing it as void*.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Crashes inside CFStringDeallocate

2018-05-26 Thread Gary L. Wade
While your UTF-8 representation works, it would be worth it to verify your data 
is correct.  Whenever I have messes with Unicode, or any data for that matter 
which can be external to an Xcode execution, I eyeball the actual bytes with 
Hex Fiend:

https://github.com/ridiculousfish/hexfiend 
<https://github.com/ridiculousfish/hexfiend>

Also, if your data is in your own container, you should be able to use Xcode’s 
view memory option.

Not to say these would cause your problem, but they may help you identify the 
real reason: I’d look at endian ordering, a BOM as your first character, and an 
embedded 16-bit zero within the bytes, even if it’s the last character in your 
array.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>

> On May 26, 2018, at 3:18 AM, Vojtěch Meluzín <meldaproduct...@gmail.com> 
> wrote:
> 
> Hard to say really, but we know that it does work properly on newer OSX (so
> there is either some sort of compatibility change, classic Apple, or there
> was a bug). I believe the UTF16 implementation we are using is correct, and
> it was used in other places in the software as well, and it always worked,
> it only crashed here in the modal window thingy in specific OSX and
> specific host programs (it's an AU plugin). Anyways it seems working now,
> so we'll stick with the slower UTF8...
> 
> Cheers!
> Vojtech
> www.meldaproduction.com
> 
> 2018-05-26 0:30 GMT+02:00 Jack Brindle <jackbrin...@me.com>:
> 
>> Not necessarily. I have never seen a guarantee that the C++ string
>> functions output their data in the exact format that [NSString
>> stringWithCharacters:length:] needs as an input. As you discovered, getting
>> UTF8 from the C++ string does give you proper data for the corresponding
>> NSString creator method.
>> 
>> Assuming things are compatible between C++ and Cocoa methods usually leads
>> to bug reports at the very least.
>> 
>> Jack
>> 
>>> On May 25, 2018, at 2:18 PM, Vojtěch Meluzín <meldaproduct...@gmail.com>
>> wrote:
>>> 
>>> Ok so I got a solution - it's the utf16 indeed. When I use [NSString
>>> stringWithUTF8String] instead, it doesn't crash. Considering it does that
>>> only on 10.10 (and probably older), it seems like OSX malfunction... oh
>>> well... Fortunately no big deal.
>>> 
>>> Cheers!
>>> Vojtech
>>> www.meldaproduction.com
>>> 
>>> 2018-05-25 22:49 GMT+02:00 Vojtěch Meluzín <meldaproduct...@gmail.com>:
>>> 
>>>> Thanks for the reply Ken. I don't really know what Zombies instrument
>> is,
>>>> I'll check. The GetLength returns the number of UTF-16 characters (hence
>>>> half of the buffer length), not including zero terminator.
>>>> 
>>>> Cheers!
>>>> Vojtech
>>>> 
>>>> 2018-05-25 16:26 GMT+02:00 Ken Thomases <k...@codeweavers.com>:
>>>> 
>>>>> On May 25, 2018, at 5:44 AM, Vojtěch Meluzín <
>> meldaproduct...@gmail.com>
>>>>> wrote:
>>>>>> 
>>>>>> I have received a few cases like the trace below - it always happens
>> in
>>>>> OSX
>>>>>> 10.10 and runModalForWindow and crashes in CFStringDeallocate. Any
>> ideas
>>>>>> what that could be?
>>>>> 
>>>>> Have you run your app with the Zombies instrument?
>>>>> 
>>>>>> […] NSStrings, which are
>>>>>> probably the issue here are always created from our MString like this:
>>>>>> 
>>>>>> const unichar *utf16 = (const unichar  *)s.GetUTF16();
>>>>>> return [NSString stringWithCharacters: utf16 length: s.GetLength()];
>>>>> 
>>>>> Does MString::GetLength() return the length in UTF-16 code units (as
>>>>> opposed to, say, UTF-8 code units)?
>>>>> 
>>>>> Regards,
>>>>> Ken
>>>>> 
>>>>> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Persistent User Defaults

2018-04-24 Thread Gary L. Wade
Try defaults delete in the Terminal.
--
Gary L. Wade
http://www.garywade.com/

> On Apr 24, 2018, at 8:42 AM, Richard Charles <rcharles...@gmail.com> wrote:
> 
> On macOS an applications user defaults are stored in a preference plist file 
> located in ~/Library/Preferences.
> 
> If this file is deleted, user preferences for the application still persist 
> until the machine is rebooted. In other words if you want to start with a 
> clean set of user preferences not only must you delete the preference plist 
> file but you must also restart the machine.
> 
> Can anyone shed light on this behavior?
> 
> --Richard Charles
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Put UICollectionView within UITableViewCell

2018-03-09 Thread Gary L. Wade
I would suggest rethinking the table view enclosure and just use a collection 
view with headers and footers by way of the supplemental views.
--
Gary L. Wade
http://www.garywade.com/

> On Mar 9, 2018, at 8:00 AM, Glen Huang <hey...@gmail.com> wrote:
> 
> Hi,
> 
> I asked a question about putting UICollectionView within UITableViewCell on 
> Apple Developer Forums (https://forums.developer.apple.com/thread/98176), but 
> it doesn’t get many replies. I’m not sure if it’s ok to repost the question 
> here. I apologize if it’s not.
> 
> Here is the question:
> 
> Hi, I'm trying to create a table view with cell content like this
> 
> | Label |  
> | CollectionItem 1   CollectionItem 2  CollectionItem 3 |  
> | CollectionItem 4  |  
> 
> Collection view item should auto wrap at cell end, both the collection view 
> and table view use automatic height.
> 
> I can somewhat achieve this effect by doing:
> put the label and the collection view in a vertical stack view, make the 
> stack view's each edge touch table cell's corresponding edge.
> disable collection view scrolling.
> collection view's intrinsicContentSize returns layout's 
> collectionViewContentSize value.
> in table cell's prepareForReuse method, I make the collection view reload its 
> data.
> 
> But the problem comes when each table cell can contain different number of 
> collection items: some table view cells have incorrect heights, clipping its 
> collection view. My guess is that when table cells get reused, they don't 
> take collection view's new intrinsicContentSize into account.
> 
> I tried calling sizeToFit/layoutIfNeeded/updateConstraints in cell's 
> prepareForReuse method, none of them works.
> 
> If I replace the collection view with a multiline label, and make each cell 
> contain different length of text, the cells all have correct heights.
> 
> I wonder why label are able to correctly resize cells? how can I make 
> collection views do the same?
> 
> Thanks very much.
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: WatchKit Baby Apps

2018-03-02 Thread Gary L. Wade
Lots of people complain that Apple doesn’t listen to submitted bug reports, but 
they do, and as I was reading my emails today on my iPad, I’m reminded of two 
of mine that were answered, movement of the button for loading email images 
from the bottom of emails to the top, and adding an unsubscribe option. For SDK 
work, stringsdict was added the next cycle after I submitted a request to 
handle plural values in strings without writing extra code.

So, if you have issues, go to https://bugreport.apple.com and add your request, 
and if you have a solid way you’d like something done, be sure to add that.
--
Gary L. Wade
http://www.garywade.com/


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSSecureCoding & NSAttributedString

2018-02-18 Thread Gary L. Wade
FYI, you can define your own attributes using your own keys and values not 
defined by the frameworks, and the frameworks will ignore them from the 
standpoint of drawing. In one app, I used an attribute to add a time stamp to a 
run of text and overrode the glyph drawing so that when my code saw that 
attribute, it would draw an appropriate border around the entire run. I didn’t 
have a need to send that attributed string to other apps, but if I did, I would 
hope my custom attributes would be preserved round-trip provided the run was 
preserved.
--
Gary L. Wade
http://www.garywade.com/

> On Feb 18, 2018, at 2:26 PM, Quincey Morris 
> <quinceymor...@rivergatesoftware.com> wrote:
> 
> I dunno. I always though of the attributes as something extensible, but I 
> guess they’re not really. (They can’t be, in NSAttributedString is an 
> interchange format between apps.) Looking at the documented list, I would be 
> worried about NSTextAttachment, which isn’t even documented as conforming to 
> NSSecureCoding. Those NSAccessibility… keys don’t look too safe either.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Size of compiled NIBs in Xcode 9 (10.13 SDK)

2018-01-24 Thread Gary L. Wade
I would suggest addressing your concern at https://bugreport.apple.com/
--
Gary L. Wade
http://www.garywade.com/

On Jan 24, 2018, at 11:05 AM, Jeremy Hughes <moon.rab...@virginmedia.com> wrote:

>> I posted a related question in https://apple-dev.groups.io/g/xcode/ 
>> ("Assets.car is much larger for High Sierra builds”) but I didn’t get much 
>> in the way of a reply.
> 
> https://apple-dev.groups.io/g/xcode/message/396
> 
>> It seems that Assets.car is much larger when it is built with the 10.13 SDK 
>> than when it is built with the 10.12 SDK.
>> 
>> I don’t know why.
>> 
>> Jeremy
>> 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Odd Behavior of UIText View in app compiled with a Base SDK of iOS 11

2017-10-07 Thread Gary L. Wade
I saw some issues in an early beta of iOS 11 of views not being left where they 
should be, but I was doing some things “esoterically,” and the bug was fixed in 
the next release. In the meantime, I used the visual debugger to see what was 
happening, and I might’ve used that info if it hadn’t been fixed. Try that out 
to see if anything jumps out at you.
--
Gary L. Wade
http://www.garywade.com/

> On Oct 6, 2017, at 1:33 PM, Michal L. Wright <m...@raccoonbend.com> wrote:
> 
> Hi,
> 
> I have an app (written in Objective C) that has a UIView that includes a 
> UITableView and a UIToolbar. The bottom section of the table view is a 
> UITextView. The Deployment Target is 9.0, and the Base SDK is iOS 11.
> 
> Compiling with Xcode 9.0 and running on iPhone 6s (9.2) in the Simulator, 
> tapping any of the buttons in the toolbar works fine, with the appropriate 
> function being called.
> 
> Compiling with Xcode 9.0 and running on iPhone 6s (11.0) in the Simulator, 
> tapping anywhere in the toolbar initiates editing in the text view. However, 
> touching and holding on a button in the toolbar for about 3 seconds calls the 
> associated button function. My actual iPhone 6s running iOS 11.0.1 has the 
> same problem.
> 
> As a test, I reduced the height of the table view, leaving a fairly large gap 
> between the bottom of the table view and the top of the toolbar, just to make 
> sure there wasn’t some kind of overlap. Even tapping in the gap causes the 
> text view to initiate editing.
> 
> My first assumption had been that the problem was with UIToolbar, but that 
> doesn’t seem to be the case. Also, I have another view controller that 
> contains a UIView that contains a UITableView and a UIToolbar, and the the 
> problem does not occur there. 
> 
> In fact, I just tried not adding the toolbar subview, and tapping in the 
> space where it would normally be still causes the text view to initiate 
> editing. That seems to point to the UITextView responding to taps outside of 
> its frame.
> 
> Since Xcode 9 only offers a Base SDK of iOS 11, I switched to Xcode 8.3.3 and 
> selected a Base SDK of 10.3.
> 
> The problem does not occur on any of the Simulator devices. So, although 
> Xcode 8.3.3 can’t launch the app on my iPhone running iOS 11.0.1, I decided 
> to go ahead and release the 8.3.3 version. It runs fine on my 6s, and I’ve 
> had a number of reports that it’s running fine for a variety of customers 
> under iOS 11.
> 
> Even though I’ve managed to work around the problem for now, I can’t keep 
> using Xcode 8.3.3 forever — especially as it is very inconvenient not to be 
> able to debug the app running on my 6s.
> 
> So, I’d like to figure out if I’m seeing a side effect of something I’m doing 
> wrong, or if there is a problem with either Xcode 9 or iOS 11 that needs to 
> be reported.
> 
> The code is rather complex, but I’ll try to create a project that will 
> isolate the problem. Meanwhile I’m wondering if anyone else has seen anything 
> similar happening.
> 
> Thanks for any insights,
> Mike Wright
> 
> P.S. By the way, I’m 75 years old and would like to retire, but don’t want to 
> leave my customers in the lurch. If anyone might be interested in taking over 
> three related products, please email me directly (NOT through this list) and 
> I’ll tell you what’s involved.
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [NSButton state] must by used from the main thread

2017-09-26 Thread Gary L. Wade
If you have an issue with one API reporting such an issue, write a radar, as I 
did for getting the application’s delegate when I encountered it. For a 
button’s state, however, there may be a better way to pass that value to a 
background thread, especially if the button should be setting a value somewhere 
else that can be atomic and which decouples your background thread from the UI.
--
Gary L. Wade
http://www.garywade.com/


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: [OT] Question about writing documentation

2017-04-22 Thread Gary L. Wade
That’s a cool feature I didn’t know existed!  Unfortunately, OGP7.3 crashes 
when I turn on either instance variables or methods; crash reports submitted.  
I’ll be looking forward to trying again on the next update.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Apr 22, 2017, at 9:31 AM, Uli Kusterer <witness.of.teacht...@gmx.net> 
> wrote:
> 
> On 21. Apr 2017, at 19:28, davel...@mac.com wrote:
>> You did't say what you tried, but IMO the best app for professional looking 
>> figures on the Mac is OmniGraffle from omnigroup.com. There are extensive 
>> stencil libraries for many things and I expect one could work (at least as a 
>> starting point) for you or you could create a stencil group you could reuse. 
>> They have a free trial.
>> 
>> I'm not affiliated with OmniGroup - just a satisfied customer.
> 
> Also, I'm not sure if OmniGraffle still has this feature, but in ye olde days 
> you could drag an Xcode project on OmniGraffle and it would actually generate 
> a diagram from the source files. That might have been back in the Project 
> Builder days though, so might have been discontinued with one of the two 
> dozen ObjC syntax and Xcode file format changes.
> 
> Cheers,
> -- Uli Kusterer
> "The Witnesses of TeachText are everywhere..."

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Visible difference in text: NSTextField vs drawInRect:

2017-04-11 Thread Gary L. Wade
If you need lightweight drawing, you could use an NSTextFieldCell, which should 
give you some predictability. I don't recall the details, but there are a 
number of things that NSTextField does (and NSTextView) that aren't done with 
"raw" drawing (borders, margins, font resizing, etc.)
--
Gary L. Wade
http://www.garywade.com/

> On Apr 11, 2017, at 9:39 AM, Navneet Kumar <navnee...@me.com> wrote:
> 
> Yes, I tried inside drawRect:, both YES and NO. The effect was still there.
> 
> Thanks,
> Navneet 
> 
> Sent from my iPhone
> 
>> On 11-Apr-2017, at 9:31 PM, gerti-cocoa...@bitart.com wrote:
>> 
>> Did you try the
>> 
>>   CGContextRefctx=(CGContextRef)[[NSGraphicsContext 
>> currentContext]graphicsPort];
>> 
>>   CGContextSetShouldSmoothFonts(ctx,YES);
>> 
>> stuff inside the -drawRect: method? That is where it needs to be. Try both 
>> YES and NO. Should be a visible difference.
>> 
>> Gerd
>> 
>> 
>>> On Apr 11, 2017, at 10:55, Navneet Kumar <navnee...@me.com> wrote:
>>> 
>>> Hi,
>>> 
>>> Here is another image with a character in each case zoomed in using 
>>> ColorMeter.
>>> 
>>> http://i66.tinypic.com/2w5m795.jpg
>>> 
>>> Wishes,
>>> Navneet
>>> 
>>> 
>>>> On 11-Apr-2017, at 2:00 AM, Quincey Morris 
>>>> <quinceymor...@rivergatesoftware.com> wrote:
>>>> 
>>>> On Apr 10, 2017, at 11:20 , Navneet Kumar <navnee...@me.com 
>>>> <mailto:navnee...@me.com>> wrote:
>>>>> 
>>>>> Actually I’m using text fields for simplicity at a lot of places. And 
>>>>> drawInRect: at some places, in order to vertically centre the multi-line 
>>>>> text more conveniently.
>>>> 
>>>> Here are some possibilities to consider:
>>>> 
>>>> 1. Shadow. What happens if you don’t specify the shadow?
>>>> 
>>>> 2. Resolution. It may be that the text drawing ends up in drawing contexts 
>>>> with different resolution backing stores (1x vs. 2x vs. 3x).
>>>> 
>>>> 3. Size. Does the weird effect scale with point size? If you draw the text 
>>>> much larger, are the results much closer to each other?
>>>> 
>>>> 4. Anti-aliasing. There is some behind the scenes magic when drawing text, 
>>>> that determines whether it knows the background color and therefore 
>>>> whether it anti-aliases using the background color.
>>>> 
>>>> 5. Overlays. It’s possible that NSTextField already draws the text more 
>>>> than once, to give a partial outline effect that increases contrast with 
>>>> mid-level color backgrounds.
>>>> 
>>>> 6. Traits. NSTextField may be opting into the trait behavior that 
>>>> classifies text as Body, Headline, Caption, etc. These things might cause 
>>>> some adjustment to the font weight. Or the accessibility features that 
>>>> change the font appearance. (But I’m not sure which of those is available 
>>>> on macOS.)
>>>> 
>>>> 
>>> 
>>> ___
>>> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: A horizontal line rule within a NSAttributedString?

2017-02-18 Thread Gary L. Wade
Either try subclassing NSTextAttachment and overriding the methods in 
NSTextAttachmentContainer or use a subclass of NSTextAttachmentCell.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Feb 18, 2017, at 3:26 PM, Daryle Walker <dary...@mac.com> wrote:
> 
> What is the attachment supposed to be? An image of a line? That doesn’t seem 
> scalable (to the page size). And the effort seems to be the same as figuring 
> out NSTextBlock.
> 
>> On Feb 18, 2017, at 5:43 PM, Gary L. Wade <garyw...@desisoftsystems.com 
>> <mailto:garyw...@desisoftsystems.com>> wrote:
>> 
>> I would use NSTextAttachment, create an attributed string from it, and 
>> combine your three attributed strings into one.
>> --
>> Gary L. Wade
>> http://www.garywade.com/ <http://www.garywade.com/>
>>> On Feb 18, 2017, at 2:16 PM, Daryle Walker <dary...@mac.com 
>>> <mailto:dary...@mac.com>> wrote:
>>> 
>>> An idea for formatted output of my data is the two sections turned into 
>>> attributed strings, with a line between them. But I couldn’t figure out how 
>>> to make a line. I didn’t want to resort to raw drawing commands. I prefer 
>>> not to create (X)HTML representations (so I could put a “” in between). 
>>> Poking around NSAttributedString, there seems to be a NSTextBlock that 
>>> could do it. Any advice on how?
> 
> 
> — 
> Daryle Walker
> Mac, Internet, and Video Game Junkie
> darylew AT mac DOT com 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: A horizontal line rule within a NSAttributedString?

2017-02-18 Thread Gary L. Wade
I would use NSTextAttachment, create an attributed string from it, and combine 
your three attributed strings into one.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Feb 18, 2017, at 2:16 PM, Daryle Walker <dary...@mac.com> wrote:
> 
> An idea for formatted output of my data is the two sections turned into 
> attributed strings, with a line between them. But I couldn’t figure out how 
> to make a line. I didn’t want to resort to raw drawing commands. I prefer not 
> to create (X)HTML representations (so I could put a “” in between). 
> Poking around NSAttributedString, there seems to be a NSTextBlock that could 
> do it. Any advice on how?
> 
> — 
> Daryle Walker
> Mac, Internet, and Video Game Junkie
> darylew AT mac DOT com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Sometimes all my menus are disabled

2017-02-15 Thread Gary L. Wade
If I were you, the first thing I’d do is put what you have (your pre-work and 
any backups) in a repository so you can track your history.  Xcode has made 
integration with Git so easy.  There are definitely some shortcomings with more 
esoteric needs, but for the most part, you’d be fine sticking only with Xcode.

After making your local Git repository, you should set up a remote.  For me, I 
use free Bitbucket for my online storage of my private, single-user Git 
repositories, and their app SourceTree is also free and provides solutions for 
those things Xcode doesn’t give you.  There are other solutions and services 
that may be better, but for a single-user team wanting to be budget-conscious 
and keep your code private, that’s what I’d recommend.

Once you have your repository in place, tracking errant changes by Xcode 
migrations is just as easy as looking at a diff.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Feb 15, 2017, at 9:10 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
> On 14.02.2017 at 23:15 Graham Cox wrote:
> 
>> It’s usually easier to float downstream.
> 
> +1 for nice metaphor.
> 
> On the good news side: I've fixed it now. The trick was to first fix the 
> spurious menu
> trees directly in the XML, then to delete keyedobjects.nib, then to make a 
> dummy change
> directly in Interface Builder to force it to re-compile keyedobjects.nib and 
> then it
> finally worked. That was quite a tough one but I still feel more satisfied 
> now than
> I'd have been if I had re-created the whole shebang from scratch, even though 
> that'd
> probably have been faster.
> 
>> Sure, it could be. Bugs happen. XCode bugs happen a lot.
> 
> That definitely seems so because I definitely didn't mess with the XML but 
> still the
> whole menu tree was listed as a submenu of a separator item and when 
> examining the
> XML generated by my PPC Macintosh version of Xcode the menu tree definition 
> is correct
> in that file. So it must have been introduced during transitioning to the 
> latest Xcode
> (Or I did something really stupid without realizing it but I can't imagine 
> that it's
> even possible in Xcode to duplicate the whole menu tree and insert it as a 
> submenu
> of a separator item. That's just utter non-sense and that's why it didn't 
> appear in
> Xcode either, just in the XML.)
> 
> Anyway, issue fixed. Thanks to all who helped!
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Sometimes all my menus are disabled

2017-02-13 Thread Gary L. Wade
Well, you may have a valid bug to report to Apple.  You probably would want to 
use a tech support incident, which will get feedback faster, and in the past, 
when the issue turned out to be Apple’s bug, they’ve credited it back to me.  
Otherwise, definitely mark this as a serious bug.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Feb 13, 2017, at 12:54 PM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
> On 13.02.2017 at 19:49 Gary L. Wade wrote:
> 
>> Your assignments for the File’s Owner and Application objects are
>> messed up.  First, clear the custom class values for these two
>> objects.  After that, connect the delegate outlet in the Application
>> object to your embedded AppDelegate object.
> 
> Thanks, but unfortunately, this doesn't help either (or I did it wrong).
> 
> Here's what I did:
> 
> 1) Select File's Owner, go to Custom Class section in the Identity
> inspector, delete what was inside the "Class" text field; the
> "Class" text field is now empty but Xcode shows "NSObject" in
> gray (indicating that this is probably the default)
> 
> 2) Select Application, and repeat the steps from above; the "Class"
> text field for Application is now empty as well and Xcode shows
> "NSApplication" in gray 
> 
> 3) Then I changed to the Connections inspector for Application,
> held down CMD and dragged the "delegate" item in the "Outlets"
> section to my AppDelegate object; thus, it now shows
> "delegate: AppDelegate" in the Connections inspector
> 
> However, as I said, the menus are still disabled in every 3rd
> attempt or so :( It's really a frustrating experience. Such a
> simple project, so much pain!
> 
> Any other ideas? 
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Sometimes all my menus are disabled

2017-02-13 Thread Gary L. Wade
Your assignments for the File’s Owner and Application objects are messed up.  
First, clear the custom class values for these two objects.  After that, 
connect the delegate outlet in the Application object to your embedded 
AppDelegate object.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Feb 13, 2017, at 9:41 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
> On 13.02.2017 at 18:16 Gary L. Wade wrote:
> 
>> I haven't looked at your NIB, but I've seen something of what's
>> described with errant choices of diff tools and source code merging,
> 
> That certainly can't be the case since I'm not using any diff or
> merging tools. It's also just a single developer project, i.e.
> I'm the only one working on it. 
> 
>> usually when a user just accepts a merge without eyeballing it. If
>> you've got a history of your revisions, you should find where things
>> changed badly. Also, if you've got a built app that works, I
>> remember being able to add some extra things on older NIBs to make
>> them openable in Interface Builder, but that was a really long time ago.
> 
> Unfortunately, I don't have a history of revisions. All I can say is
> that the error doesn't occur with the old Xcode on the PowerPC Mac
> running 10.5 and also it doesn't occur with Xcode 3.2 on my x86 Mac
> running 10.6. It does, however, occur in 10.12 using the latest Xcode.
> 
> But, the project that I've uploaded to 
> http://www.falkenhahn.com/tmp/guitest.tar.gz 
> is really ridiculously simple. It's just a window, a button, and a
> menu bar. That's all. Is really nobody here able to fix this project
> *without* re-creating it from scratch? It's just a few kilobytes of
> XML after all... 
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Sometimes all my menus are disabled

2017-02-13 Thread Gary L. Wade
I haven't looked at your NIB, but I've seen something of what's described with 
errant choices of diff tools and source code merging, usually when a user just 
accepts a merge without eyeballing it. If you've got a history of your 
revisions, you should find where things changed badly. Also, if you've got a 
built app that works, I remember being able to add some extra things on older 
NIBs to make them openable in Interface Builder, but that was a really long 
time ago.

When editing the text of a NIB, you have to be really careful with internal 
identifiers, which are essentially freeze-dried pointers within the NIB, and 
this may be why your forensic work is failing. When I've had to resort to this 
(nowadays in cases of auto layout mainly) I let Apple know that this is the 
only way I could do this or that.

Basically, try to find your oldest working version and go forward with that. If 
you can compare a working vs immediately non-working, that's even better.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Feb 13, 2017, at 8:58 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
>> On 13.02.2017 at 17:33 じょいすじょん wrote:
>> 
>> Yeah, my first suggestion didn't work, but points out the problem overall in 
>> you nib.
>> Looks like somebody did try to edit the xml before and munged it.
> 
> I certainly did not mess with the XML! Xcode must have messed this up when 
> converting
> the nib file from the old Xcode PowerPC project format to the new one. 
> 
>> You also have nested menu duplicates inside your menus in the nib file 
>> itself!
> 
>> MainMenu
>>Hollywood
>>Menu
>>About Hollywood
>>Separator
>>MainMenu (duplicated here as sub menu...)
>>Preferences
>>... (and on)
> 
> 
>> Delete that other MainMenu inside and it seems to work thus far.
> 
> I've removed the complete duplicate MainMenu tree (the one after the separator
> item, see above) from designable.nib using a text editor. However, it still
> doesn't work. Same behaviour as before. 
> 
> 
> 
> This annoying issue is just another reason why I prefer doing things in code.
> This has already cost me hours over hours and it's still not solved. Even
> worse, there's a profound feeling of helplessness in the air. And re-creating
> everything from scratch is not an option! I certainly did not mess with the
> XML. Xcode must have messed this up when converting the project from the
> old format to the new one. All such things wouldn't be possible with code.
> Code could be cleanly adapted to new designs while nobody can tell what black
> magic is going on inside those arcane nib files. It's quite depressing. $0.02
> 
> 
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Enabling UISearchBar cancel button?

2017-01-12 Thread Gary L. Wade
Your experience mirrors my own.  Look at what I wrote, and you should be closer 
to your goals.  I was also using a customized refresh control, and it appears 
sufficiently correct when pulling, between the search bar and collection view.  
You might need to adjust some values for your needs, though.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Jan 12, 2017, at 12:57 PM, Rick Mann <rm...@latencyzero.com> wrote:
> 
> I need my search bar to appear under the nav bar. We also have an extra view 
> outside and above the collection view. On top of that, I don't create a new 
> view for the results, but rather use the existing view. Once the user selects 
> an item that causes a push, and then goes back, everything is wonky. This is 
> in part due to a modal presentation of the search controller. I tried to 
> change that, but I could not get the UISearchBar to present the way I wanted 
> to (inserting it into the view hierarchy and adding constraints just didn't 
> seem to work right)
> 
> Now that I control the UISearchBar, it's always there, and all I do is adjust 
> the top constraint constant. The only problem is that the cancel button 
> behaves differently.
> 
> I'm going to try to explicitly set focus in the search field.
> 
>> On Jan 12, 2017, at 08:52 , Gary L. Wade <garyw...@desisoftsystems.com> 
>> wrote:
>> 
>> In what way is its controller getting in the way? Those do a lot together. 
>> If used with a collection view, you might find my solution helps:
>> 
>> https://whatweretheythinkingblog.wordpress.com/2016/11/19/effectively-using-uisearchcontroller-with-uicollectionview/
>> --
>> Gary L. Wade (Sent from my iPad)
>> http://www.garywade.com/
>> 
>> On Jan 11, 2017, at 8:17 PM, Rick Mann <rm...@latencyzero.com> wrote:
>> 
>>> I'm creating and displaying a UISearchBar without using UISearchController 
>>> (it gets in the way).
>>> 
>>> My UISearchBar is installed in the storyboard via IB. I animate it into 
>>> position in my UI when the user taps a button. However, the Cancel button 
>>> is disabled. I pre-load the search bar with the text of the last search, so 
>>> the button should be enabled.
>>> 
>>> Before, when I was using UISearchController, it was enabled. Now it's not, 
>>> until the user taps on it!
>>> 
>>> Any idea how to enable it? Thanks!
>>> 
>>> -- 
>>> Rick Mann
>>> rm...@latencyzero.com
>>> 
> 
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
> 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Enabling UISearchBar cancel button?

2017-01-12 Thread Gary L. Wade
In what way is its controller getting in the way? Those do a lot together. If 
used with a collection view, you might find my solution helps:

https://whatweretheythinkingblog.wordpress.com/2016/11/19/effectively-using-uisearchcontroller-with-uicollectionview/
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Jan 11, 2017, at 8:17 PM, Rick Mann <rm...@latencyzero.com> wrote:
> 
> I'm creating and displaying a UISearchBar without using UISearchController 
> (it gets in the way).
> 
> My UISearchBar is installed in the storyboard via IB. I animate it into 
> position in my UI when the user taps a button. However, the Cancel button is 
> disabled. I pre-load the search bar with the text of the last search, so the 
> button should be enabled.
> 
> Before, when I was using UISearchController, it was enabled. Now it's not, 
> until the user taps on it!
> 
> Any idea how to enable it? Thanks!
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
> 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: 12 hr vs 24 hr time display

2017-01-03 Thread Gary L. Wade
In that case, see if a call like this would work for you in all supported 
locales:

Objective-C
formattedDate = [NSDateFormatter localizedStringFromDate:date
dateStyle:NSDateFormatterNoStyle
timeStyle:NSDateFormatterShortStyle];

or:

Swift
let formattedDate = DateFormatter.localizedString 
(from:date,dateStyle:.none,timeStyle:.short)

If that doesn’t work, look at the comparable method in 
NSDateComponentsFormatter.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Jan 3, 2017, at 4:12 PM, Sandor Szatmari <admin.szatmari@gmail.com> 
> wrote:
> 
> Gary,
> 
> On Jan 3, 2017, at 18:40, Gary L. Wade <garyw...@desisoftsystems.com 
> <mailto:garyw...@desisoftsystems.com>> wrote:
> 
>> What I’m getting at is how relevant is it to your app that you know if and 
>> where the time-of-day indicators exist in addition to the 24-hour setting.  
>> Answering those questions should be what determines your next steps.  
>> As mentioned, the alarm clock has a long history on the Mac whereas the 
>> Unicode underpinnings for these locale settings are "relatively recent.”  If 
>> all you care about is putting out a time, try using 
>> localizedStringFromDate:….
> All I ever display is hours and minutes for the purposes of this app.  This 
> is the simple part.  It was deciding whether or not to display 24 or 12 hour 
> time which was at question.
> 
>> If you absolutely have to have full control over the format string, unless 
>> the user wants a change, always use the system settings, and model your 
>> override UI after that provided in the system preferences.
> Yea, I thought about duplicating the system's UI, but I find it hard to 
> decide to emulate something I think could be better.  But, it might be the 
> most consistent experience for the user.
> 
>>  If you’re wanting even greater details, try looking for IBM’s ICU test 
>> pages;
> Great suggestion, thanks!
> 
> Sandor
> 
>> I’m sure they’re still around somewhere, and they allow you to run through 
>> all locales in existence, even some that Apple may not currently support.
>> --
>> Gary L. Wade
>> http://www.garywade.com/ <http://www.garywade.com/>
>>> On Jan 3, 2017, at 1:02 PM, Sandor Szatmari <admin.szatmari@gmail.com 
>>> <mailto:admin.szatmari@gmail.com>> wrote:
>>> 
>>> Gary,
>>> 
>>> On Jan 3, 2017, at 14:52, Gary L. Wade <garyw...@desisoftsystems.com 
>>> <mailto:garyw...@desisoftsystems.com>> wrote:
>>> 
>>>> Is there a problem with using +[NSDateFormatter 
>>>> localizedStringFromDate:dateStyle:timeStyle:]?  Depending on your needs, 
>>>> you might also consider +[NSCalendar autoupdatingCurrentCalendar].
>>> 
>>> I am looking for detecting whether or not the system defaults to 12 or 24 
>>> hr time.  The obj-c method I'm already 'parsing', 
>>> -dateFormatFromTemplate:::, returns a template string with well defined 
>>> formatting tokens that are easy to detect.  Plus they directly reflect the 
>>> user's Locale & Region settings.
>>>> 
>>>> 
>>>> A user typically “sets” their region settings when they set up their Mac, 
>>>> and the choice of 12/24 hour display defaults to what the selected region 
>>>> uses.  Few people change things after that, although I am, preferring a 
>>>> four-digit year vs two-digit for the short date format.
>>> 
>>> Great point!  This is exactly why I wanted to follow a user's Locale & Date 
>>> preference.  The only issue I had was that the preference's place of 
>>> definition appeared vague to me.  It is tenuously tied to the Date & Time 
>>> preference for the menu bar clock.  Your point is good because user's 
>>> decide this once, early on.  Why should they have to specify it for every 
>>> application.  Maybe providing an option to override the default behavior is 
>>> the way to go.  Maybe a three state toggle or matrix.  
>>> 
>>> A. Follow Locale & Region
>>> B. Override with 12 hr
>>> C. Override with 24 hr
>>> 
>>> There is some redundancy in there depending on the Locale & Region setting 
>>> but, at least to me it's self explanatory.  Is that too confusing?
>>> 
>>> Thanks,
>>> Sandor
>>> 
>>>> --
>>>> Gary L. Wade
>>>> http://www.garywade.com/ <http://www.garywade.com/>
>>>>> On Jan 3, 2017, at 8:34 AM, Sandor Szatmari <admin.szatmari@gmail.com 
>>>>> 

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Gary L. Wade
What I’m getting at is how relevant is it to your app that you know if and 
where the time-of-day indicators exist in addition to the 24-hour setting.  
Answering those questions should be what determines your next steps.  As 
mentioned, the alarm clock has a long history on the Mac whereas the Unicode 
underpinnings for these locale settings are "relatively recent.”  If all you 
care about is putting out a time, try using localizedStringFromDate:…. If you 
absolutely have to have full control over the format string, unless the user 
wants a change, always use the system settings, and model your override UI 
after that provided in the system preferences.  If you’re wanting even greater 
details, try looking for IBM’s ICU test pages; I’m sure they’re still around 
somewhere, and they allow you to run through all locales in existence, even 
some that Apple may not currently support.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Jan 3, 2017, at 1:02 PM, Sandor Szatmari <admin.szatmari@gmail.com> 
> wrote:
> 
> Gary,
> 
> On Jan 3, 2017, at 14:52, Gary L. Wade <garyw...@desisoftsystems.com 
> <mailto:garyw...@desisoftsystems.com>> wrote:
> 
>> Is there a problem with using +[NSDateFormatter 
>> localizedStringFromDate:dateStyle:timeStyle:]?  Depending on your needs, you 
>> might also consider +[NSCalendar autoupdatingCurrentCalendar].
> 
> I am looking for detecting whether or not the system defaults to 12 or 24 hr 
> time.  The obj-c method I'm already 'parsing', -dateFormatFromTemplate:::, 
> returns a template string with well defined formatting tokens that are easy 
> to detect.  Plus they directly reflect the user's Locale & Region settings.
>> 
>> 
>> A user typically “sets” their region settings when they set up their Mac, 
>> and the choice of 12/24 hour display defaults to what the selected region 
>> uses.  Few people change things after that, although I am, preferring a 
>> four-digit year vs two-digit for the short date format.
> 
> Great point!  This is exactly why I wanted to follow a user's Locale & Date 
> preference.  The only issue I had was that the preference's place of 
> definition appeared vague to me.  It is tenuously tied to the Date & Time 
> preference for the menu bar clock.  Your point is good because user's decide 
> this once, early on.  Why should they have to specify it for every 
> application.  Maybe providing an option to override the default behavior is 
> the way to go.  Maybe a three state toggle or matrix.  
> 
> A. Follow Locale & Region
> B. Override with 12 hr
> C. Override with 24 hr
> 
> There is some redundancy in there depending on the Locale & Region setting 
> but, at least to me it's self explanatory.  Is that too confusing?
> 
> Thanks,
> Sandor
> 
>> --
>> Gary L. Wade
>> http://www.garywade.com/ <http://www.garywade.com/>
>>> On Jan 3, 2017, at 8:34 AM, Sandor Szatmari <admin.szatmari@gmail.com 
>>> <mailto:admin.szatmari@gmail.com>> wrote:
>>> 
>>> Jeremy,
>>> 
>>>> On Jan 3, 2017, at 10:30, Jeremy Pereira 
>>>> <jeremy.pere...@aptosolutions.co.uk 
>>>> <mailto:jeremy.pere...@aptosolutions.co.uk>> wrote:
>>>> 
>>>> 
>>>>> On 3 Jan 2017, at 06:16, Sandor Szatmari <admin.szatmari@gmail.com 
>>>>> <mailto:admin.szatmari@gmail.com>> wrote:
>>>>> 
>>>>> I am working on a small application where the primary function is to 
>>>>> display the time to the user.  My hope was to honor the user's preference 
>>>>> setting.  I am either missing something or honoring the user's preference 
>>>>> is harder than expected.
>>>>> 
>>>>> So, there are two places to set 24 hr time display.
>>>>> 
>>>>> 1. Date & Time preference panel
>>>>> 2. Language & Region preference panel 
>>>>> 
>>>>> The cocoa frameworks react differently depending on where you set this.
>>>>> 
>>>>> If set by method 1, cocoa frameworks seem unaware of this setting and it 
>>>>> appears this is cosmetic in that it only affects the display of the clock 
>>>>> in the NSStatusBar.
>>>>> 
>>>>> If set by method 2, cocoa frameworks reflect this and the Date & Time 
>>>>> setting is disabled noting that the setting has been overridden.
>>>>> 
>>>>> So if a user uses method 1, potentially unaware of method 2, how should 
>>>>> o

Re: 12 hr vs 24 hr time display

2017-01-03 Thread Gary L. Wade
Is there a problem with using +[NSDateFormatter 
localizedStringFromDate:dateStyle:timeStyle:]?  Depending on your needs, you 
might also consider +[NSCalendar autoupdatingCurrentCalendar].

A user typically “sets” their region settings when they set up their Mac, and 
the choice of 12/24 hour display defaults to what the selected region uses.  
Few people change things after that, although I am, preferring a four-digit 
year vs two-digit for the short date format.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Jan 3, 2017, at 8:34 AM, Sandor Szatmari <admin.szatmari@gmail.com> 
> wrote:
> 
> Jeremy,
> 
>> On Jan 3, 2017, at 10:30, Jeremy Pereira 
>> <jeremy.pere...@aptosolutions.co.uk> wrote:
>> 
>> 
>>> On 3 Jan 2017, at 06:16, Sandor Szatmari <admin.szatmari@gmail.com> 
>>> wrote:
>>> 
>>> I am working on a small application where the primary function is to 
>>> display the time to the user.  My hope was to honor the user's preference 
>>> setting.  I am either missing something or honoring the user's preference 
>>> is harder than expected.
>>> 
>>> So, there are two places to set 24 hr time display.
>>> 
>>> 1. Date & Time preference panel
>>> 2. Language & Region preference panel 
>>> 
>>> The cocoa frameworks react differently depending on where you set this.
>>> 
>>> If set by method 1, cocoa frameworks seem unaware of this setting and it 
>>> appears this is cosmetic in that it only affects the display of the clock 
>>> in the NSStatusBar.
>>> 
>>> If set by method 2, cocoa frameworks reflect this and the Date & Time 
>>> setting is disabled noting that the setting has been overridden.
>>> 
>>> So if a user uses method 1, potentially unaware of method 2, how should one 
>>> go about determining the user's intentions.
>> 
>> It seems obvious to me that method 1 only refers to the clock display in the 
>> menu bar and nothing else. It’s a sub setting of 
>> “Show date and time in the menu bar”.
>> 
>> If you honour whatever preference is set by method 2 as your code fragment 
>> below does, you’ll be fine.
>> 
> I feel like fewer people use/find method 2, simply stopping at method 1.  
> This may be a gross assumption on my part.  Under my assumption they would 
> simply think my app doesn't display 24 hr time or respect the system setting. 
>  Am I being to sensitive here?
> 
> Sandor
>> 
>>> 
>>> There are deprecated methods using: (didn't try, it's deprecated)
>>>  NSUserDefaults with the key NSShortTimeDateFormatString
>>> 
>>> There are supported methods using: (works with method 2)
>>>  NSString *format = [NSDateFormatter dateFormatFromTemplate:@"j" options:0 
>>> locale:[NSLocale currentLocale]];
>>>  BOOL is24Hour = ([format rangeOfString:@"a"].location == NSNotFound);
>>> 
>>> Can anyone provide any clarity here?
>>> 
>>> Sandor
>>> ___
>>> 
>>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>> 
>>> Please do not post admin requests or moderator comments to the list.
>>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>> 
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/cocoa-dev/adc%40jeremyp.net
>>> 
>>> This email sent to a...@jeremyp.net
>> 
>> --
>> Jeremy Pereira
>> jeremy.pere...@aptosolutions.co.uk
>> 07884 265457

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Autolayout warnings

2016-12-14 Thread Gary L. Wade
In case it helps with your future animatable design, my particular app has a 
layout kind of like this:

——
| | (8 points separation)Title (could be long)
| | (8 points separation)Subtitle (could be long)
—— 

and I used something like this in viewDidLoad to preserve the values before I 
had any data:

-(void)viewDidLoad
{
self.iconIndicatorWidthOriginalConstant =
self.iconIndicatorWidth.constant;
self.iconTitleLabelLeadingOriginalConstant =
self.iconTitleLabelLeading.constant;
self.iconSubtitleLabelLeadingOriginalConstant =
self.iconSubtitleLabelLeading.constant;

self.iconIndicatorWidth.constant = 0;
}

and I used something like this when I knew whether or not I wanted to show the 
icon indicator (the box to the left of the title and subtitle):

-(void)updateUI:(BOOL )showIconIndicator
{
CGFloat newIconIndicatorWidthConstant;
CGFloat newIconTitleLabelLeadingConstant;
CGFloat newIconSubtitleLabelLeadingConstant;

if (showIconIndicator)
{
newIconIndicatorWidthConstant =
self.iconIndicatorWidthOriginalConstant;
newIconTitleLabelLeadingConstant =
self.iconTitleLabelLeadingOriginalConstant +
self.iconIndicatorWidthOriginalConstant + 8;
newIconSubtitleLabelLeadingConstant =
self.iconSubtitleLabelLeadingOriginalConstant +
self.iconIndicatorWidthOriginalConstant + 8;
}
else
{
newIconIndicatorWidthConstant = 0;
newIconTitleLabelLeadingConstant =
self.iconTitleLabelLeadingOriginalConstant;
newIconSubtitleLabelLeadingConstant =
self.iconSubtitleLabelLeadingOriginalConstant;
}

if (newIconIndicatorWidthConstant != self.iconIndicatorWidth.constant)
{
[self.iconIndicator.superview layoutIfNeeded];
[UIView animateWithDuration:0.3 animations:
^{
self.iconIndicatorWidth.constant =
newIconIndicatorWidthConstant;
self.iconTitleLabelLeading.constant =
newIconTitleLabelLeadingConstant;
self.iconSubtitleLabelLeading.constant =
newIconSubtitleLabelLeadingConstant;

[self.iconIndicator.superview layoutIfNeeded];
}];
}
}

--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Dec 14, 2016, at 3:39 PM, Doug Hill <cocoa...@breaqz.com> wrote:
> 
> Great, more good stuff to know!
> 
> However, trying this out I see that some views animate and others don't (just 
> jump into place). I guess I'll look into a more animatable design.
> 
> Doug Hill
> 
>> On Dec 14, 2016, at 3:24 PM, Ken Thomases <k...@codeweavers.com> wrote:
>> 
>> On Dec 14, 2016, at 5:15 PM, Doug Hill <cocoa...@breaqz.com> wrote:
>>> 
>>> Ok, this is more good information to keep in mind when designing autolayout 
>>> constraints. Given that my design isn't animatable, it's back to the 
>>> autolayout drawing board. Again.
>> 
>> I think it works to animate a change of constraints if you do the 
>> -layoutIfNeeded on the window within the animation context.  It's 
>> technically animating the frame changes rather than the constraints, which 
>> can transition through some different states and even temporarily violate 
>> constraints, but for this case it should work.
>> 
>> Regards,
>> Ken
>> 
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Autolayout warnings

2016-12-14 Thread Gary L. Wade
Right, activate and deactivate are not animatable, but the constant values in 
constraints are.

True, it depends on what you’re showing as to whether to shrink or move your 
view.  When I wanted to use a search bar in UISearchController with a 
collection view in iOS to appear similarly as UITableView, I moved the search 
bar:

https://whatweretheythinkingblog.wordpress.com/2016/11/19/effectively-using-uisearchcontroller-with-uicollectionview/

When I wanted to show an icon to the left of a title, where the item may not 
have an icon but was only available through a REST call, I found it more 
attractive to grow the icon and compress the title in that animation, choosing 
a scale-to-fill option, when I determined there was an icon.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Dec 14, 2016, at 2:52 PM, Doug Hill <cocoa...@breaqz.com> wrote:
> 
> Gary,
> 
> Thanks for the reply.
> I tried moving the container rather than resizing to 0 because there's a 
> table inside this view and it will relayout when resizing. For an animation, 
> I guess it depends on what effect you want: either seeing the view move or 
> resize to 0.
> 
> Oddly, when I put my code to activate/deactivate constraints inside a [UIView 
> animateWithDuration…] I get no animation. :(
> 
> Doug Hill
> 
>> On Dec 14, 2016, at 2:49 PM, Gary L. Wade <garyw...@desisoftsystems.com 
>> <mailto:garyw...@desisoftsystems.com>> wrote:
>> 
>> If I understand you correctly, you might prefer the approach I chose to do.  
>> Rather than activating and deactivating constraints (BTW, you should always 
>> deactivate before having multiple actives), set your constraints up to 
>> always be active but change the width for the one you’re hiding to 0 and the 
>> other to be the extra size needed to fill the gap.  I also chose to animate 
>> the constant values, so the size-change is smooth to the user.
>> --
>> Gary L. Wade
>> http://www.garywade.com/ <http://www.garywade.com/>
>>> On Dec 14, 2016, at 2:19 PM, Doug Hill <cocoa...@breaqz.com 
>>> <mailto:cocoa...@breaqz.com>> wrote:
>>> 
>>> I'm seeing warnings in the console when I dynamically make autolayout 
>>> constraints active/inactive at runtime.
>>> 
>>> I have two constraints that align a container view leading or trailing edge 
>>> with another view's edge. This is to move the container onscreen or 
>>> offscreen. I have another view whose trailing edge aligns with the leading 
>>> edge of the first container view so it moves with it as autolayout 
>>> constraints change.
>>> 
>>> At runtime, I make one of these constraints active and the other inactive, 
>>> like so:
>>> 
>>> - (IBAction)toggleCommentsVisibility:(id)sender
>>> {
>>> self.commentsAreHidden ? [self showComments:self] : [self 
>>> hideComments:self]; 
>>> }
>>> 
>>> - (IBAction)showComments:(id)sender
>>> {
>>> self.showCommentsConstraint.active = YES;
>>> self.hideCommentsContainerConstraint.active = NO;
>>> 
>>> self.commentsAreHidden = NO;
>>> }
>>> 
>>> - (IBAction)hideComments:(id)sender
>>> {
>>> self.showCommentsConstraint.active = NO;
>>> self.hideCommentsContainerConstraint.active = YES;
>>> 
>>> self.commentsAreHidden = YES;
>>> }
>>> 
>>> When I call showComments, I get the following warning in the console:
>>> 
>>> =
>>> 
>>> Unable to simultaneously satisfy constraints.
>>> Probably at least one of the constraints in the following list is one you 
>>> don't want. 
>>> Try this: 
>>> (1) look at each constraint and try to figure out which you don't 
>>> expect; 
>>> (2) find the code that added the unwanted constraint or constraints and 
>>> fix it. 
>>> (
>>>">> UIView:0x7f91426d9db0.width == 0.33*UIView:0x7f91426def30.width>",
>>>">> H:[UIView:0x7f91426d7f00]-(0)-[UIView:0x7f91426d9db0]>",
>>>">> UIView:0x7f91426d9db0.trailing == UIView:0x7f91426d7f00.trailing>",
>>>">> H:[UIView:0x7f91426def30(768)]>"
>>> )
>>> 
>>> Will attempt to recover by breaking constraint 
>>> >> H:[UIView:0x7f91426d7f00]-(0)-[UIView:0x7f91426d9db0]>
>>> 
>>> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to 
>>> catch this in the debugger.
>>

Re: Autolayout warnings

2016-12-14 Thread Gary L. Wade
If I understand you correctly, you might prefer the approach I chose to do.  
Rather than activating and deactivating constraints (BTW, you should always 
deactivate before having multiple actives), set your constraints up to always 
be active but change the width for the one you’re hiding to 0 and the other to 
be the extra size needed to fill the gap.  I also chose to animate the constant 
values, so the size-change is smooth to the user.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Dec 14, 2016, at 2:19 PM, Doug Hill <cocoa...@breaqz.com> wrote:
> 
> I'm seeing warnings in the console when I dynamically make autolayout 
> constraints active/inactive at runtime.
> 
> I have two constraints that align a container view leading or trailing edge 
> with another view's edge. This is to move the container onscreen or 
> offscreen. I have another view whose trailing edge aligns with the leading 
> edge of the first container view so it moves with it as autolayout 
> constraints change.
> 
> At runtime, I make one of these constraints active and the other inactive, 
> like so:
> 
> - (IBAction)toggleCommentsVisibility:(id)sender
> {
>   self.commentsAreHidden ? [self showComments:self] : [self 
> hideComments:self]; 
> }
> 
> - (IBAction)showComments:(id)sender
> {
>   self.showCommentsConstraint.active = YES;
>   self.hideCommentsContainerConstraint.active = NO;
> 
>   self.commentsAreHidden = NO;
> }
> 
> - (IBAction)hideComments:(id)sender
> {
>   self.showCommentsConstraint.active = NO;
>   self.hideCommentsContainerConstraint.active = YES;
> 
>   self.commentsAreHidden = YES;
> }
> 
> When I call showComments, I get the following warning in the console:
> 
> =
> 
> Unable to simultaneously satisfy constraints.
> Probably at least one of the constraints in the following list is one you 
> don't want. 
> Try this: 
>   (1) look at each constraint and try to figure out which you don't 
> expect; 
>   (2) find the code that added the unwanted constraint or constraints and 
> fix it. 
> (
>" UIView:0x7f91426d9db0.width == 0.33*UIView:0x7f91426def30.width>",
>" H:[UIView:0x7f91426d7f00]-(0)-[UIView:0x7f91426d9db0]>",
>" UIView:0x7f91426d9db0.trailing == UIView:0x7f91426d7f00.trailing>",
>" H:[UIView:0x7f91426def30(768)]>"
> )
> 
> Will attempt to recover by breaking constraint 
>  H:[UIView:0x7f91426d7f00]-(0)-[UIView:0x7f91426d9db0]>
> 
> Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch 
> this in the debugger.
> 
> =
> 
> This is puzzling because IB doesn't give me any autolayout errors/warning 
> when I manually activate/deactivate these constraints. Also, I don't get this 
> runtime warning when calling hideComments, only the 'show' case. Finally, 
> things actually work at runtime because it's nice enough to "break" the 
> constraint that I deactivated in code. But I would like to not have these 
> warnings.
> 
> Any ideas on what's going on how I might go about debugging this?
> 
> Doug Hill
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Control default color inconsistencies

2016-12-14 Thread Gary L. Wade
Set the background color of self.view to something other than black and your 
button and label will be more visible. I believe the color for your table view 
is a UIColor defined as a category in UITableView.h or close to there.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Dec 14, 2016, at 9:38 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
>> On 14.12.2016 at 17:54 じょいすじょん wrote:
>> 
>> Nobody can guess what you are actually doing.
>> Please share some code so people can help you.
> 
> There is not much code to share. My code just creates UILabel, UIButton,
> and UITableView with absolutely minimal customization, the intention
> being to check out the default look of those controls. But, as I wrote in
> my last mail, this default look is pretty confusing and irritating because
> background and foreground color aren't consistent at all.
> 
> I'd like to avoid hard-coding specific colors as this is bad GUI coding
> practice on the desktop systems I come from. I'd like iOS to use the
> default colors instead but I'm not sure how to do this.
> 
> For reference, here is how I create the objects:
> 
>UIScreen *myScreen = [UIScreen mainScreen];
>CGRect rect = [myScreen bounds];
> 
>// results in a UILabel that has black background and foreground, i.e. 
> text is unreadable
>UILabel *header1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 
> rect.size.width, 48)];
>header1.text = @"Label test";
>[self.view addSubview:header1];
> 
>// results in gray background with black text
>UITableView *tableView = [[UITableView alloc] 
> initWithFrame:CGRectMake(0, 48, rect.size.width, rect.size.height - (48 + 
> 80))];
>tableView.dataSource = self;
>tableView.delegate = self;
>tableView.autoresizingMask = 
> UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;
>[tableView registerClass:[UITableViewCell class] 
> forCellReuseIdentifier:@"Cell"];
>[tableView reloadData];
>[self.view addSubview:tableView];
> 
>// results in black background with blue label text
>UIButton *optionsButton = [UIButton 
> buttonWithType:UIButtonTypeRoundedRect];
>[optionsButton addTarget:self action:@selector(clickOptions:) 
> forControlEvents:UIControlEventTouchUpInside];
>[optionsButton setFrame:CGRectMake(0, rect.size.height - 80, 
> rect.size.width, 80)];
>[optionsButton setTitle:@"Button test" forState:UIControlStateNormal];
>[optionsButton setExclusiveTouch:YES];
>[self.view addSubview:optionsButton];
> 
> The controls are created in a UIViewController inside the viewDidLoad() 
> method. This
> UIViewController is then set as the UIWindow's rootViewController.
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Control default color inconsistencies

2016-12-14 Thread Gary L. Wade
Seeing code and how you have things visually laid out will help, but most 
likely what you think are black backgrounds may be clear backgrounds showing 
through to another view or super view that has black as its background color. 
You may have very valid reasons for doing this in code, but before doing that, 
try working through things in Interface Builder first so you get an idea of 
what you need to do.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Dec 14, 2016, at 7:47 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
> I'm creating my GUI programmatically. It simply consists of a UILabel,
> a UITableView and two UIButtons.
> 
> When creating those three controls I've noticed that they all seem to
> use different color schemes by default which makes the GUI look rather
> silly.
> 
> Here are my observations:
> 
> 1) By default, UILabel seems to set both background and text color to
> black, i.e. nothing is readable before you change the colors to some
> more meaningful values.
> 
> 2) By default, UITableView appears with a gray background and black
> text on top.
> 
> 3) By default, UIButton appears with a black background and blue (!)
> text on top.
> 
> Is there any rationale why all three controls seem to use entirely
> different color schemes by default here? 
> 
> When writing desktop GUIs it's bad practice to use custom color schemes
> because they might clash with the user's theme settings. Doesn't such
> a paradigm apply to iOS as well? Or am I really forced to explicitly
> set foreground and background colors for each UI control? I'd really
> prefer to use the default iOS look instead. On Android I don't have to
> set background and foreground colors either, the OS will automatically
> use some meaningful and consistent (!) default colors.
> 
> This makes me wonder if there is a default iOS color scheme for apps
> at all? Or are all apps supposed to define their own color scheme?
> If there is a default iOS color scheme, why don't the controls use
> it then when not specifying any colors?
> 
> It's all quite confusing... I hope somebody can shed some more light
> onto this. But please no lectures on that I should use Interface Builder,
> Storyboard, or whatever it is called now instead, I really like to do
> things manually - always have, always will ;)
> 
> -- 
> Best regards,
> Andreas Falkenhahn  mailto:andr...@falkenhahn.com
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: NSTouchBar in Carbon

2016-12-12 Thread Gary L. Wade
NSApplication may add too much conflicting infrastructure to a Carbon app, but 
I don’t know for sure since I went whole-Cocoa after first adding the 
drag-to-trash-poof animation to a Carbon app years ago.  However, you might be 
able to subclass NSWindow and add your own makeTouchBar method to it and use 
that to call initWithWindowRef: on your Carbon window.  That may be enough to 
tie into Cocoa’s responder chain; not sure how controls can be bridged from 
Carbon to Cocoa, but at least the NSWindow would be the best place to know how 
to configure a touch bar.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Dec 12, 2016, at 11:22 AM, Jens Alfke <j...@mooseyard.com> wrote:
> 
> I haven’t used NSTouchBar at all yet, but from the API in the header file, it 
> looks like you can instantiate one with -init, configure it, and then assign 
> it to the touchBar property of the NSApplication instance.
> 
> (I'm assuming that even a Carbon-based app process has an NSApplication these 
> days. You can access it via the global variable NSApp.)
> 
> —Jens

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Drag UITableView up/down

2016-12-06 Thread Gary L. Wade
It sounds like what you’re really wanting to do is emulate what Apple’s News 
app is doing, right?

First, you set your navigation controller’s hidesBarsOnSwipe to true.  The next 
step is the more difficult one, but it depends on how you want your status bar 
to appear and if you want a mini-navigation bar rather than just the status bar:

1. Override your table view controller’s preferredStatusBarStyle to return the 
style that matches with your content or mini-navigation bar.  I chose light 
because I had an opaque mini-navigation bar that was dark.  You get the default 
setting if you don’t do this, and it may be difficult to see.
2. If you want your status bar opaque and/or a mini-navigation bar, you’ll need 
to add a subview to your table view controller’s view’s superview constrained 
to (top,left,trailing)=(0,0,0) and height=20.  If you want a mini-navigation 
bar, you’ll need to make that height what you need it to be.  I wanted my 
navigation bar to have three states like News: expanded, mini, collapsed.  In 
expanded mode, you get the normal navigation bar.  In mini, the height might be 
40 (20 extra points for the condensed title or info), and 20 for collapsed.

Based on my observations, News expands when you tap on the status bar in the 
collapsed mode, so you’ll need to override that operation, to provide that 
rather than jump to the top immediately.

There’s some other navigation controller settings for the navigation bar that 
you may find useful around hidesBarsOnSwipe so check those out.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Dec 6, 2016, at 11:38 AM, Eric E. Dolecki <edole...@gmail.com> wrote:
> 
> I'm looking for a chunk of view controller code that allows for:
> 
> A UITableView. You can drag the whole table up (not the cells) to a limit
> from the top of the VC, say like 100px. When you've reached that, the table
> will scroll up normally.
> 
> When you scroll the table down (cells) and reach item 0, and continue to
> swipe down, the table will slide down with the gesture until a position
> from the bottom.
> 
> Seems like this is a current trend in some applications. I have a lot of it
> in place, but the scrolling down until 1st row, then move table is elusive
> at the moment.
> 
> A super-simple project or something to get me going would be appreciated.
> 
> Thanks for your time & attention,
> Eric

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-03 Thread Gary L. Wade
Okay, enough with the F.U.D. which I already addressed. If you really want 
answers, go search the details yourself; they are there but maybe not as well 
found anymore, and some are mentioned in related WWDC talks. As for the new 
point, all dylibs must be part of an existing installation and code-signed; no 
downloadable plugins are allowed.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Dec 3, 2016, at 3:00 AM, Andreas Falkenhahn <andr...@falkenhahn.com> wrote:
> 
>> On 03.12.2016 at 00:40 Jens Alfke wrote:
>> 
>> dlopen is hardly undocumented; it’s part of the core BSD Unix
>> library. It’s got a man page and everything.
> 
> That doesn't mean that it's ok to use it on iOS because of the sandbox.
> You aren't allowed to use other standard BSD functions like exit(),
> mkstemp(), exec(), system(), etc. on iOS either because of the sandbox.
> 
>> Prior to iOS 8, the sandbox that 3rd party iOS apps ran in blocked
>> calls to dlopen, as well as other attempts to load dynamic libraries
>> from within the app bundle. That is now no longer the case, so you
>> can use dlopen
> 
> Once again, that is your opinion unless there is any document from
> Apple explicitly stating that it's allowed. The fact that it works
> doesn't count :)
> 
> I don't want to sound overly pedantic here and I really believe you
> guys that probably it's really allowed to use dlopen() starting with
> iOS 8 and everything is fine. All I'm trying to stress here is that
> basically when using dlopen() we are relying on undocumented behaviour
> and there is no guarantee that what we're doing is really officially
> supported.
> 
>> That’s sort of weird; however, a framework is just a dynamic
>> library packaged with its headers in a specific bundle format. You
>> can always use a framework target and then add a script build step
>> to copy the library out of the framework.
> 
> Once again, that's relying on undocumented behaviour. It's obvious
> that a framework is just a bundle containing a dylib but nobody
> can say whether manually dlopen()ing this dylib is something that is
> allowed on iOS. Maybe future versions of iOS will block manual dlopen()
> access to the dylib inside the framework and will only allow the
> system dylib loader to open it. Who knows.
> 
>> I think the lack of a dylib target may just reflect that plug-ins
>> of the kind you’re implementing aren’t really very useful on iOS.
>> Since there’s no way to install extra plugins (downloading
>> executable code is explicitly forbidden), the set of plugins is
>> effectively fixed, meaning it would be more efficient to just
>> statically link them all into the app.
> 
> What about NSDocumentDirectory? Users could copy additional plugins
> as frameworks into the app's documents directory using iTunes. Will
> dlopen()ing such dylibs work as well? Or does it only work when the
> binaries are stored in the main bundle container?
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Migrating shared library plugins to Cocoa Touch Frameworks

2016-12-02 Thread Gary L. Wade
Documentation on Apple’s site is sometimes difficult to peruse (a whole other 
thread and, arguably, always difficult nowadays), but I can guarantee you that 
it has been documented somewhere and is supported.  I’ve been involved in the 
process of using this process to load one version of a library for a number of 
airlines’ apps that differ when running during a flight vs when the user is on 
the ground.

In case you’re not aware of this, iOS and Cocoa Touch are effectively 
synonymous, and many people use the term library and framework to be 
synonymous, so, yes, this does exist and is supported.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Dec 2, 2016, at 2:17 PM, Andreas Falkenhahn <andr...@falkenhahn.com> wrote:
> 
> On 02.12.2016 at 22:55 Pascal Bourguignon wrote:
> 
>> Yes, it’s “official”.
>> I’ve read the document about what is allowed and rejected for the
>> AppStore, and this is not rejected.
> 
> Well, just because apps that use undocumented features aren't rejected from 
> the
> app store doesn't make it official for me. To me "official" means that there
> is some word about it on https://developer.apple.com but apparently that
> isn't the case so it's an undocumented feature and nobody can predict for how
> long this is going to continue to work like it is now. It could be ditched
> any time if it's not documented. That makes me rather uneasy...
> 
> Also, there is no "Library" template for iOS in Xcode. Only a Cocoa Touch
> Framework template. This also doesn't look like dlopen() is officially
> supported on iOS.
> 
>> You would just embed the framework, without linking it.
> 
> I'm not very familiar with the latest Xcode so does this mean I should add
> my framework to "Embedded binaries" but not to "Linked Frameworks and 
> Libraries"?
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Documentation Workflow

2016-12-02 Thread Gary L. Wade
I bet the documentation has gotten leaner since Apple's developers have been 
dog-fooding the Xcode feature, Add Documentation, available under the 
Editor:Structure men path, and only using what’s in there.

Just kidding…but maybe not!
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Where are the gears?

2016-11-30 Thread Gary L. Wade
That is a bummer that Apple has made so many reusable images available for 
macOS but not as many for iOS as the original poster wanted.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Nov 30, 2016, at 9:55 AM, Richard Charles <rcharles...@gmail.com> wrote:
> 
> 
>> On Nov 30, 2016, at 1:29 AM, Gerriet M. Denkmann <gerri...@icloud.com> wrote:
>> 
>> I want a UIBarButtonItem with a picture of gears, being used to mean 
>> “Settings”.
>> This symbol is used by many apps for this function; but I cannot find this 
>> image.
>> 
>> Where is it hiding?
> 
> I use this gear image for a toolbar item in a preference panel.
> 
> [NSImage imageNamed:NSImageNameAdvanced]
> 
> --Richard Charles
> 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Flipped print previews

2016-11-21 Thread Gary L. Wade
Definitely follow that train.  Doing things with the wrong context is 
definitely one possibility.  By the way, the setNeedsDisplay doesn’t need to 
happen on that view; it could be a subview, and there could be some other 
operation that implicitly causes such a dirtying—remember, there’s also 
setNeedsDisplayInRect:.  The app I referred to was doing stuff with the current 
field editor, recalculating its size and position to provide a combo box-like 
display, as a side effect of a side effect of the draw.  There’s some graphics 
context debugging options you can turn on, as well as coloration options that 
might also help.  You mentioned you broke on setNeedsDisplay.  Try adding 
setNeedsDisplayInRect: and turn on a breakpoint for all classes, not just that 
one view.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Nov 21, 2016, at 1:13 PM, Jeff Evans <jev...@ars-nova.com> wrote:
> 
> Thanks again Gary - but I looked into this by breaking at attempts to call 
> setDisplayNeeded on the view, with no luck. Can't find anything in my code 
> that is dirtying the view during the print draw.
> 
> However, another idea arises:
> I am using this method to obtain the current CGContext  during all this 
> drawing of various objects:
> 
> NSGraphicsContext* nsContext = [NSGraphicsContext currentContext];
> CGContextRef currentCGContext = [nsContext CGContext];
> 
> I notice that during [printOperation runOperation] the nsContext returned is 
> an NSPrintPreviewGraphicsContext*, which sounds right. But if, as is usually 
> the case, the print preview draws reduced and mirrored, I force a redraw of 
> the print preview by touching one of the dialog controls - and then I get a 
> different NSPrintPreviewGraphicsContext*, and this one always works properly.
> 
> I should think that the graphics context would be the same for the initial 
> draw and a subsequent refresh, so perhaps this is a hint. The two certainly 
> behave differently. But why would the initial one be wrong?
> 
> Another hint is that sometimes the first attempt to print a file works shows 
> a correct preview, while subsequent ones require the refresh to display 
> properly.  More often the initial attempt is wrong. Don't you hate those 
> problems that are not reliably repeatable? Yet that also should be a hint, if 
> I could make sense of it.
> 
> Jeff
> 
> 
> On Nov 20, 2016, at 11:43 PM, Gary L. Wade wrote:
> 
> 
> 
> I remembered seeing something like that in an app that had been doing some 
> things deep with the drawRect: call that was causing the view to become dirty 
> again. I fixed it by getting rid of that code. Try looking for something like 
> that first.
> --
> Gary L. Wade (Sent from my iPhone)
> http://www.garywade.com/
> 
>> On Nov 20, 2016, at 9:33 PM, Jeff Evans <jev...@ars-nova.com> wrote:
>> 
>> p.s. As I was unclear: the image returns YES to flipped and draws on that 
>> assumption, looking good. When I say the image in the print dialog is 
>> "flipped" I mean that it is backwards - mirrored - the reverse of what it 
>> should be - as if it were an unflipped view - until it is drawn a second 
>> time.
>> 
>> 
>> I'm printing from a view-based OSX app (compiled for 10.11), and have found 
>> it easy to print by creating a print operation from the view in question. 
>> The view is flipped (that is, returns YES to IsFlipped) and looks good on 
>> screen. The view creates a print operation this way:
>> 
>>  NSPrintOperation* printOp = [NSPrintOperationWithView: self printInfo: 
>> [NSPrintInfo sharedPrintInfo]];
>> 
>>  //..then setting of margins, etc. in [printOp printInfo], then
>> 
>>  [printOp runOperation]
>> 
>>  Running the operation does the whole thing and creates a beautiful preview 
>> of the page - 
>> 
>>  BUT not on the first draw. The initial image displayed in the print dialog 
>> is flipped and often reduced to miniature. If you touch the pages-to-print 
>> choice, or the All choice,  the preview image in the print dialog redraws 
>> and redraws correctly. The actual print then works fine.
>> 
>>  This does make it more difficult print to pdf when the first draw is wrong, 
>> since the pdf is also wrong on the first draw. But if I choose "view pdf in 
>> preview" then all is well - it draws nicely and I can then use Preview's 
>> export command to save it, or print.
>> 
>>  But this is no way to live. Don't want to have to tell customers to use a 
>> work-around.
>> 
>>  There must be something that needs initializing that is corrected after 
>> that first draw. Or is this just a glitch?
&

Re: Flipped print previews

2016-11-20 Thread Gary L. Wade
I remembered seeing something like that in an app that had been doing some 
things deep with the drawRect: call that was causing the view to become dirty 
again. I fixed it by getting rid of that code. Try looking for something like 
that first.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Nov 20, 2016, at 9:33 PM, Jeff Evans <jev...@ars-nova.com> wrote:
> 
> p.s. As I was unclear: the image returns YES to flipped and draws on that 
> assumption, looking good. When I say the image in the print dialog is 
> "flipped" I mean that it is backwards - mirrored - the reverse of what it 
> should be - as if it were an unflipped view - until it is drawn a second time.
> 
> 
> I'm printing from a view-based OSX app (compiled for 10.11), and have found 
> it easy to print by creating a print operation from the view in question. The 
> view is flipped (that is, returns YES to IsFlipped) and looks good on screen. 
> The view creates a print operation this way:
> 
>NSPrintOperation* printOp = [NSPrintOperationWithView: self printInfo: 
> [NSPrintInfo sharedPrintInfo]];
> 
>//..then setting of margins, etc. in [printOp printInfo], then
>
>[printOp runOperation]
> 
>Running the operation does the whole thing and creates a beautiful preview 
> of the page - 
>
>BUT not on the first draw. The initial image displayed in the print dialog 
> is flipped and often reduced to miniature. If you touch the pages-to-print 
> choice, or the All choice,  the preview image in the print dialog redraws and 
> redraws correctly. The actual print then works fine.
> 
>This does make it more difficult print to pdf when the first draw is 
> wrong, since the pdf is also wrong on the first draw. But if I choose "view 
> pdf in preview" then all is well - it draws nicely and I can then use 
> Preview's export command to save it, or print.
> 
>But this is no way to live. Don't want to have to tell customers to use a 
> work-around.
> 
>There must be something that needs initializing that is corrected after 
> that first draw. Or is this just a glitch?
> 
> 
>Thanks, Jeff
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: observeValueForKeyPath:... called too often in macOS 12

2016-10-18 Thread Gary L. Wade
I have a thought.  Do you have a binding somewhere on a property in 
NSUserDefaults?  Maybe your document is getting synchronized to iCloud and/or 
getting autosaved very often?  These are things I’ve seen that can cause 
uncharacteristically often updates.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Oct 18, 2016, at 7:32 PM, Gerriet M. Denkmann <g...@mdenkmann.de> wrote:
> 
> 
>> On 19 Oct 2016, at 02:00,Jerome Krinock <je...@ieee.org>:
>> 
>>> On 2016 Oct 14, at 23:08, Gerriet M. Denkmann <g...@mdenkmann.de> wrote:
>>> 
>>> My app (macOS 12) observes a value in NSUserDefaults.  Starting with macOS 
>>> 12 observeValueForKeyPath:… is called at the start of the program, although 
>>> nothing has changed yet.  When the value actually changes, it is called 
>>> twice.
>> 
>> I just added some code to one of my apps, to test this.  It confirmed your 
>> observations, although I only tested in 10.12.
>> 
>>> Also: NSKeyValueObservingOptionNew or NSKeyValueObservingOptionOld just 
>>> return NSNull instead of old or new values.
>> 
>> That only happens during that first spurious call, when the observer is 
>> added.
> 
> Happens for me all the time. Never seen anything other than NSNull.
> 
> Current work-around: just ignore every second notification (i.e. ginore 1., 
> 3rd, 5th etc.).
> Not a very good solution, rather bound to break sooner or later. But okay for 
> the time being.
> 
>> 
>>> If indeed this behavior is new in 10.12, it certainly warrants a Bug Report.
> 
> Ok, will do so.
> 
> Kind regards,
> 
> Gerriet.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Getting/Setting FinderInfo attributes using native Cocoa API?

2016-10-13 Thread Gary L. Wade
Write bugs for the ones where there's no non-deprecated method. I don't recall 
all the values, but there may be UNIX-level functions to do some things. And if 
there's no real way now, look up the info on the structures and set them by way 
of the xattr calls.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Oct 13, 2016, at 9:21 AM, Stephane Sudre <dev.iceb...@gmail.com> wrote:
> 
> No specific attributes in the FinderInfo data. I just need to be able
> to get it and set it on another file/folder.
> 
> The labels case you mention is an interesting one. I had not thought
> about it when it comes to cross-compatibility with the different OS
> versions I need to support.
> 
> On Thu, Oct 13, 2016 at 4:45 PM, Gary L. Wade
> <garyw...@desisoftsystems.com> wrote:
>> What attributes in particular do you need to work with? In case you might be 
>> dealing with labels, those moved from the simple bitmask flag to separate 
>> values in their own extended attribute. Other values may have changed 
>> similarly but I haven't kept up with them.
>> --
>> Gary L. Wade (Sent from my iPad)
>> http://www.garywade.com/
>> 
>>> On Oct 13, 2016, at 7:03 AM, Stephane Sudre <dev.iceb...@gmail.com> wrote:
>>> 
>>> Question:
>>> 
>>> Is there a native Cocoa API that can replace the
>>> FSGetCatalog/FSSetCatalog API when it comes to retrieving/setting the
>>> FinderInfo (and FinderExtInfo) attributes of a file?
>>> 
>>> OS X 10.8 and later.
>>> 
>>> Problem:
>>> 
>>> The FS CoreCarbon APIs are deprecated but apparently, there's nothing
>>> to replace them completely in Cocoa (Foundation).
>>> 
>>> The NSURL resources APIs does not support the FinderInfo attributes
>>> (no obvious key in the broken documentation and using
>>> "com.apple.FinderInfo" does not work).
>>> 
>>> 
>>> Workaround:
>>> 
>>> This can be worked around by using the xattr.h APIs but if it could be
>>> possible to avoid this, it would be better.
> 
> 
> 
> -- 
> Packaging Resources - http://s.sudre.free.fr/Packaging.html


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Getting/Setting FinderInfo attributes using native Cocoa API?

2016-10-13 Thread Gary L. Wade
What attributes in particular do you need to work with? In case you might be 
dealing with labels, those moved from the simple bitmask flag to separate 
values in their own extended attribute. Other values may have changed similarly 
but I haven't kept up with them.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Oct 13, 2016, at 7:03 AM, Stephane Sudre <dev.iceb...@gmail.com> wrote:
> 
> Question:
> 
> Is there a native Cocoa API that can replace the
> FSGetCatalog/FSSetCatalog API when it comes to retrieving/setting the
> FinderInfo (and FinderExtInfo) attributes of a file?
> 
> OS X 10.8 and later.
> 
> Problem:
> 
> The FS CoreCarbon APIs are deprecated but apparently, there's nothing
> to replace them completely in Cocoa (Foundation).
> 
> The NSURL resources APIs does not support the FinderInfo attributes
> (no obvious key in the broken documentation and using
> "com.apple.FinderInfo" does not work).
> 
> 
> Workaround:
> 
> This can be worked around by using the xattr.h APIs but if it could be
> possible to avoid this, it would be better.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Where are the ICU Headers?

2016-10-06 Thread Gary L. Wade
Apple has historically suggested using ICU for functionality that it's 
higher-level frameworks don't provide, and it's easy enough to get at all 
needed functionality through its C functions without using C++ (at least what I 
care about). Since most significant changes only occur in the data across 
releases, or below an API layer, the interfaces would not be as much of an 
issue for most when using the current installed library.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Oct 6, 2016, at 5:23 AM, Alastair Houghton <alast...@alastairs-place.net> 
> wrote:
> 
>> On 6 Oct 2016, at 10:43, dangerwillrobinsondan...@gmail.com wrote:
>> 
>> Pretty sure the reason is a simple one. 
>> If you look at the history of open source in the OS on the Apple open source 
>> page, you'll notice they pretty much bump the ICU version they use annually. 
>> Although unlikely, ICU might change in ways that breaks your app. They don't 
>> want to support ICU directly. It's a pretty tough API in C or C++ 
> 
> Also, historically, C++ ABI compatibility has been a thorny issue.  Even now, 
> if you want a C++ dynamic library to provide binary compatibility you have to 
> be pretty careful.
> 
> ICU is largely a C++ library.  It does have a C interface, but I’m not sure 
> the entire feature set is available without using C++, and ICU explicitly 
> doesn’t provide for binary compatibility at the C++ API level (or even for 
> some of its C API(!)) - see
> 
> http://userguide.icu-project.org/design#TOC-ICU-Binary-Compatibility:-Using-ICU-as-an-Operating-System-Level-Library
> 
> Kind regards,
> 
> Alastair.
> 
> --
> http://alastairs-place.net
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Where are the ICU Headers?

2016-10-06 Thread Gary L. Wade
My experience has been that last year (iOS 9 and OS X 10.11) Apple made ICU a 
private framework worthy of rejection from its App Store if you used its APIs 
directly. I encountered this because like in years past when Apple did not 
provide ICU through a higher-level framework, we were encouraged to call ICU 
directly, and that's when I supplied a signature to translate between 2-letter 
and 3-letter language codes to work around the no-headers issue, which I needed 
to support a 3rd party services requirement. However, the app was rejected as 
using a private API. I was going to challenge it, but my management decided we 
should hard code the mappings.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Oct 6, 2016, at 1:22 AM, Gerriet M. Denkmann <g...@mdenkmann.de> wrote:
> 
> The Icu stuff (57.1) is included in macOS 12.
> 
> There is:
> /usr/lib/libicucore.A.dylib
> 
> and Xcode has:
> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libicucore.tbd
>  
> 
> But I cannot find the headers.
> 
> Gerriet.
> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.com


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: PopUp menus in tables

2016-10-04 Thread Gary L. Wade
If you’re using a view-based table view (as all should be nowadays), and you 
have the popup button you clicked on, get the enclosing NSTableRowView and call 
rowForView:
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Oct 4, 2016, at 4:03 PM, Steve Mills <sjmi...@mac.com> wrote:
> 
>> On Oct 4, 2016, at 17:39, Frank D. Engel, Jr. <fde...@fjrhome.net> wrote:
>> 
>> Ok - wasn't aware of that one.
>> 
>> I tried it, but sadly get the same results.
> 
> Huh. I just used it the other day for handling right-clicks in tables and it 
> works correctly for that.
> 
> Steve via iPad
> 
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: SecStaticCodeCheckValidity fails when app is lauched from Terminal

2016-09-26 Thread Gary L. Wade
In what way did you start your app from the Terminal?  Is this 
WindowServer-based or a command line app?  Not sure your purpose in starting 
from the command line if WindowServer-based, but have you tried launching it 
with the open command where the argument is the .app bundle vs possibly another 
way like the actual executable?
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Sep 26, 2016, at 2:44 AM, Markus Spoettl <ms_li...@shiftoption.com> wrote:
> 
> I'm using SecStaticCodeCheckValidity() to self check the signature of my own 
> app when it is launched. This works fine and always has.
> 
> All of a sudden, the call to SecStaticCodeCheckValidity() fails if (and only 
> if the application) is started from the Terminal. When I start the very same 
> app from the Dock or from the Finder the check succeeds (iow. the call 
> returns noErr).
> 
> I don't know exactly when it started failing. I only know it definitely 
> worked before on previous versions of El Capitan but now it no longer does (v 
> 10.11.6).
> 
> Any ideas?
> 
> Regards
> Markus
> -- 
> __
> Markus Spoettl
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Passing param by reference then using within block throws exception

2016-09-22 Thread Gary L. Wade
Look at these two lines:

>__block NSString* noFillMeIn;
...
>  *noFillMeIn = @"wow";


Unless the original code is correct, you've got mismatched pointers, and you 
should try turning on more warnings and reading what they say, as well as 
trying the analyzer.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Sep 20, 2016, at 2:06 PM, Steve Mills <sjmi...@mac.com> wrote:
> 
> I'm turning on ARC for a project (yay) and have run into a problem I can't 
> wrap my head around. It always worked fine before ARC. When I turn zombies 
> on, doing "memory history 0x610004279ac0" can't find it in the history. 
> Here's the method and the call to it:
> 
> -(void) doStuff:(NSString**)fillMeIn
> {
>[array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL* stop) {
>   if(obj.flag) {
>  *stop = YES;
>  *fillMeIn = @"wow";
>   }
>}];
> }
> 
> NSString* getFilledIn;
> 
> [thing doStuff:];
> 
> The call to doStuff: results in EXC_BAD_ACCESS, or "*** -[CFString retain]: 
> message sent to deallocated instance 0x610004279ac0" if I turn zombies on.
> 
> I tried changing the param type to (NSString** _Nonnull), thinking it was 
> confused about my knowing that the reference will never be nil, but it didn't 
> help. Then I got to thinking about the reference being assigned inside the 
> block and changed it to:
> 
> -(void) doStuff:(NSString** _Nonnull)fillMeIn
> {
>__block NSString* noFillMeIn;
>
>[array enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL* stop) {
>   if(obj.flag) {
>  *stop = YES;
>  *noFillMeIn = @"wow";
>   }
>}];
>
>*fillMeIn = noFillMeIn;
> }
> 
> That seems to fix it. Is there a better way to deref and assign to the param 
> from within the block?
> 
> Sent from iCloud's ridiculous UI, so, sorry about the formatting
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Maximum image size ?

2016-09-22 Thread Gary L. Wade
If you are dealing with truly astronomical image data, consider that "trying it 
yourself" may require multiple machines and/or multiple dedicated GPUs similar 
like how you see those multi-monitor displays shown at conferences and 
marketing displays.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Sep 22, 2016, at 9:53 AM, David Duncan <david.dun...@apple.com> wrote:
> 
> If you know you will be dealing with very large images (a definition that 
> varies from year to year mind you) you will probably want to deal with the 
> largeness yourself, if only for initial loading performance reasons.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to update UI from a background thread

2016-09-22 Thread Gary L. Wade
If it's possible, I would ask the tool developer to provide you with a command 
line or XPC version and try accessing these state transitions in a more 
UI-thread-friendly manner.

Have you stopped your debugger when the freeze happens to see what your main 
thread stack frame looks like? It might give you a clue what you can do, if 
anything. Use that, Instruments, and the Activity Monitor app if ran on a 
non-developer's machine.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Sep 22, 2016, at 9:09 AM, Dave <d...@looktowindward.com> wrote:
> 
> Ok, will do thanks a lot. The AppleScript is/should be on the Main Thread. I 
> am assuming that the App the Script has finished when it returns but maybe 
> that is not the case. I will look into that too.
> 
> Thanks a lot for your help. 
> 
> Cheers
> Dave
> 
> 
>> On 22 Sep 2016, at 16:42, Jens Alfke <j...@mooseyard.com> wrote:
>> 
>> 
>>> On Sep 22, 2016, at 5:20 AM, Dave <d...@looktowindward.com 
>>> <mailto:d...@looktowindward.com>> wrote:
>>> 
>>> So I’m wondering if it is something to do with the AppleScript handling?
>> 
>> AFAIK, AppleScripts can only be run on the main thread. But it’s been many 
>> OS releases since I worked with them.  Even if it’s legal to run them from a 
>> background thread now, they might be doing something like dispatching the 
>> actual execution to the main thread? (I’m just speculating.)
>> 
>> Anyway, if the main thread is unresponsive, then drop into the debugger and 
>> look at its stack to see what it’s blocked in. Experiment.
>> 
>> —Jens
>> 
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.com
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Mysterious crash with NSTableView

2016-08-26 Thread Gary L. Wade
I'm talking about exchanging release for autorelease on your list delegate, 
which happens after runModal finishes. Since you now do an orderOut, your table 
view should not need its data source/delegate, so it should be safe keeping 
them set and using an autorelease, but clearing them is the safest.

This kind of exercise in understanding the MRC rules is precisely why ARC was 
created. If you need to use MRC, you probably should do what lots of others did 
and draw lots of pictures in timeframes with tally counts on objects to 
understand what happens when. If you go with ARC, this clearing should happen 
for you—I'm pretty sure the data source and delegate are weak, but I don't have 
the headers in front of me right now.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Aug 26, 2016, at 9:38 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
>> On 26.08.2016 at 17:52 Gary L. Wade wrote:
>> 
>> You would not see this if you hid or removed the table view first
>> since it would not need its data source or delegate then. Try going
>> with ARC or at least use autorelease on your delegate/data source.
> 
> I'm not using autorelease on the delegate/data source on purpose because
> AFAIU autoreleased objects are (potentially) killed whenever the application
> is in an event loop and this is the case with runModalForWindow(). AFAIU
> if I used autorelease on the delegate/data source then both would be
> killed in the run loop started by runModalForWindow() because both 
> setDelegate()
> and setDatasource() don't retain. So using autorelease doesn't make sense
> to me here. Is this right or did I get anything wrong here?
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Mysterious crash with NSTableView

2016-08-26 Thread Gary L. Wade
You would not see this if you hid or removed the table view first since it 
would not need its data source or delegate then. Try going with ARC or at least 
use autorelease on your delegate/data source.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Aug 26, 2016, at 8:42 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
>> On 26.08.2016 at 17:35 Gary L. Wade wrote:
>> 
>> Try clearing your table view's data source and delegate before
>> releasing their object. It appears the pointer gets reassigned to an
>> NSRectSet before your table view completely goes away but after its delegate 
>> and data source have.
> 
> Great, that solves it. Thanks a lot!
> 
> But once again, I think it's a crime that there is no mentioning of this in 
> the class
> documentation of "setDelegate" and "setDatasource" :( 
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Mysterious crash with NSTableView

2016-08-26 Thread Gary L. Wade
Try clearing your table view's data source and delegate before releasing their 
object. It appears the pointer gets reassigned to an NSRectSet before your 
table view completely goes away but after its delegate and data source have.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Aug 26, 2016, at 8:15 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
> Does anybody have an idea why the following code causes a "Segmentation 
> fault" and thus
> an immediate program termination? Interestingly, the code runs just fine and 
> the
> NSTableView appears correctly and is functional. The "Segmentation fault" 
> occurs when
> buttonPressed() is left and control returns to the main run loop. Thus, I 
> suspect that
> the error is probably related to autoreleasing, e.g. releasing a resource 
> twice or
> something. But I don't really see anything that's wrong with my code. 
> Sometimes I also
> get this message instead of the segmentation fault:
> 
>   [NSRectSet tableView:objectValueForTableColumn:row:]:unrecognized 
> selector sent to instance 0x100153060
> 
> But most of the time it just crashes with a segmentation fault. The code 
> itself is
> really simple and straightforward, here it is:
> 
> - (void)buttonPressed
> {
>NSRect rect = NSMakeRect(100, 100, 320 + 2 * 20, 78 + 200 + 20);
>
>NSWindow *win = [[NSWindow alloc] initWithContentRect:rect 
> styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO];
> 
>id listDelegate = [[MyListDelegate alloc] init];
> 
>NSScrollView *scrollview = [[NSScrollView alloc] 
> initWithFrame:NSMakeRect(20, 52, rect.size.width - 2 * 20, 200)];
>NSTableView *tableview = [[NSTableView alloc] initWithFrame:NSMakeRect(0, 
> 0, rect.size.width - 2 * 20 - 16, 200)];
>NSTableColumn *column = [[NSTableColumn alloc] 
> initWithIdentifier:@"Column"];
>
>[tableview addTableColumn:column];
>[tableview setDelegate:listDelegate];
>[tableview setDataSource:listDelegate];
>[scrollview setDocumentView:tableview];
>[[win contentView] addSubview:scrollview];
>[scrollview release];
>[tableview release];
>[column release];
> 
>id buttonDelegateOK = [[MyButtonDelegate alloc] init];
>NSButton *ok = [[NSButton alloc] initWithFrame:NSMakeRect(rect.size.width 
> - 82 - 14, 12, 82, 32)];
>[ok setTitle:@"OK"];
>[ok setButtonType:NSMomentaryPushInButton];
>[ok setBezelStyle:NSRoundedBezelStyle];
>[ok setKeyEquivalent:@"\r"];
>[ok setTarget:buttonDelegateOK];
>[ok setAction:@selector(buttonPressed)];
>[[win contentView] addSubview:ok];
>[ok release];
>
>[NSApp runModalForWindow:win];
>
>[win orderOut:nil];
>[win release];
>
>[listDelegate release];
>[buttonDelegateOK release];
> } 
> 
> ---
> 
> The list delegate is also minimal and looks like this:
> 
> @interface MyListDelegate : NSObject
> @end
> 
> @implementation MyListDelegate
> - (int)numberOfRowsInTableView:(NSTableView *)_tableView
> {
>return 3;
> }
> 
> - (id)tableView:(NSTableView *)_tableView 
> objectValueForTableColumn:(NSTableColumn *) tableColumn row:(int)row
> {
>return @"Foobar";
> }
> @end
> 
> ---
> 
> I've already spent several hours trying to find out why this particular code 
> results
> in a "Segmentation fault" but I just don't see it.
> 
> Can anybody help? Thanks in advance!
> 
> Full minimal demo program is attached for reference.
> 
> -- 
> Best regards,
> Andreas Falkenhahn  mailto:andr...@falkenhahn.com
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: GetNumEventsInQueue() for Cocoa

2016-08-20 Thread Gary L. Wade
Cocoa is an object oriented framework that encapsulates a lot of the hard work 
for you, so it doesn’t expose all the low-level details that it manages.  Some 
of the lower level functionality is available by way of CoreFoundation and some 
exposed C APIs, but there are lots of things not exposed.  If you have a need 
to do polling of events and cannot do it with the current APIs available, write 
a radar up and possible open a tech support incident.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Aug 20, 2016, at 2:26 PM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
> Well, yeah, that's just because I was absolutely sure that there would be
> a Cocoa equivalent for GetNumEventsInQueue(). I always believed Cocoa to
> have gazillions of features more than Carbon so I was absolutely sure that
> there would be a Cocoa equivalent for such a trivial thing as polling the
> number of events in the queue but apparently Cocoa's event queue API is
> quite ascetic ;)

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: GetNumEventsInQueue() for Cocoa

2016-08-20 Thread Gary L. Wade
This sounds way outside the realm of Cocoa as it doesn’t expose the means that 
you apparently are using to actually get the events, so any solution you’re 
looking for is going to be within that realm, not Cocoa.

With that being said, I’ve worked on plenty of cross-platform apps that tried 
to shoehorn one architecture into another, and if things don’t work the same 
way you’re expecting, you might find greater success by not trying.  If it is 
possible, I would suggest changing your waitEvent and handleEvents to be empty 
functions and rely upon the Cocoa event architecture.  You might try overriding 
NSApplication’s event retrieving methods to pull the results and save them off 
for your original calls.  You might try getting into the guts of runloops.  It 
all depends on what kind of things you need to do with the events before the 
real objects get them and the purpose of your cross-platform architecture.

If the architecture you’re using is something well known, you might get some 
better advice by others who have used it and how they’ve done things the Cocoa 
way.
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Aug 20, 2016, at 10:59 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
> wrote:
> 
> On 20.08.2016 at 19:48 David Duncan wrote:
> 
> 
>>> On Aug 20, 2016, at 10:30 AM, Andreas Falkenhahn <andr...@falkenhahn.com> 
>>> wrote:
> 
>>> Is there a Cocoa equivalent for the Carbon call
>>> GetNumEventsInQueue(GetMainEventQueue())?
> 
>>> I use this a lot to poll whether there are events in the queue. 
> 
>> Why do you need to poll if there are events in the queue?
> 
> Because actually retrieving events is very, very expensive. I already use a 
> timer
> which limits event loop execution to about 100 times per second but I'd like 
> to
> make an exception in case there are currently events in the queue, that's why
> I'm looking for a Cocoa equivalent for GetNumEventsInQueue().
> 
> Longer story:
> 
> Yes, I know, my app isn't doing things the Cocoa way but that's not possible
> because it's a multi-platform app written in C and I need to make the Cocoa 
> backend
> fit into this fixed, abstracted multi-platform design. Hence, in my 
> NSApplicationDelegate's
> "didFinishLaunching" I'm immediately doing a [NSApp stop:nil] and I'm then 
> processing
> events manually using an old-school model of waitEvent() and handleEvents().
> Unfortunately, the OS-independent backend calls handleEvents() really, really
> often so I need a throttle to avoid killing performance of my app. The timer
> throttling event loop execution to 100 times per second plus 
> GetNumEventsInQueue()
> worked like a charm on Carbon. But now I'd need a Cocoa equivalent for
> GetNumEventsInQueue()... 
> 
> -- 
> Best regards,
> Andreas Falkenhahnmailto:andr...@falkenhahn.com
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.com
> 
> This email sent to garyw...@desisoftsystems.com

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Resend: array = [NSArray new] or array = [NSArray array]?

2016-08-19 Thread Gary L. Wade
The class method new is the same as alloc/init although by implementation, it 
may be faster if the class doesn't need to pass a placeholder object from 
alloc—some classes do that. The class method array is much like 
alloc/init/autorelease in the MRC days although it may coalesce things, but 
that's an implementation detail you as a user shouldn't be too concerned about.

The biggest cause for concern is if you're writing this code in MRC vs ARC 
since you'd have to manage these memory points yourself.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Aug 16, 2016, at 7:42 AM, Alex Zavatone <z...@mac.com> wrote:
> 
> I sent this out this morning but it got eaten, so this is a resend.  Sorry if 
> it gets to some of you twice.
> 
> 
> 
> Yes, I know about literals, but I have a different question here.
> 
> 
> Is this safe?
> 
> I have seen this in some code in our codebase:
> array = [NSArray new]; 
> 
> I'm familiar with using the public method from the NSArray header and what 
> the docs say to use:
> or array = [NSArray array];
> 
> Is there any risk to using [NSArray new] to init an array instead of [NSArray 
> array]??
> 
> I'm surprised to see this being used in our codebase and would like to make 
> sure we are not destroying the universe by using it.
> 
> Thank you in advance.
> - Alex Zavatone
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Emailing from a daemon process

2016-07-07 Thread Gary L. Wade
Depending on your customers and product, sending these to your server and 
saving them there could be a support feature allowing you or the user to log in 
and review them when needed. Even if you don't, almost every web server is set 
up with sendmail such that you could utilize it instead.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

On Jul 7, 2016, at 11:01 AM, Carl Hoefs <newsli...@autonomy.caltech.edu> wrote:

>> The manufacturers are probably running their own SMTP servers, and the 
>> devices either talk to those directly, or (more likely) send HTTP requests 
>> to the manufacturer’s web server, which then formats the email and sends it 
>> to the SMTP server.
> 
> Yes, this seems to be correct. I just checked such emails and I see the 
> manufacturers usually exploit gmail for this purpose (and I have no gmail 
> account).


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Property synthesis trouble - 32 vs 64 bit builds

2016-07-05 Thread Gary L. Wade
You might need to write some lower level stuff, but some of the things in there 
can be done, albeit differently. Apple knows I've submitted a number of bugs 
and incident reports to get codecs supported in later frameworks. Do the same. 
It may happen.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Jul 5, 2016, at 2:10 PM, Jonathan Taylor <jonathan.tay...@glasgow.ac.uk> 
> wrote:
> 
> Quicktime. My code has been 32-bit only since I first wrote it, because I 
> make use of the APIs in QuickTime/ImageCompression.h for encoding movies. 
> It's my understanding (as of last time I checked) that no equivalent 
> functionality is available in the newer APIs.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How can I get a single threaded network call in ObjC on iOS?

2016-06-28 Thread Gary L. Wade
When you try to mix synchronous (one request at a time) and asynchronous calls 
(the task is set up and a completion handler is called after the original set 
up calls) together like this, you have to start doing lots of extra management 
across queues. This pattern can apply across other asynchronous APIs. If you 
have 50 requests to execute, in the worst case, you have 50 requests happening 
with 1 doing work and 49 blocked. Those 49 blocked requests may hog resources 
unnecessarily.

A different way to do this that avoids all that management is to only start the 
new request once an existing request has finished. If you have 50 requests to 
execute, in the worst case, you have 1 request happening with 1 doing work and 
none blocked. The 49 requests not called yet will not tie up any resources.

Based on what I understand to be your requirements, and in a very general way, 
I would do this (written in email):

1. Create a mutable array
2. Create methods that add requests to the end and remove requests from the 
beginning of that array with a common lock around those operations. There are 
many ways to do this lock. An easy one to code in Objective-C is the 
@synchronized block with the array being the object.
3. Call the locking method to add each request as needed.
4. When a request is added such that it's the first one in the array, set up 
your asynchronous request for it within the locking method.
5. At the end of the request's completion block (all completion blocks should 
be the same), call the locking method that removes the first request from the 
array. If there's another request in the array, set up your asynchronous 
request on it within the locking method.
6. Repeat 5 till empty.

Essentially, if not for the asynchronous completion blocks, this is the same 
design you would use for synchronous requests except for the placement of the 
completion block and timing of its execution. When I refer to requests, these 
can be as simple as some application-defined value and actual NSURL and 
NSURLSession objects not created until step 4/5.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Jun 28, 2016, at 5:03 PM, Peter Tomaselli <vast.gra...@gmail.com> wrote:
> 
> I have not a lot of Cocoa experience here, so I am legitimately asking this 
> question, no snark intended: what’s the advantage to building a home-made 
> “serial” “queue” as opposed to just using an actual serial operation queue? 
> Haven’t you just described the first few steps one would take were one to set 
> out to reimplement NSOperationQueue?
> 
> FWIW (and as I mentioned, I am an eminently ignorable person when it comes to 
> Cocoa expertise), I sort of see the essence of the “async” flavor of 
> NSOperation as being to provide definitive signaling when an otherwise 
> asynchronous operation is really “finished“ — for whatever business 
> definition of “finished” one requires. So I don’t completely agree that this 
> would be “shoehorning”; seems right on the money to me.
> 
> Just one opinion! Cheers,
> 
> Peter
> 
>> On Jun 28, 2016, at 6:50 PM, "Gary L. Wade" <garyw...@desisoftsystems.com> 
>> wrote:
>> 
>> Based on his desire to do this serially, he would need a serial queue, and 
>> he's using asynchronous requests, so succeeding calls from his completion 
>> handler with a simple array in queue pattern is simpler than shoehorning it 
>> all into dispatch queues.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
>> 
>>> On Jun 28, 2016, at 3:45 PM, Alex Zavatone <z...@mac.com> wrote:
>>> 
>>> Would a dispatch queue get what he's looking for?
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How can I get a single threaded network call in ObjC on iOS?

2016-06-28 Thread Gary L. Wade
Based on his desire to do this serially, he would need a serial queue, and he's 
using asynchronous requests, so succeeding calls from his completion handler 
with a simple array in queue pattern is simpler than shoehorning it all into 
dispatch queues.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Jun 28, 2016, at 3:45 PM, Alex Zavatone <z...@mac.com> wrote:
> 
> Would a dispatch queue get what he's looking for?
> 
>> On Jun 28, 2016, at 3:11 PM, Gary L. Wade wrote:
>> 
>> The simplest way to do what you're asking is to not send another request 
>> until your completion handler finishes.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
>> 
>>> On Jun 28, 2016, at 12:52 PM, Jim Adams <jim.ad...@sas.com> wrote:
>>> 
>>> I have an application that has the requirement that the accesses to the 
>>> server be single threaded, i.e. the second request cannot go through until 
>>> the first request has completed. I am using NSURLSession and 
>>> NSURLSessionDataTask. I have set the Maximum Concurrent Host number in the 
>>> configuration to 1 but I have seen evidence that there are simultaneous 
>>> requests going up to my servers.
>>> 
>>> Actually I don’t think they are truly simultaneous, just that the 
>>> completion handler doesn’t finish before the next request goes out. Is 
>>> there a way to make the next request wait until the completion block is 
>>> exited?
>>> 
>>> My evidence comes from looking in the server logs. I have 3 servers in AWS 
>>> behind an ELB. If I am able to get the cookies back from the server before 
>>> sending the next request then my request will go to the same server that 
>>> the last request went to. If I don’t wait then then the request goes to a 
>>> random server. If I watch the logs I can see the requests come in on 
>>> multiple servers.
>> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How can I get a single threaded network call in ObjC on iOS?

2016-06-28 Thread Gary L. Wade
That may work, too, but it sure sounds like an awfully heavy way to do it.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Jun 28, 2016, at 2:16 PM, Peter Tomaselli <vast.gra...@gmail.com> wrote:
> 
> In the past I’ve used NSOperation for this — wrap each request in an async 
> NSOperation that only signals completion to its queue when its DataTask 
> completion handler is complete. Then you can blast a bunch of them at a 
> serial queue and they will come out serially until they are done.
> 
>> On Tue, Jun 28, 2016 at 4:35 PM, Gary L. Wade <garyw...@desisoftsystems.com> 
>> wrote:
>> Try using a mutex on your array of requests, when adding and removing them, 
>> and only pull a request off the array when you're done with your completion 
>> handler or when you have nothing in progress such as when you first start.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
>> 
>> > On Jun 28, 2016, at 1:16 PM, Jim Adams <jim.ad...@sas.com> wrote:
>> >
>> > Unfortunately, with a multi threaded system, I cannot figure out a way to 
>> > do that. Ideas appreciated.
>> >
>> > My network calls could come from any thread. I could see putting the 
>> > request into a queue, but how to I make the completion handler run on that 
>> > same queue so it remains blocked?
>> >
>> >> On Jun 28, 2016, at 4:11 PM, Gary L. Wade <garyw...@desisoftsystems.com> 
>> >> wrote:
>> >>
>> >> The simplest way to do what you're asking is to not send another request 
>> >> until your completion handler finishes.
>> >> --
>> >> Gary L. Wade (Sent from my iPhone)
>> >> http://www.garywade.com/
>> >>
>> >>> On Jun 28, 2016, at 12:52 PM, Jim Adams <jim.ad...@sas.com> wrote:
>> >>>
>> >>> I have an application that has the requirement that the accesses to the 
>> >>> server be single threaded, i.e. the second request cannot go through 
>> >>> until the first request has completed. I am using NSURLSession and 
>> >>> NSURLSessionDataTask. I have set the Maximum Concurrent Host number in 
>> >>> the configuration to 1 but I have seen evidence that there are 
>> >>> simultaneous requests going up to my servers.
>> >>>
>> >>> Actually I don’t think they are truly simultaneous, just that the 
>> >>> completion handler doesn’t finish before the next request goes out. Is 
>> >>> there a way to make the next request wait until the completion block is 
>> >>> exited?
>> >>>
>> >>> My evidence comes from looking in the server logs. I have 3 servers in 
>> >>> AWS behind an ELB. If I am able to get the cookies back from the server 
>> >>> before sending the next request then my request will go to the same 
>> >>> server that the last request went to. If I don’t wait then then the 
>> >>> request goes to a random server. If I watch the logs I can see the 
>> >>> requests come in on multiple servers.
>> >
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How can I get a single threaded network call in ObjC on iOS?

2016-06-28 Thread Gary L. Wade
Try using a mutex on your array of requests, when adding and removing them, and 
only pull a request off the array when you're done with your completion handler 
or when you have nothing in progress such as when you first start.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Jun 28, 2016, at 1:16 PM, Jim Adams <jim.ad...@sas.com> wrote:
> 
> Unfortunately, with a multi threaded system, I cannot figure out a way to do 
> that. Ideas appreciated.
> 
> My network calls could come from any thread. I could see putting the request 
> into a queue, but how to I make the completion handler run on that same queue 
> so it remains blocked?
> 
>> On Jun 28, 2016, at 4:11 PM, Gary L. Wade <garyw...@desisoftsystems.com> 
>> wrote:
>> 
>> The simplest way to do what you're asking is to not send another request 
>> until your completion handler finishes.
>> --
>> Gary L. Wade (Sent from my iPhone)
>> http://www.garywade.com/
>> 
>>> On Jun 28, 2016, at 12:52 PM, Jim Adams <jim.ad...@sas.com> wrote:
>>> 
>>> I have an application that has the requirement that the accesses to the 
>>> server be single threaded, i.e. the second request cannot go through until 
>>> the first request has completed. I am using NSURLSession and 
>>> NSURLSessionDataTask. I have set the Maximum Concurrent Host number in the 
>>> configuration to 1 but I have seen evidence that there are simultaneous 
>>> requests going up to my servers.
>>> 
>>> Actually I don’t think they are truly simultaneous, just that the 
>>> completion handler doesn’t finish before the next request goes out. Is 
>>> there a way to make the next request wait until the completion block is 
>>> exited?
>>> 
>>> My evidence comes from looking in the server logs. I have 3 servers in AWS 
>>> behind an ELB. If I am able to get the cookies back from the server before 
>>> sending the next request then my request will go to the same server that 
>>> the last request went to. If I don’t wait then then the request goes to a 
>>> random server. If I watch the logs I can see the requests come in on 
>>> multiple servers.
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How can I get a single threaded network call in ObjC on iOS?

2016-06-28 Thread Gary L. Wade
The simplest way to do what you're asking is to not send another request until 
your completion handler finishes.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Jun 28, 2016, at 12:52 PM, Jim Adams <jim.ad...@sas.com> wrote:
> 
> I have an application that has the requirement that the accesses to the 
> server be single threaded, i.e. the second request cannot go through until 
> the first request has completed. I am using NSURLSession and 
> NSURLSessionDataTask. I have set the Maximum Concurrent Host number in the 
> configuration to 1 but I have seen evidence that there are simultaneous 
> requests going up to my servers.
> 
> Actually I don’t think they are truly simultaneous, just that the completion 
> handler doesn’t finish before the next request goes out. Is there a way to 
> make the next request wait until the completion block is exited?
> 
> My evidence comes from looking in the server logs. I have 3 servers in AWS 
> behind an ELB. If I am able to get the cookies back from the server before 
> sending the next request then my request will go to the same server that the 
> last request went to. If I don’t wait then then the request goes to a random 
> server. If I watch the logs I can see the requests come in on multiple 
> servers.
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Swift 3 - Notification leaks

2016-06-18 Thread Gary L. Wade
Apple is carefully monitoring bugs for this, so file one.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

> On Jun 18, 2016, at 4:21 AM, Andreas Mayer <andr...@harmless.de> wrote:
> 
> The really bad thing is, some were keeping old windows in memory!
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: H.265/HEVC encoding and decoding in mac os x using AVFoundation?

2016-06-17 Thread Gary L. Wade
I remember there were some constants in CoreMedia for H.265 for last year's 
OSes, but it seemed you'd have to roll a lot yourself, and my priorities 
changed enough to not follow through, but it may be things changed for this 
year's forthcoming releases. If the docs aren't helpful, do a grep on Xcode 7 
and Xcode 8 and check out Apple's dev forums for items under disclosure. If you 
have access to Apple's WWDC 2016 videos, see if one of the related sessions 
might help.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Jun 17, 2016, at 5:07 AM, Muthulingam Ammaiappan <muthulinga...@gmail.com> 
> wrote:
> 
> Hi Friends,
> 
> currently i am working on the project that deals with decoding and encoding
> of H.265/HEVC(High Efficiency Video Coding) files...
> 
> my question : *is it possible by using AVFoundation to do the decoding and
> encoding for H.265 files?*
> 
> and if it is not possible can you guys please suggest some good
> alternatives on mac os x?
> 
> Thanks & Regards,
> Muthu
> 


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Where are my bytes hiding?

2016-05-05 Thread Gary L. Wade
Extended attributes have been part of the Macintosh operating system in a few 
different forms since 1984. Up until Mac OS 9, the only alternative was a 
resource fork. In Mac OS 9, named forks were introduced, although only data and 
resource were practically available, and under the Mac's Unixification in OS X, 
they were implemented as extended attributes. You can add the @ symbol to the 
ls command to list all available extended attributes on a file or directory 
(yes, directories):

ls -al@

The details are a bit more complicated, but for most needs, even a backup 
service, this should suffice. There are wikis that go into greater detail.
--
Gary L. Wade (Sent from my iPhone)
http://www.garywade.com/

On May 5, 2016, at 12:01 PM, Martin Wierschin <mar...@nisus.com> wrote:

>> Those files are compressed by the filesystem. In HFS+/MacOS Extended that
>> means that the data fork is empty and the file contents are stored in the
>> resource fork or extended attributes structure.
>> 
>> http://wiki.sleuthkit.org/index.php?title=HFS#HFS.2B_File_Compression
> 
> Huh, that's interesting and surprising, thanks for the link. Is this method 
> of stashing compressed data in the xattrs something that's currently commonly 
> used by OSX? Or is it just some weird infrequently used trick? I see this on 
> the linked page:
> 
>> Compression is most often used for files installed as part of Mac OS X; user 
>> files are typically not compressed (but certainly can be!)
> 
> Are a lot of system files compressed like this? Is there any way a user file 
> might be compressed in such a way through normal user actions?
> 
> ~Martin Wierschin


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: How to Truncate lines in NSScrollView/NSClipView/NSTextView Combo

2016-04-26 Thread Gary L. Wade
Did you try doing an internet search?  This search phrase in Google has a 
number of people asking the same thing with many variations on the same answer:

how to prevent nstextview from wrapping 
<https://www.google.com/search?client=safari=en=how+to+prevent+nstextview+from+wrapping=UTF-8=UTF-8>
--
Gary L. Wade
http://www.garywade.com/ <http://www.garywade.com/>
> On Apr 26, 2016, at 3:25 AM, Dave <d...@looktowindward.com> wrote:
> 
> Hi,
> 
> I’ve tried loads of different way of doing it but none of them work. Maybe 
> its because I’m not using Auto-Layout, maybe its just impossible using an 
> NSScrollView/NSTextView. In fact, since there isn’t a handy-dandy method or 
> property on any of the classes in question to just do it, I’m beginning to 
> think that’s the case.
> 
> Apple’s documentation is so bad that I can’t find anything related to it and 
> I must have wasted around 2 hours fiddling with this. Still I have lots of 
> lovely animations in XCode to make up for it so all is not lost! I’m giving 
> up and it’s too much of a time-sync to muck around with it as I have more 
> pressing things that need doing.
> 
> Thanks a lot for for taking the time to help.
> 
> All the Best
> Dave
> 
> 
>> On 26 Apr 2016, at 10:00, Bill Cheeseman <wjcheese...@gmail.com> wrote:
>> 
>> Graham Cox is right.
>> 
>> I realized overnight that I was misinterpreting your question. I happen to 
>> be working on truncation of text myself, and I was focused on the usual 
>> meaning of "truncation" in the attributed string context. It means placing 
>> three periods at the end or in the middle of truncated lines of text.
>> 
>> What you are trying to do, as I now understand it, is to keep the original 
>> line breaks of the text in place, without "wrapping," even though the text 
>> view or window is made narrower. In other words, your text view will act 
>> like a peephole into a bigger page. That is what NSTextContainer is for. I 
>> think the references I gave to you for text handling in general will lead 
>> you to the relevant documentation.
>> 
>> From the NSTextContainer reference document:
>> 
>> "The NSTextContainer class defines a region where text is laid out. An 
>> NSLayoutManager 
>> <https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSLayoutManager_Class/index.html#//apple_ref/occ/cl/NSLayoutManager>
>>  uses NSTextContainer to determine where to break lines, lay out portions of 
>> text, and so on. An NSTextContainerobject normally defines rectangular 
>> regions, but you can define exclusion paths inside the text container to 
>> create regions where text does not flow. You can also subclass to create 
>> text containers with nonrectangular regions, such as circular regions, 
>> regions with holes in them, or regions that flow alongside graphics."
>> 
>> Since you're in a very speed-sensitive environment, you will also be 
>> interested in the paragraph that follows that quoted text, about using 
>> threads.
>> 
>>> On Apr 25, 2016, at 11:34 AM, Dave <d...@looktowindward.com 
>>> <mailto:d...@looktowindward.com>> wrote:
>>> 
>>> I’m familiar with NSAttributedString and friends. I had thought that there 
>>> was a higher level interface to it as it seems like a common thing to want 
>>> to do.
>>> 
>>> Basically my ScrollView is just a scrolling line log similar to XCode’s 
>>> NSLog window.
>> 
>> -- 
>> 
>> Bill Cheeseman - wjcheese...@comcast.net <mailto:wjcheese...@comcast.net>
>> 
>> -- 
>> 
>> Bill Cheeseman - wjcheese...@comcast.net
>> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

  1   2   3   4   >