Re: Free trial period for apps in Mac App Store (?)

2020-09-02 Thread Dave via Cocoa-dev
Hi,

The “Light” version doesn’t take much more effort to support since its built 
from the same source code. I actually found this the easiest and most straight 
forward way of doing it.

Cheers
Dave

> On 1 Sep 2020, at 22:27, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
>> Make a ?Lite? version free (Price 0.00) which has either a limited life span 
>> or limited functionality or both.
>> [...]
>> The other option is to use ?In App Purchases? to upgrade the functionality.
>> 
> 
> Thanks a lot for your response.
> 
> Option 1 would mean, in my case: develop and maintain two versions,
> "Light" version includes full functionality, but expires after a month,
> "Pro" version costs.
> 
> Option 2:
> Only one version, with in-app purchase to unlock unlimited time.
> 
> 
> I was wondering: what is your experience in terms of
> - user experience
> - development effort.
> Is it more effort to develop and maintain light & pro version,
> or is it more effort to implement the in-app purchase?
> (The latter involves some purchases management, IIUC, for instance, if a user 
> buys a new Mac.)
> 
> 
> What are your thoughts?
> 
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: Free trial period for apps in Mac App Store (?)

2020-09-01 Thread Dave via Cocoa-dev
Hi,

It depends on how you want to play it. In the past I’ve done the following:

Make a “Lite” version free (Price 0.00) which has either a limited life span or 
limited functionality or both.
Make a “Full” version pad for version (Price X.00) which has either a limited 
life span or limited functionality or both.
When the time expires or the user decides they want more functionality they 
click a link to the App in the AppStore.

The other option is to use “In App Purchases” to upgrade the functionality.

Hope this helps.

Cheers
Dave


> On 27 Aug 2020, at 11:39, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> The App store Review Guidelines mention this:
> 
> "Non-subscription apps may offer a free time-based trial period before 
> presenting a full unlock option".
> 
> I have followed the links in that paragraph but that did not help me 
> understand how that works.
> 
> Can some kind soul please point me to resources where I can learn how to set 
> up and manage trial periods for my app?
> (I am thinking of giving users a 1-month trial period with full functionality,
> and after that they would have to pay if they want to continue to use the 
> app.)
> 
> 
> ___
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: NSTimer +timerWithTimeInterval:

2020-05-04 Thread Dave via Cocoa-dev
Hi,

I’d try this:

Make a method called setupTimer with the code below.

Then in applicationDidFinishLaunching call performSelector: setupTimer with a 
delay of (say 5 seconds).

Just to see if it changes anything….

Cheers
Dave


> On 29 Apr 2020, at 23:35, Carl Hoefs via Cocoa-dev 
>  wrote:
> 
> There are no extensions or categories in the project. 
> I changed the -newData: method name to -arrivalOfNewData:. 
> I changed the newTimer variable name to theTimer. 
> I rebooted the machine. 
> 
> No joy.
> 
> I realize this is no longer a Cocoa problem, but what - even theoretically - 
> could cause this? 
> As shown in the debugger, the timer gets created with the wrong time interval 
> value, by a consistent factor of 20.
> 
> -Carl
> 

___

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] NSTimer +timerWithTimeInterval:

2020-05-03 Thread Dave via Cocoa-dev
Yes, that’s correct, nothing wrong with a method beginning with new as long as 
it follows the rules, I use it all the time.

I’m not sure if it matters at all with ARC, but I stick by the rules anyway.

Cheers
Dave

> On 30 Apr 2020, at 00:27, Sandor Szatmari via Cocoa-dev 
>  wrote:
> 
> Alex,
> 
>> On Apr 29, 2020, at 17:12, Alex Zavatone via Cocoa-dev 
>>  wrote:
>> 
>> Not sure about this, but in Objective-C, you’re not supposed to start 
>> methods with new.
> 
> I’ve always operated under the premise that using a reserved prefix, such as 
> new, was not verboten.  Rather, if one chose the prefix new one must ensure 
> that the method followed memory management conventions, and would return an 
> object with a +1 retain count.  Am I mistaken about this?
> 
> 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/archive%40mail-archive.com

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


Re: Open a panel in secondary thread?

2020-03-24 Thread Dave via Cocoa-dev
Hi,

You may want to call performSelectorOnMainThread and pass YES as the wait until 
done flag.

Cheer
Dave



> On 21 Mar 2020, at 20:05, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> Is it possible to open an NSOpenPanel in a secondary thread?
> 
> I create the thread like this:
> 
>directoryScanThread_ = [[NSThread alloc] initWithTarget: self
>   selector: 
> @selector(scanDirectory:)
> object: nil];
>[directoryScanThread_ start];
> 
> 
> But when I do:
> 
>NSOpenPanel *oPanel = [NSOpenPanel openPanel];
> 
> it crashes at this point.
> 
> In the docs, I found a hint that one should use
> 
>lockFocusIfCanDraw
> 
> but that is deprecated now.
> 
> Any ideas will be highly appreciated.
> 
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: applicationDidFinishLaunching not being called

2020-03-09 Thread Dave via Cocoa-dev
Look at the Application Object in the Workspace/NIB file, is the class 
AppDelegate? If not it should be! Do you have an AppDelegate in the 
project/target and is the correct target set for it?

BTW, these questions are better posted to the Xcode list.

All the Best
Dave


> On 9 Mar 2020, at 17:55, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> I must have done something very stupid, accidentally,
> but the method applicationDidFinishLaunching in my AppDelegate is not being 
> called any more.
> 
> I have googled and tried a few things, of course, to no avail.
> 
> Does anyone have an idea what it might be?
> Maybe, some kind soul can take a quick look at my source code:
>  https://owncloud.informatik.uni-bremen.de/index.php/s/Yc67zM8ikBZFnRc
> which is still pretty bare.
> 
> Thanks a lot in advance.
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: Sharing NIB/XIB between different apps?

2020-03-09 Thread Dave via Cocoa-dev
Hi,

If you decide to use multiple targets then it’s still better to have a folder 
for common files and one for each target, both targets include the Common 
folder but you only include the folders appropriate for each Target. By 
“include” I mean you check/uncheck the targets that the file builds against, so 
Common files are checked for to project and the specific files only for the 
target they belong to.

You can also use a “Workspace”, which is what I tend to do, you then add 
projects to the work-project (which can have sub-projects), it’s all a bit 
complicated to be honest, but the docs are pretty good. The best way to find 
out more, is to find a Sample project that  uses a Workspace and go from there. 

Hope this helps
Dave  

> On 6 Mar 2020, at 16:19, Steve Mills via Cocoa-dev 
>  wrote:
> 
>> On Mar 6, 2020, at 09:04, Gabriel Zachmann via Cocoa-dev 
>>  wrote:
>> 
>> Is it possible to share one NIB/XIB between two different apps?
>> If yes, what would be the best approach for development: different Xcode 
>> projects, or different targets within the same Xcode project?
> 
> Sure. The easiest way is to have both products in the same project, but 
> different targets, of course. The targets can share anything in the project. 
> The harder way is to put all the common code and resources into a framework, 
> then add the framework to each project. I use the first method in my 
> screensaver and desktop image randomizer to share the UI as a self-contained 
> view controller.
> 
>> .Dummy question on the side: 
>> so far, the screensaver framework opens the options sheet for me when the 
>> user clicks "Screen saver options".
>> How would I open it "manually" in my standalone app?
> 
> The same way you load and show any window. You could add a custom view to 
> your app’s window, then load the shared view controller from its nib and add 
> it to the custom view. Look for Apple examples/docs for loading nibs, using 
> view controllers, etc.
> 
> Steve via iPhone
> 
> ___
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: Sharing code between screensaver and regular app

2020-03-02 Thread Dave via Cocoa-dev
Hi,

All I can think of that this behaviour has changed on your version of 
MacOS/XCode.

You can do the same thing as the template by manually adding the files, e.g 
copy your “ViewController” file, rename it and then add it to the new project. 
You will need to make sure that the Storyboard/Nibs are the same too. Ether add 
the elements needed yourself or copy the existing storyboard/nib(s) rename and 
add to the new project. 

All the Best
Dave

> On 2 Mar 2020, at 12:36, Gabriel Zachmann  wrote:
> 
> Thanks a lot for your response!
> 
>> 
>> File/New Project - Select MacOS and then “App” (from the New Project Dialog).
> 
> That is what I did: see this screen recording:
> 
> https://owncloud.informatik.uni-bremen.de/index.php/s/br8rN3HGYfj9w3d 
> <https://owncloud.informatik.uni-bremen.de/index.php/s/br8rN3HGYfj9w3d>
> 
> Still I get this boilerplate code
> 
> 
>   @interface AppDelegate : NSObject 
> 
>   @end
> 
> 
> No NSView.
> 
> 
> 
> 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: Sharing code between screensaver and regular app

2020-03-02 Thread Dave via Cocoa-dev
Hi,

You need to create a project with the right template to start with. In XCode:

File/New Project - Select MacOS and then “App” (from the New Project Dialog).

On XCode 11.0 and MacOS 10.14.6, this results in a new project Setup with a 
view controller.


There are a number of ways to share code between Apps.

I usually have a folder structure like this:

CommonSource
ScreenSaver
StandaloneApp

Put the code that is common between the two into “CommonSource” and the App 
Specific Stuff into either “ScreenSaver” or “StandaloneApp”. Then add the 
common files to both projects and compile as normal.

All the Best
Dave


> On 1 Mar 2020, at 23:26, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
> I am trying to replicate what this guy suggests:
>   
> https://medium.com/better-programming/how-to-make-a-custom-screensaver-for-mac-os-x-7e1650c13bd8
> under section "Additional Debugging".
> 
> The idea is to create a standalone app that shares as much code with the 
> screensaver as possible.
> 
> I am using Xcode 11, macOS Catalina, Objective-C.
> 
> Now, I have created a new project as "App".
> But, unlike on the web page, Xcode has not created an NSViewController, but 
> instead an NSObject:
> the .h-file contains 
> 
>@interface AppDelegate : NSObject 
> 
>@end
> 
> 
> Could some kind should please shed light on what to do to make my 
> ScreenSaverView a subview of the new stand-alone app?
> 
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: Best Xcode machine mid-2019?

2019-06-28 Thread Dave Fernandes via Cocoa-dev
Not a comprehensive list, but a start...
https://github.com/ashfurrow/xcode-hardware-performance

> On Jun 28, 2019, at 2:02 PM, Steve Mykytyn via Cocoa-dev 
>  wrote:
> 
> My main Xcode machine is a late 2013 27-inch iMac, 24GB RAM, 3.5 GHz Core
> i7 with 500GB SSD.
> 
> It works fine, but I'm wondering if an iMac Pro or a top-of-the-line 2019
> iMac would be a life-changing experience.  Or just, "that's nice."
> 
> The Geekbench numbers are somewhat informative, but hoping for commentary
> based on personal, direct experience.

___

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: NSManagedObject.managedObjectContext is nil???

2019-03-27 Thread Dave Fernandes
Just to clarify, the moc exists, but the reference to it is nil? Or has the 
moc, itself, been deallocated?

> On Mar 27, 2019, at 3:40 PM, Rick Mann  wrote:
> 
> This is proving very hard to diagnose, as it doesn't always happen. I tried 
> observing -managedObjectContext, but it never gets called with a nil value. 
> Moreover, my entity's -dealloc method is sometimes called even though none of 
> the -awake methods gets called. This is a complex app with a lot of async 
> operation, so this entity gets created and destroyed often, making it that 
> much harder to figure out exactly what's going on.
> 
> I can bulletproof the place where the crash occurs when the moc is nil, but 
> I'd really like to track down the underlying problem.
> 
>> On Mar 27, 2019, at 12:17 , Mike Abdullah  wrote:
>> 
>> Given the number of objects Core Data is designed to juggle, managing that 
>> number of weak references might well affect performance. Besides, wouldn’t 
>> you still the same result, that your object has a nil reference to the 
>> context because the context has been deallocated?
>> 
>> Furthermore, I think you can also observe this affect on deleted objects 
>> once the context has been saved, if you’re still holding a reference to any 
>> such objects.
>> 
>> Mike.
>> 
>> Sent from my iPhone
>> 
>>> On 26 Mar 2019, at 21:57, Rick Mann  wrote:
>>> 
>>> The implication there is that an object has a weak reference to the MOC? 
>>> Ah, in the header I see it's `assign`. I wonder why they do that and not 
>>> `weak`.
>>> 
>>> Thanks, I'll look into it.
>>> 
 On Mar 26, 2019, at 14:50 , Richard Charles  wrote:
 
 You have retained the managed object outside the managed object context.
 
 --Richard Charles
 
 
> On Mar 26, 2019, at 1:04 PM, Rick Mann  wrote:
> 
> I'm seeing a situation where my NSManagedObject's managedObjectContext is 
> nil. It doesn't happen all the time though. Any idea why? Thanks!
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
 
>>> 
>>> 
>>> -- 
>>> 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: Need a direction. App crash in CoreData while loading a window's nib

2018-11-04 Thread Dave Fernandes


> On Nov 4, 2018, at 2:24 PM, Motti Shneor  wrote:
> 
> Hi Dave and thanks for the reply.
> 
> As you can see in the stack - there isn’t actually any “code” per-se that 
> runs at that time. Here is the actual method that fails:
> 

> As for modifying the persistent store - I guess I don’t because the 
> database-document does not become “dirty”. If I double click one of the 
> “sample” entities that can be open - and the window is shown as expected, 
> then I close the document - there are no autosaves or changes recorded. The 
> modification time of the persistent store does not change.
> 
> However - you’re right to point at 
> NSManagedObjectContextDidChangeNotification — how could I get it to pop? 

Set up an observer for that notification for your MOC and set a breakpoint in 
that observer.

> 
> 3 of my NSTableColumn do have a formatter for the number presented - but why 
> should this affect the context, The columns are not “editable” in-place. 

Just trying to narrow this down without assuming too much.

> 
> I will attempt to delete these columns and try again… 
> 

___

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: Need a direction. App crash in CoreData while loading a window's nib

2018-11-04 Thread Dave Fernandes
Does your code modify anything in the persistent store during loading 
(NSManagedObjectContextDidChangeNotification)? Maybe it is rounding some values 
for display? This might cause infinite recursion with bindings.

> On Nov 4, 2018, at 2:42 AM, Motti Shneor  wrote:
> 
> Thanks Richard. 
> 
> The data is OK. Not corrupt. I can import and export it to .csv, and I do run 
> several sanity test (heavy calculations based on that data pass OK and 
> provide expected results). Most important - the production build of the 
> software (built half year ago), opens the same database and doesn't crash on 
> the same data. It IS hanging about  a second when opening those items but 
> “survives” it. 
> 
> I cannot save it as XML easily - it is a rather big database about 500MB with 
> tens of millions of entities, in 20 interrelated tables (LOTS of complicated 
> relations). Most of the logic of this software is in its schema.
> 
> More things I’ve done:
> 1. I tested, double-clicking different items - it seems quite consistent. 
> Anything over ~2500 items to show in that window will crash while smaller 
> relation sets “survive”
> 
> 2. I put a symbolic breakpoint on -[NSSQLiteConnection connect]  and 
> double-clicked an item that opens without crashing (about 1000 related items 
> to show). The behaviour is weird. I hit the breakpoint time and again, with a 
> stack that looks exactly like the one I described - except that in the first 
> stop there is only ONE iteration of that binding thing, next break I’ll see 2 
> nested iterations of the binding calls, then 3, 4, 5 — and the stack gets 
> longer and longer each hit. I did not survive to free it a 1000 times, but I 
> think the rule is - it will iterate  1000 times, each time going deeper, 
> until it either “survives” to open the window, or crashes for (what I think 
> of as) stack overflow.
> 
> 3. I tried to build with Xcode 9.4.1 (MacOS SDK 10.13) then with Xcode 10 
> (MacOS SDK 10.14) - same thing. I only have my MacOS 10.13 to try running on. 
> I cannot run the original Xcode (8.x) with which the production version was 
> built. It won’t run on my OS.
> 
> I just do not know how to go about resolving this.
> 
> Another idea I had — I’m using AutoLayout in the .xib file. Maybe — for 
> pre-caculating the “needed” space for some table column, it needs to know in 
> advance the widths of all texts it should ever display there, hence it is 
> forced to scan the whole data via some bindings before it can finally show 
> the table? 
> 
> If so - this cannot (of course) survive longer tables. Still the question why 
> older builds do survive.
> 
> Motti Shneor
> 
> 
>> On 4 Nov 2018, at 4:18, Richard Charles  wrote:
>> 
>> 
>>> On Nov 3, 2018, at 2:47 PM, Motti Shneor  wrote:
>>> 
>>> Can anyone suggest a way to start bisecting the issue or an idea where to 
>>> look for?
>> 
>> You may have bad or corrupted data in your core data persistent store. Save 
>> the file out as an xml and see if you find anything suspicious. 
>> 
>> You could also open the sqlite file with the Base.app by Menial and see what 
>> happens and take a look at the data.
>> 
>> --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/dave.fernandes%40utoronto.ca
> 
> This email sent to dave.fernan...@utoronto.ca

___

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: NSManagedObjectContext's undoManager is nil on macOS

2018-09-06 Thread Dave Fernandes
Ah - thank you! I should read those release notes more carefully. Will close 
the bug I just filed.

> On Sep 6, 2018, at 3:56 PM, Jeff Nadeau  wrote:
> 
> This behavior changed in 10.12  for applications linked against that SDK or 
> later. It’s listed in the “Behavioral changes” section of the Core Data 
> release notes for that year: 
> https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html#//apple_ref/doc/uid/TP40017342-CH1-DontLinkElementID_10
>  
> <https://developer.apple.com/library/archive/releasenotes/General/WhatNewCoreData2016/ReleaseNotes.html#//apple_ref/doc/uid/TP40017342-CH1-DontLinkElementID_10>
> 
> There's a documentation bug to correct the information on the 
> NSManagedObjectContext class doc. I’ll give it a little bump.
> 
> Going forward, you can set the undoManager property with your own 
> NSUndoManager after you’ve initialized the context.
> 
> - Jeff
> 
>> On Sep 5, 2018, at 7:33 PM, Dave Fernandes > <mailto:dave.fernan...@utoronto.ca>> wrote:
>> 
>> The docs say:
>> "In macOS, a context provides an undo manager by default; on iOS, the undo 
>> manager is nil by default.”
>> 
>> However, I am finding on macOS 10.13.6, the undoManager is always nil when 
>> creating a MOC. Is this new behavior expected for High Sierra, or is it a 
>> bug?
>> _
___

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


NSManagedObjectContext's undoManager is nil on macOS

2018-09-05 Thread Dave Fernandes
The docs say:
"In macOS, a context provides an undo manager by default; on iOS, the undo 
manager is nil by default.”

However, I am finding on macOS 10.13.6, the undoManager is always nil when 
creating a MOC. Is this new behavior expected for High Sierra, or is it a bug?
___

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-06-10 Thread Dave
Override the dealloc method and log when its called - its probably being 
over-released!


All the Best
Dave

> On 8 Jun 2018, at 01:23, Jens Alfke  wrote:
> 
> 
> 
>> On May 29, 2018, at 7:39 AM, Alastair Houghton 
>>  wrote:
>> 
>> There’s clearly some kind of bug in your code, but it doesn’t appear to be 
>> in the lines you showed us.  If I had to guess, I’d say you’ve over-released 
>> your NSString somehow (leading to an attempted double free of the underlying 
>> storage);
> 
> ^This. The crash log clearly says "Freeing already free'd pointer”. If I had 
> to guess, I’d say that your code is failing to create an NSString from UTF-16 
> data (for the reasons already described in this thread), and the 
> failure-handling code path of your code ends up double-releasing a string. 
> (Which should be impossible with ARC alone; are you calling CFString APIs 
> anywhere?)
> 
> —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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: Deleting files extremely slow since OSX High sierra

2018-04-25 Thread Dave

> On 25 Apr 2018, at 14:43, Steve Mills  wrote:
> 
> On Apr 25, 2018, at 08:32:14, Vojtěch Meluzín  
> wrote:
>> 
>> Thanks Mike,  i'll probably try. I am reluctant to do that, because api is
>> api and apple forcing devs to change stuff all the time (wasting our time)
>> is just sad. Plus i just cannot imagine how it could cause things to be
>> that bad. And finally people here seem to report general problems... Well
>> apple... Anyways i'll try.
> 
> That's called progress - replacing antiquated APIs and data structures with 
> new and better ones. By all means, keep driving a coal-powered steam car and 
> see how easy it is to buy fuel when every station sells gasoline.

Well if you consider the use of “gasoline” as an “update” on steam power, I’d 
say the same is true. Gasoline which seemed like “progress” at the time has 
caused more damage to the environment then almost any other man made “device”. 
Which if you turn this back into operating system speak would also be true, I 
mean look how much damage the software version of “gasoline” has caused!

 
___

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


[OT] Experienced Freelance Mac and iOS Developer available

2018-04-25 Thread Dave
Hello All,

I’m looking for remote work on Mac and iOS. 

I have over 25 years experience on the Mac and iOS since the first iPhone.

I’ve recently finishing a long contract where I gained a *lot* of experience in 
Accessibility on the Mac.

I’m looking for remote work and will be willing to work for less than the 
market rate in return for this flexibility.

If you’d like to see my CV/Resume please drop me a line privately.

All the Best
Dave

___

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: Deleting files extremely slow since OSX High sierra

2018-04-23 Thread Dave
> 
>> Recently I reported a text failure in Mail, added instructions and a sample 
>> to reproduce it.  They reported it fixed.  I spent my time to check on the 
>> latest Mac OS and it’s not fixed.  I marked the bug as Still Open As 
>> Written.  Nothing’s been done about it since.  My time has been triply 
>> wasted as a result.  
>   How long ago did you mark it SOAW?  No offense but if there hasn't been 
> a full OS release cycle since then I think you may be a little overly 
> critical, cynical and impatient.  As I said above, getting a bug into a 
> software update is very difficult.  The reward has to be significantly higher 
> then the risk.  So maybe it will get fixed in the next major release or they 
> are having trouble reproducing or something benign like that?
> 
> 
>> I don’t have time to professionally do Apple’s job for them and they aren’t 
>> paying me to.
>   I agree.  However, you also can’t expect Apple to be able to test all 
> possible configurations or scenarios.  That would be physically & 
> statistically impossible.  That is one reason they have the beta program, to 
> get a wider audience before the public release.  Without (well written) bug 
> reports from devs, they may never know about issues like this.  Especially 
> since issues like this are highly configuration dependent.
> 

Why not? They used to do a *much* better job when they had much lesser 
resources, now they are rich they really couldn’t care less. 

I agree with Alex, reporting bugs in a total waste of time these days.



___

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


How to Correctly Add subviews considering auto layout

2017-06-29 Thread Dave
iOS - Landscape Only.

Hi,

I have a View Controller in a Storyboard that contains a hierarchy of Stack 
Views, the leafs are a Custom Class that inherits from UIView. The Custom Class 

LTWGameCellView : LTWDrawFrameView

LTWDrawFrameView is Custom Class has methods in it that draw a frame around the 
View - this works fine.

LTWGameCellView inherits from LTWDrawFrameView and add up to 2 UIImageView 
subviews to itself. The Images are resources in the project that are loaded at 
runtime and added to the LTWGameCellView. The idea is to draw a Frame Around 
but the Image, but also to inset the image a small amount.



I’m using auto layout and it works ok, except that I’m not sure I’m what I’m 
doing is correct taking into account auto layout - please see code below. The 
“setCellAsPlayedWithPieceImage:" is called when the a player plays a piece into 
the Cell.

I want the (smaller) image to be centered in the (square) DrawFrame View.

Firstly I’m unsure if self.bounds is the correct starting place for placing the 
image view and if I should be setting the frame anyway? Maybe I should be 
adding a constraint to the Image View before I add it as a subview?

The problem I am seeing is that on the first run, the board is not setup 
correctly in that the frames are different, if I re-restart a new game after 
the first time, all is well. This is *was* being called from the 
“viewWillAppear:" of the owing view controller (see code below), so I changed 
things so that “newGame” is called from “viewDidAppear:”, this works well BUT 
you see an annoying flicker when the View Controller first opens.

Any advice or help on this would be greatly appreciated.

All the Best
Dave

-(void) viewWillAppear:(BOOL) theAnimateFlag
{
[super viewWillAppear:theAnimateFlag];

[self newChaosCellViewDictionary];
//[self newGame];
}


-(void) viewDidAppear:(BOOL) theAnimateFlag
{
[super viewDidAppear:theAnimateFlag];

[self newGame];
}

These are the methods I am using to create the ImageViews and add them as a 
subview.

The "setImageForCellWithImageFilePath:” setup up an Image View and stores it as 
a property. Then, later on  “setCellAsNormal” is called to Add the subview, 
then later still, “setCellAsNormal'





-(void) setImageForCellWithImageFilePath:(NSString*) theImageFilePath
{
UIImage*myImage;
UIImageView*myImageView;
CGRect  myImageFrameRect;
NSInteger   myLineWidth;

//**
//**Setup the Line Width (also the Inset size of the Image
//**
myLineWidth = kLTWChaosCellViewFrameLineSize;

//**
//**Inset the Image Rectangle
//**
myImageFrameRect = self.bounds;
myImageFrameRect = CGRectInset(myImageFrameRect,myLineWidth,myLineWidth);

myImage = [[UIImage alloc] initWithContentsOfFile:theImageFilePath];
if (myImage == nil)
{
LTWAssertAlways(@"Cell Image Could Not be Found");
return;
}

//**
//**Create the Image View
//**
myImageView = [[UIImageView alloc] initWithImage:myImage];
[myImageView setFrame:myImageFrameRect];
[myImageView setBackgroundColor:[UIColor clearColor]];

self.pCellImageView = myImageView;

//**
//**Setup the Frame - Causes Redraw
//**
[self setFrameColor:[UIColor blackColor]];
[self setFrameLineWidth:myLineWidth];
[self setDrawFrame:YES];
}



-(void) setCellAsNormal
{
self.pCellKind = kLTWChaosBoardCellKindNormal;

[self setBackgroundColor:self.pCellUIColor];
[self removeAllSubviews];
[self addSubview:self.pCellImageView];
}



-(void) setCellAsPlayedWithPieceImage:(UIImage*) thePieceImage
{
UIImageView*myImageView;
CGRect  myFrameRect;

myFrameRect = self.bounds;
myFrameRect = CGRectInset(myFrameRect,6,6);

myImageView = [[UIImageView alloc] initWithImage:thePieceImage];
[myImageView setFrame:myFrameRect];
[myImageView setBackgroundColor:[UIColor clearColor]];

//**
//** Add as Second Image View
//**
[self setBackgroundColor:self.pCellUIColor];
[self addSubview:myImageView];
}




___

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: file encription/decriptoin iOS

2017-06-29 Thread Dave Fernandes
Ah. Thinking about the new device use case helps. Everything must be accessible 
and decryptable using only the iCloud passphrase. But if the same passphrase is 
used both to authorize access to the data and to decrypt it, then Apple has the 
passphrase to decrypt each time the user logs in, do they not? So encryption 
prevents against third parties seeing the data, but not Apple itself. Or 
perhaps the passphrase is used to generate two independent secrets and the 
passphrase itself is never sent over the wire?

> On Jun 29, 2017, at 12:27 AM, Jens Alfke  wrote:
> 
> 
>> On Jun 28, 2017, at 8:04 PM, Dave Fernandes > <mailto:dave.fernan...@utoronto.ca>> wrote:
>> 
>> So everything is protected by the iCloud Drive service key, but what does 
>> “which is then stored with the user’s iCloud account” mean? Is it stored on 
>> the device or in iCloud? That makes all the difference.
> 
> I agree it’s vague. The way I read it is that the service key is stored with 
> other account data in iCloud, but the account data is itself encrypted via 
> the user’s passphrase (which is not known to Apple.)
> 
> If the service key were stored locally, that would beg the question of how it 
> gets from one device to another. You have to be able to access everything 
> from a new device by logging into iCloud, so any secrets have to be stored 
> online. But by encrypting them using the passphrase, Apple prevents anyone 
> else (including themselves) from reading them.
> 
> —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: file encription/decriptoin iOS

2017-06-28 Thread Dave Fernandes

> On Jun 28, 2017, at 12:17 PM, Jens Alfke  wrote:
> 
> 
>> On Jun 28, 2017, at 6:33 AM, Sandor Szatmari  
>> wrote:
>> 
>> I thought there were both local and iCloud Notes, no?
> 
> Not sure what you’re asking, but: Anything saved to iCloud goes through 
> end-to-end encryption, so there’s no way to read it on the iCloud servers 
> without using keys stored on your device (derived from your iCloud password.) 
> So again, it’s not necessary to add any extra encryption.
> 
> —Jens
> ___

I didn’t realize this, and went to the iOS Security Guide to get more details, 
but I am left more confused than when I started. The Security Guide has this to 
say (CloudKit works the same way):

iCloud Drive

iCloud Drive adds account-based keys to protect documents stored in iCloud. As 
with existing iCloud services, it chunks and encrypts file contents and stores 
the encrypted chunks using third-party services. However, the file content keys 
are wrapped by record keys stored with the iCloud Drive metadata. These record 
keys are in turn protected by the user’s iCloud Drive service key, which is 
then stored with the user’s iCloud account. Users get access to their iCloud 
documents metadata by having authenticated with iCloud, but must also possess 
the iCloud Drive service key to expose protected parts of iCloud Drive storage. 


So everything is protected by the iCloud Drive service key, but what does 
“which is then stored with the user’s iCloud account” mean? Is it stored on the 
device or in iCloud? That makes all the difference.

- Dave
___

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: Help with Storyboard Problem

2017-06-20 Thread Dave

> On 19 Jun 2017, at 22:31, Quincey Morris 
>  wrote:
> 
> On Jun 19, 2017, at 11:24 , Dave  <mailto:d...@looktowindward.com>> wrote:
>> 
>> I’ve tried using Segues but can’t get that to work
> 
> You haven’t said what “can’t get that to work” means. What do you expect? 
> What happens? What does your view controller hierarchy look like.

I posted this a while back as a separate question but got no replies:

I have two iOS projects, in both projects (ProjectA and ProjectB), I have two 
view controllers in both Apps, one is the Initial View Controller and the other 
is presented via Button Click.

In ProjectA this works ok.

In ProjectB it crashes in main.m.

When I look in the Storyboard file in both projects, I see that in ProjectA 
there is a Segue from a Button to the Destination, when I inspect the Segue, to 
shows the Kind as being “Show (e.g. Push)".

However, in ProjectB is says “Push” and I can see no option for “Show” (as far 
as I remember when I created ProjectA, it said Push was deprecated).

I’m not sure if this is causing the crash, but why it is different in the two 
projects?

How can I fix this crash? I can’t see anything in the Storyboard or .m files 
that is different except the Segue “Kind” field.



I think I see what the problem is now and how it came about. I think it depends 
on what template you chose to create the initial project.

I think if I make (or embed?) my Setup (Root) View Controller in a Navigation 
Controller it will solve a lot of the issues I’m having. I’ll look into it 
further,

All the Best
Dave







___

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: Help with Storyboard Problem

2017-06-20 Thread Dave
Hi Doug and thanks for the help. Please see comment below.

> On 19 Jun 2017, at 21:22, Doug Hill  wrote:
> 
> The process to set up a 'Show' segue is:
> - Control-Click on the button in the Storyboard
> - Drag to the View Controller window you want to present
> - Select ‘Show'

That’s part of the problem with I’m having with Segue’s. It does not give me 
the option for show anymore, I get Push, Model, Custom but (since I updated 
XCode I think), it no longer gives “Show” as an option. In another iOS project 
I have, if I look at the Storyboard, it shows these Segue’s as “Show 
(Deprecated)” but I can find no more info about it.

All the Best
Dave

___

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: Help with Storyboard Problem

2017-06-19 Thread Dave
A bit more on this:

I tried it with a NIB as so:

-(IBAction) startGameAction:(id) theSender
{
LTWBoardViewController* myGameViewController;
UIView* myView;

myGameViewController = [[LTWBoardViewController alloc] 
initWithNibName:@"LTWBoardViewController" bundle:nil];

myView = myGameViewController.view;
}

And this doesn’t work either….. Even though it says in the docs that it should 

All I want to do is to call one view controller from another, this used to be 
soo simple!

If anyone could tell me how to present the view controller on the screen I’d be 
really grateful. 

All the Best
Dave

> On 19 Jun 2017, at 20:24, Dave  wrote:
> 
> XCode 8.3.3.
> 
> Hi All,
> 
> I’m using storyboards on an iOS project and can’t seem to get it to work.
> 
> I have two view controllers in the “Main.storyboard” file. The fist view 
> controller has one button on it, that when clicked, I want it to go to the 
> other view controller.
> 
> I’ve tried using Segues but can’t get that to work so decided to to it 
> manually.
> 
> I have a method in the first view controller that is hooked to the button as 
> so:
> 
> -(IBAction) startGameAction:(id) theSender
> {
> LTWChaosBoardViewController*  myGameViewController;
> UIView*   
> myView;
> 
> myGameViewController = [self.storyboard 
> instantiateViewControllerWithIdentifier:@"LTWChaosBoardViewController1”];
> myView = myGameViewController.view;
> }
> 
> This returns the correct View Controller but does not actually present it. 
> How do I do this? 
> 
> The documentation is sooo poor that I just can’t find anything that is of 
> help.
> 
> All the Best
> Dave
> 
> ___
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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


Converting a Storyboard into separate NIBs.

2017-06-19 Thread Dave
Hi All,

I have an iOS project that I have made the mistake of using storyboards on. At 
the moment, I only have one fairly complex view controller and I think it would 
be better to move to NIBs now before wasting anymore time trying to get 
Storyboards to work. 

Can anyone tell me if this is an easy process or not? I mean can I just 
copy+paste from the Storyboard into a NIB file or better still is there a way 
to export to a NIB?

All the Best
Dave

___

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


Help with Storyboard Problem

2017-06-19 Thread Dave
XCode 8.3.3.

Hi All,

I’m using storyboards on an iOS project and can’t seem to get it to work.

I have two view controllers in the “Main.storyboard” file. The fist view 
controller has one button on it, that when clicked, I want it to go to the 
other view controller.

I’ve tried using Segues but can’t get that to work so decided to to it manually.

I have a method in the first view controller that is hooked to the button as so:

-(IBAction) startGameAction:(id) theSender
{
LTWChaosBoardViewController*myGameViewController;
UIView* myView;

myGameViewController = [self.storyboard 
instantiateViewControllerWithIdentifier:@"LTWChaosBoardViewController1”];
myView = myGameViewController.view;
}

This returns the correct View Controller but does not actually present it. How 
do I do this? 

The documentation is sooo poor that I just can’t find anything that is of 
help.

All the Best
Dave

___

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: iOS Drag and Drop

2017-06-14 Thread Dave
Thanks a Million! 

All the Best
Dave

> On 14 Jun 2017, at 16:34, David Brittain  wrote:
> 
> The resources tab for each session has downloadable content. e.g. for
> "Introducing Drag and Drop"
> https://developer.apple.com/videos/play/wwdc2017/203/
> 
> There are downloadable slides...
> 
> https://devstreaming-cdn.apple.com/videos/wwdc/2017/203atfalwz52js/203/203_introducing_drag_and_drop.pdf
> 
> and demo app...
> 
> https://developer.apple.com/sample-code/wwdc/2017/Drag-and-Drop-Demo-App.zip

___

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: iOS Drag and Drop

2017-06-14 Thread Dave
I’m only on XCode 8.3.2 and I can’t update at the moment because I have a VERY 
slow and flakey Internet Connection.

Is there nothing I can just download?  It seems to me there used to be loads of 
documents telling you have to do this, but they all seem to have disappeared?

All the Best
Dave


> On 13 Jun 2017, at 17:54, Jens Alfke  wrote:
> 
> It’s right in the developer docs. In Xcode 9 open the doc viewer, flip open 
> UIKit in the outline on the left, then select Drag And Drop.
> 
> —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: iOS Drag and Drop

2017-06-13 Thread Dave
Hi,

I should have said I’m using Objective-C not Swift and I’d much rather have 
some written docs then a video for a number of reasons, the main one being I 
have limited Internet access at the moment and I can’t find a way to download 
the videos anymore…… Also, I find it takes much longer to keep on stopping a 
video and then doing a bit in XCode. I’d much rather a simple Sample App 
and/orDrag and Drop Programming Guide type document. I seem to remember a 
document like that a when I was working on iOS before, but I can’t find it or 
anything like it anymore…..

Cheers
Dave
___

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


iOS Drag and Drop

2017-06-13 Thread Dave
Hi,

Can someone point me to some documentation of Drag and Drop for iOS please?

I done loads of searches but can’t find a brief intro and some Sample Code.

I’ve not been working on iOS for some time and things seem to have changed 
quite a lot. 

Cheers
Dave

___

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


Problem with Seque's

2017-06-09 Thread Dave
Hi All,

I have two iOS projects, in both projects (ProjectA and ProjectB), I have two 
view controllers in both Apps, one is the Initial View Controller and the other 
is presented via Button Click.

In ProjectA this works ok.

In ProjectB it crashes in main.m.

When I look in the Storyboard file in both projects, I see that in ProjectA 
there is a Segue from a Button to the Destination, when I inspect the Segue, to 
shows the Kind as being “Show (e.g. Push)".

However, in ProjectB is says “Push” and I can see no option for “Show” (as far 
as I remember when I created ProjectA, it said Push was deprecated.

I’m not sure if this is causing the crash, but why it is different in the two 
projects?

How can I fix this crash? I can’t see anything in the Storyboard or .m files 
that is different except the Segue “Kind” field.

It seems like everything I try to do something with Storyboards there are 
crashes all over the place and I’m beginning to wish I’d not used them and just 
stuck to NIB files. Is there anyway to export View Controllers from a 
Storyboard file into a NIB file?

Thanks a lot 
All the Best
Dave

___

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


Drawing a 5 Sided Star Shape

2017-06-02 Thread Dave
Hi,

I want to draw a 5 sided Star Shape using UIBezierPath. I’ve search for a 
general purpose algorithm, but I can’t find anything that I can get to work 
with Cocoa/Objective-C. 

This code is to go into a UIView subclass in the drawRect: method. 

If anyone has some code that will draw a decent looking star I’d be really 
grateful.

Thanks a lot 
All the Best
Dave

___

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

Auto Layout Question

2017-05-24 Thread Dave
iOS Project.

Hi,

I’m trying to do something with auto layout and I can’t seem to get it right.

I want to create a View that holds a Text Field and a View. Call these LabelA 
and ViewA. I want the Text to appear above the view and i want the View to have 
the same aspect ratio (which is 1:1). I then want the same again, e.g.another 
Text Field and View, positioned in the same manner.

In XCode/IB 8.3.2, here’s what I do:

I create a Label Field, and Set the Text to “Side A", set a custom font of size 
10, call it SideALabel. I create a UIView (call it SideAView) and set its size 
to 35,35 and set the Background Colour to Red. I add an Aspect Ratio constraint 
of 1:1 to SideAView  I then position and resize SideALabel so it has a height 
of 10 and the width is 35 (same as the UIView). I set then an Alignment 
Constraint Leading and Trailing Edges between SideALabel and SideAView. I now 
embed the SideALabel and SideAView in a StackView, call this SideAStackView. It 
now resizes/repositions the Stack and I move it where I want it. When I switch 
to different iPhone’s in XCode/IB it rescales accordingly. 

I actually want two of these Text/Views Combinations, so I duplicate the Stack 
View (call it SideBStackView) and position it to the right of SideAStackView). 
I change the Text to “Side B” and the background color the View to Blue.

  Side A Side B
+—+  +—+
||   |   |  
|   Red  |   |  Blue  |  
||   |   |  
+—+  +—+

The problem is that the StackViews resize so they are of different sizes.

I then embedded  SideAStackView and SideBStackView in another StackView - call 
it SideSelectionStackView, I then set this new StackView’s distribution to 
“Fill Equally” (I’ve also tried “Fill Proportionally” ) and set the spacing so 
there is a gap between SideAStackView and SidebStackView. This almost works, 
except the height of the Text and View Sizes are slightly different. SideA has 
a higher text box/bigger font and the View is slightly smaller. SideB Text is 

I’ve set the Left, Bottom, Right Constraints, so that basically it grows 
upwards from the bottom of the Screen, but because of the aspect ratio it can’t 
get too big. I have another View situated to the right of this and the stack 
view is set to only extend so far from the left of this view.

I’ve tried everything I can think of to make this work but I’ve now run out of 
ideas.

Am I missing something? Maybe I am going about this in the wrong way? 

Any help and suggestions on the best way of doing this would be greatly 
appreciated.

I’m trying to prepare a demo for tomorrow afternoon and it would be really 
great if I could show this displaying correctly.

All the Best
Dave











___

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 Problem/Question

2017-05-22 Thread Dave
Hi,

Thanks a lot - That’s what I was looking for! I added a 1:1 Aspect Ratio 
constraint to the Root StackView and it now works ok.

I have another question regarding Auto Layout and XCode.

In XCode/IB I’ve designed these views in Landscape. I started with the iPhone 
4s which is the Smallest I could find in IB and then moved on to iPhone SE, 
iPhone 7 and 7+. These all seem to work ok in Landscape in XCode, but if I 
switch to portrait it stops working.

I want the Root Stack View to be placed to the left of the Screen in Landscape 
and the Top of the Screen in Portrait. Can I do this with one set of 
constraints or is it better to have two separate View Hierarchies and switch 
between them in code?

All the Best
Dave

___

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

View Controllers, Views and Storyboards

2017-05-22 Thread Dave
Hi All,

I have a question about View Controllers in Storyboard’s. 

In the past I have handled Landscape and Portrait Views as two separate 
Hierarchies in XCode/IB. I defined the roots Views inside the View Controller 
but NOT in the main .view. I then hooked these up to the View Controller Class 
as IBOutlets and then adding one or the to the main view in viewWillAppear. E.g.

In IB:

Main “view” - empty.
LandscapeRootView - Hierarchy of Views.
PortraitRootView - Hierarchy of Views.

In the View Controller Class:

@property (nonnull,strong)  IBOutlet UIStackView*   
pPortraitRootStackView;
@property (nonnull,strong)  IBOutlet UIStackView*   
pLandscapeRootStackView;

Then in viewWillAppear:

[self.view removeAllSubviews];
if (Orientation == Portrait)
[self.view addSubview:self. pPortraitRootStackView];
else
[self.view addSubview:self. pLandscapeRootStackView];

However when I come to do this in a Storyboard, I can create the Views OK, but 
it XCode/IB won’t let me hook it up to the Outlets.

I’m using Auto-layout and can’t find a way to make it work with just one view 
hierarchy as the constraints clash.

Any ideas on how to achieve this would be greatly appreciated.

All the Best
Dave

___

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: NSBezierPath on iOS?

2017-05-22 Thread Dave
Hi,

I changed it to use UIBezierPath but now I get errors on the 3 + methods it 
uses - fillRect, setDefaultLineWidth and strokeRect.

From looking at the documentation, I’m guessing that I need to create a path, 
I’ve added this code:

-(void) drawRect:(CGRect) theRect
{
CGRect  myRect;
UIBezierPath*   myPath;

myRect = 
CGRectInset(self.bounds,self.pFrameInsetSize.width,self.pFrameInsetSize.height);
if (self.pDrawPaneFlag == YES)
{
myPath = [UIBezierPath bezierPathWithRect:myRect];
[self.pPaneColor set];
[myPath fill];
}

if (self.pDrawFrameFlag == YES)
{
myPath = [UIBezierPath bezierPathWithRect:myRect];

[self.pFrameColor set];
[myPath setLineWidth:self.pFrameLineWidth];
[myPath stroke];
}
}

Does this look right?

Also, I’m guessing it should be setNeedsDisplayInRect instead of 
setNeedsDisplay,

I changed this to:

[self setNeedsDisplayInRect:self.frame];

Is this correct or should it be self.bounds?

Thanks again.

All the Best
Dave

> On 22 May 2017, at 13:02, Dave  wrote:
> 
> Thanks a lot!
> 
> All the Best
> Dave
>> On 22 May 2017, at 12:43, dangerwillrobinsondan...@gmail.com wrote:
>> 
>> You want UI not NS BezierPath
>> 
>> Sent from my iPhone
>> 
>>> On May 22, 2017, at 19:23, Dave >> <mailto:d...@looktowindward.com>> wrote:
>>> 
>>> Sorry I should have said, this class is a Subview of UIView.
>>> 
>>> I’m also getting an error on:
>>> 
>>> [self setNeedsDisplay:YES];
>>> 
>>> I’m so rusty on iOS and I’m finding hard to remember the differences.
>>> 
>>> All the Best
>>> Dave
>>> 
>>>> On 22 May 2017, at 12:09, Dave  wrote:
>>>> 
>>>> Hi,
>>>> 
>>>> I’m converting a Class from Mac to iOS and I’ve got errors on the 
>>>> following code:
>>>> 
>>>> if (self.pDrawPaneFlag == YES)
>>>> {
>>>> [self.pPaneColor set];
>>>> [NSBezierPath fillRect:myRect];
>>>> }
>>>> 
>>>> if (self.pDrawFrameFlag == YES)
>>>> {
>>>> [self.pFrameColor set];
>>>> [NSBezierPath setDefaultLineWidth:self.pFrameLineWidth];
>>>> [NSBezierPath strokeRect:myRect];
>>>> }
>>>> }
>>>> 
>>>> It seems that NSBezierPath is not available on iOS, is there something I 
>>>> can use that is equivalent to the above on iOS?
>>>> 
>>>> All the Best
>>>> Dave
>>>> 
>>>> ___
>>>> 
>>>> 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/dave%40looktowindward.com
>>>> 
>>>> This email sent to d...@looktowindward.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/dangerwillrobinsondanger%40gmail.com
>>>  
>>> <https://lists.apple.com/mailman/options/cocoa-dev/dangerwillrobinsondanger%40gmail.com>
>>> 
>>> This email sent to dangerwillrobinsondan...@gmail.com 
>>> <mailto:dangerwillrobinsondan...@gmail.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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: NSBezierPath on iOS?

2017-05-22 Thread Dave
Thanks a lot!

All the Best
Dave
> On 22 May 2017, at 12:43, dangerwillrobinsondan...@gmail.com wrote:
> 
> You want UI not NS BezierPath
> 
> Sent from my iPhone
> 
>> On May 22, 2017, at 19:23, Dave > <mailto:d...@looktowindward.com>> wrote:
>> 
>> Sorry I should have said, this class is a Subview of UIView.
>> 
>> I’m also getting an error on:
>> 
>> [self setNeedsDisplay:YES];
>> 
>> I’m so rusty on iOS and I’m finding hard to remember the differences.
>> 
>> All the Best
>> Dave
>> 
>>> On 22 May 2017, at 12:09, Dave  wrote:
>>> 
>>> Hi,
>>> 
>>> I’m converting a Class from Mac to iOS and I’ve got errors on the following 
>>> code:
>>> 
>>> if (self.pDrawPaneFlag == YES)
>>>   {
>>>   [self.pPaneColor set];
>>>   [NSBezierPath fillRect:myRect];
>>>   }
>>> 
>>> if (self.pDrawFrameFlag == YES)
>>>   {
>>>   [self.pFrameColor set];
>>>   [NSBezierPath setDefaultLineWidth:self.pFrameLineWidth];
>>>   [NSBezierPath strokeRect:myRect];
>>>   }
>>> }
>>> 
>>> It seems that NSBezierPath is not available on iOS, is there something I 
>>> can use that is equivalent to the above on iOS?
>>> 
>>> All the Best
>>> Dave
>>> 
>>> ___
>>> 
>>> 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/dave%40looktowindward.com
>>> 
>>> This email sent to d...@looktowindward.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/dangerwillrobinsondanger%40gmail.com
>>  
>> <https://lists.apple.com/mailman/options/cocoa-dev/dangerwillrobinsondanger%40gmail.com>
>> 
>> This email sent to dangerwillrobinsondan...@gmail.com 
>> <mailto:dangerwillrobinsondan...@gmail.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

Autolayout Problem/Question

2017-05-22 Thread Dave
iOS 

Hi,

I have the following view layout in a Storyboard:

StackView   Vertical
StackView   Horizontal
SquareColorView1
SquareColorView2
SquareColorView3
SquareColorView4
SquareColorView5
SquareColorView6
SquareColorView7
SquareColorView8
SquareColorView9
StackView   Horizontal
SquareColorView1
SquareColorView2
SquareColorView3
SquareColorView4
SquareColorView5
SquareColorView6
SquareColorView7
SquareColorView8
SquareColorView9
StackView   Horizontal
SquareColorView1
SquareColorView2
SquareColorView3
SquareColorView4
SquareColorView5
SquareColorView6
SquareColorView7
SquareColorView8
SquareColorView9
StackView   Horizontal
SquareColorView1
SquareColorView2
SquareColorView3
SquareColorView4
SquareColorView5
SquareColorView6
SquareColorView7
SquareColorView8
SquareColorView9
StackView   Horizontal
SquareColorView1
SquareColorView2
SquareColorView3
SquareColorView4
SquareColorView5
SquareColorView6
SquareColorView7
SquareColorView8
SquareColorView9
StackView   Horizontal
SquareColorView1
SquareColorView2
SquareColorView3
SquareColorView4
SquareColorView5
SquareColorView6
SquareColorView7
SquareColorView8
SquareColorView9
StackView   Horizontal
SquareColorView1
SquareColorView2
SquareColorView3
SquareColorView4
SquareColorView5
SquareColorView6
SquareColorView7
SquareColorView8
SquareColorView9
StackView   Horizontal
SquareColorView1
SquareColorView2
SquareColorView3
SquareColorView4
SquareColorView5
SquareColorView6
SquareColorView7
SquareColorView8
SquareColorView9
StackView   Horizontal
SquareColorView1
SquareColorView2
SquareColorView3
SquareColorView4
SquareColorView5
SquareColorView6
SquareColorView7
SquareColorView8
SquareColorView9


The SquareColourView is a View that displays a coloured Rectangle with a Frame 
around it.

I have designed this in a Storyboard and started on the lowest resolution 
iPhone (4s). On the  4s each Coloured view in the Stack View is Square.  I then 
switch to a iPhone 7s and because there is now more space available, the inner  
SquareColorView’s are stretched horizontally. I want them to grow in size, but 
maintain there “Square” shape, however I can’t seem to figure out how to do 
this with Auto layout. 

Any help or suggestions greatly appreciated.

All the Best
Dave













___

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: NSBezierPath on iOS?

2017-05-22 Thread Dave
Sorry I should have said, this class is a Subview of UIView.

I’m also getting an error on:

[self setNeedsDisplay:YES];

I’m so rusty on iOS and I’m finding hard to remember the differences.

All the Best
Dave

> On 22 May 2017, at 12:09, Dave  wrote:
> 
> Hi,
> 
> I’m converting a Class from Mac to iOS and I’ve got errors on the following 
> code:
> 
> if (self.pDrawPaneFlag == YES)
>   {
>   [self.pPaneColor set];
>   [NSBezierPath fillRect:myRect];
>   }
> 
> if (self.pDrawFrameFlag == YES)
>   {
>   [self.pFrameColor set];
>   [NSBezierPath setDefaultLineWidth:self.pFrameLineWidth];
>   [NSBezierPath strokeRect:myRect];
>   }
> }
> 
> It seems that NSBezierPath is not available on iOS, is there something I can 
> use that is equivalent to the above on iOS?
> 
> All the Best
> Dave
> 
> ___
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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

NSBezierPath on iOS?

2017-05-22 Thread Dave
Hi,

I’m converting a Class from Mac to iOS and I’ve got errors on the following 
code:

if (self.pDrawPaneFlag == YES)
{
[self.pPaneColor set];
[NSBezierPath fillRect:myRect];
}

if (self.pDrawFrameFlag == YES)
{
[self.pFrameColor set];
[NSBezierPath setDefaultLineWidth:self.pFrameLineWidth];
[NSBezierPath strokeRect:myRect];
}
}

It seems that NSBezierPath is not available on iOS, is there something I can 
use that is equivalent to the above on iOS?

All the Best
Dave

___

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: Video Player Controls?

2017-05-17 Thread Dave
Hi,

Should have said - this is an iOS project. It would be great if I could just 
get the same graphics for the controls as the Main Player, I could easily wire 
up my own action handlers…..

Cheers
Dave

> On 17 May 2017, at 13:14, Charles Jenkins  wrote:
> 
> If you’re doing your work on the Mac, there’s an available Apple demo, 
> AVSimplePlayer, which demonstrates how to wire up KVO (in Obj-C) in order to 
> provide playback controls. I was never able to get it working after porting 
> to Swift, but it works fine in Obj-C.
> 
> On Wed, May 17, 2017 at 7:05 AM, Dave  <mailto:d...@looktowindward.com>> wrote:
> 
> Hi All,
> 
> (The content of the original message seems to have disappeared!)
> 
> I’m using AVPlayer and AVPlayerLayer to play a movie in a view. However when 
> I do this I lose the Video Playback Controls (Play/Pause/Fast Forward etc) I 
> get when using AVPlayerViewController. Is there a class to handle displaying 
> and responding to these controls or do I have to completely roll my own, with 
> my own graphics etc?
> 
> Thanks a lot
> 
> All the Best
> Dave
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
> <mailto: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 
> <http://lists.apple.com/>
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/cejwork%40gmail.com 
> <https://lists.apple.com/mailman/options/cocoa-dev/cejwork%40gmail.com>
> 
> This email sent to cejw...@gmail.com <mailto:cejw...@gmail.com>
> 
> 
> -- 
> 
> 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

Video Player Controls?

2017-05-17 Thread Dave

Hi All,

(The content of the original message seems to have disappeared!)

I’m using AVPlayer and AVPlayerLayer to play a movie in a view. However when I 
do this I lose the Video Playback Controls (Play/Pause/Fast Forward etc) I get 
when using AVPlayerViewController. Is there a class to handle displaying and 
responding to these controls or do I have to completely roll my own, with my 
own graphics etc?

Thanks a lot

All the Best
Dave
___

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

Video Player Controls?

2017-05-16 Thread Dave

___

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


iOS AVPlayerViewController and AVPlayer Documentation/Help

2017-05-11 Thread Dave
Hi,

The following code plays a movie file in Full Screen, I’d like to be able to 
play a Video inside an arbitrary View with the option to go into full screen. 
I’ve searched for info on this seemingly simple task but can’t seem to find 
anything useful. I’ve tried setting myPlayerViewController.view.frame but this 
doesn’t seem to work. I found some iOS 6 code that I wrote ages ago which does 
this, but of course this has changed so much since then…..

Any help on this greatly appreciated.

All the Best
Dave 

-(void) viewDidAppear:(BOOL) theAnimatedFlag
{
NSURL*  myMovieFileURL;
AVPlayer*   myPlayer;
AVPlayerViewController* myPlayerViewController;
CGRect  myFrameRect;

myMovieFileURL = [[NSBundle mainBundle] URLForResource:@"Demo-ENG-EX-001" 
withExtension:@"mp4"];
myPlayer = [[AVPlayer alloc] initWithURL:myMovieFileURL];

myPlayerViewController = [[AVPlayerViewController alloc] init];
myPlayerViewController.player = myPlayer;

[self presentViewController:myPlayerViewController animated:YES completion:^
{
[myPlayer play];
}];
}

___

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: Problem Playing Movie File on iOS

2017-05-10 Thread Dave

___

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: Problem Playing Movie File on iOS

2017-05-09 Thread Dave

> On 9 May 2017, at 15:41, Peter Tomaselli  wrote:
> 
> I don't believe you can present a view controller in viewDidLoad. I am away 
> from my computer, so I can't confirm right now, but I do not believe the 
> presenting view controller's view is in the view hierarchy yet during 
> viewDidLoad (exactly as the error message says).

I realised that a few minutes after posting. I moved it into viewWillAppear and 
it sort of works, moved it into viewDidAppear and it works BUT the code should 
be:

-(void) viewDidAppear:(BOOL) theAnimatedFlag
{
NSURL*  myMovieFileURL;
AVPlayer*   myPlayer;
AVPlayerViewController* myPlayerViewController;

myMovieFileURL = [[NSBundle mainBundle] URLForResource:@"OrchidDemo-ENG-EX-001" 
withExtension:@"mp4"];
myPlayer = [[AVPlayer alloc] initWithURL:myMovieFileURL];

myPlayerViewController = [[AVPlayerViewController alloc] init];
[self.pMovieView addSubview:myPlayerViewController.view];   
//***

[self presentViewController:myPlayerViewController animated:YES completion:nil];

myPlayerViewController.player = myPlayer;
[myPlayer play];
}

All the Best
Dave


___

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


Problem Playing Movie File on iOS

2017-05-09 Thread Dave
Hi,

I’m tying to get a movie to play in iOS. 

I have this in a View Controller. When I run it, it seems to play the file as I 
hear Audio but I get this message in the log:

Warning: Attempt to present  on 
 whose view is not in the window hierarchy!

I’ve search for help on this but I get hundreds of solutions using all kinds of 
different techniques but none of them work. The Apple Documentation is totally 
useless from what I can see and offers no working solutions to build upon that 
I can find.

Here is the code:

-(void) viewDidLoad
{
AVPlayerViewController* myViewController;
AVPlayer*   myPlayer;
NSURL*  myMovieFileURL;

[super viewDidLoad];

myMovieFileURL = [[NSBundle mainBundle] URLForResource:@"Demo-ENG-EX-001" 
withExtension:@"mp4"];
myPlayer = [[AVPlayer alloc] initWithURL:myMovieFileURL];

myViewController = [[AVPlayerViewController alloc] init];
[self presentViewController:myViewController animated:YES completion:nil];

myViewController.player = myPlayer;
[myPlayer play];
}

I’m guess that I need to add a view to the AVPlayerViewController or vice 
versa? 

Thanks in advance for any help.

All the Best
Dave

___

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

Basic Question about iOS View Controllers/Storyboards

2017-05-08 Thread Dave
HI All,

I’ve been working on a Mac Project for a long time and I now have a demo to do 
for an iOS project. 

The last time I worked on iOS was the iOS 6 era and we didn’t use Storyboards 
for that project.

I’m trying to figure out the best template to base the project on, or if there 
is a Sample App that I can adapt that would t tget me on the right track.

For the Demo, I basically need to have a screen that allows the User to select 
a language (at present only English and Spanish) and then play a set of mp4 
movies corresponding to the language selected. I already have the Movies and 
can add them to an XCode project easily. The file names have a pattern of 
Movie-ENG.mp4 or Movie-ESP.mp4 (where NN is the movie number 01 to 99). 

Does anyone have any idea or suggestions where to get started on this?

I’ll probably be doing the Demo in Objective-C (as my Swift code is still very 
sketchy) and then if I get the main contract I will write the end product in 
Swift unless there is a good reason not to.

All the Best
Dave
 
___

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

Determining if an X,Y position will cause a Move or Resize?

2017-04-26 Thread Dave
Hi All,

I have an X,Y that is in another Application’s Window, is there a way of 
determining if that the Mouse is Dragged at that position whether the Drag will 
be a Window Move or a Window Resize operation. 

Basically I just want to tell if the Mouse is in the Window Title Bar (move) or 
in the Window Frame (resize).

Thanks a lot
All the Best
Dave

___

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

Question about the Main Thread

2017-04-25 Thread Dave
Mac Project.

Hi All, 

I’m using performSelector: withObject: afterDelay: in order to postpone further 
processing until after the current method/run loop as expired, this puts the 
request at the End of the Queue, my question is, is there anyway of putting it 
at the head of the Queue so it gets processing before other requests?

All the Best
Dave

___

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

[OT] Question about writing documentation

2017-04-21 Thread Dave
Hi,

I’m looking for a decent Application that runs on the Mac that will allow me to 
create detailed diagrams of Objective-C Classes. Basically I have a Network of 
inter-related Objects, the Network is represented by Array’s and Dictionary’s 
and I like to do some diagrams showing how each object in the Network is linked.

I’ve tried a few Apps from the App Store and although they are “OK” they either 
buggy for hard to use and don’t have any in-built objects that are suitable for 
representing Classes/Objecrs. The type of diagrams I’d like are similar to the 
ones in the Apple Documentation. 

Thanks in Advance for any suggestions…..

All the Best
Dave

___

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

Getting the Version of an Application

2017-04-11 Thread Dave
Hi All,

This is a Mac question.

Is there any way of getting the version number of an Application if it is NOT 
running?

Thanks a lot
All the Best
Dave

___

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


iOS Same project question

2017-03-22 Thread Dave
Hi,

I’ve been working on a Mac project for 2+ years and now I’m trying to refresh 
my iOS knowledge.

I created a New iOS Application in XCode and selected the Page View Template. 
Looking through the code I understand most of it but one thing puzzles me. When 
you move pages the Label at the Top of the Screen changes January, February, 
March, etc. but I can see nothing that actually sets these values? Its 
obviously something that is hidden somewhere, but I’m at a lost to find it in 
the code or the storyboard….

Any help greatly appreciated.

All the Best
Dave


___

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: Mobile Cross Platform Solutions

2017-02-09 Thread Dave
Good point, I will bring it up and Thanks Jens I’ll take a look.

All the Best
Dave

> On 8 Feb 2017, at 17:08, Scott Berry  wrote:
> 
> Dave,
> 
> While your doing this please keep accessibility for the disabled in mind as 
> well.  This way we can enjoy the app with the rest of the sighted world.
> 
> 
>> On Feb 8, 2017, at 4:34 AM, Dave  wrote:
>> 
>> Hi,
>> 
>> I’ve been asked to look at doing a Mobile App for a museum, basically the 
>> App needs to show info (text, pictures and movies) for each exhibit. I’m 
>> wondering the best way to make it work for iOS, Android and Windows Phone 
>> (maybe). The content can be formatted as HTML and I’m wondering if it would 
>> be better to develop 3 separate “shell” apps, one for each platform or or 
>> try to use a “Cross Platform” solution. The shell would just display HTML 
>> pages, e.g. a WebView on iOS but I’m not sure how the other platforms would 
>> handle it,
>> 
>> Any ideas/suggestions greatly appreciated.
>> 
>> All the Best
>> Dave
>> 
>> 
>> ___
>> 
>> 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/sb356607%40gmail.com
>> 
>> This email sent to sb356...@gmail.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

Mobile Cross Platform Solutions

2017-02-08 Thread Dave
Hi,

I’ve been asked to look at doing a Mobile App for a museum, basically the App 
needs to show info (text, pictures and movies) for each exhibit. I’m wondering 
the best way to make it work for iOS, Android and Windows Phone (maybe). The 
content can be formatted as HTML and I’m wondering if it would be better to 
develop 3 separate “shell” apps, one for each platform or or try to use a 
“Cross Platform” solution. The shell would just display HTML pages, e.g. a 
WebView on iOS but I’m not sure how the other platforms would handle it,

Any ideas/suggestions greatly appreciated.

All the Best
Dave


___

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: Overriding the release mehod

2017-01-25 Thread Dave

> On 25 Jan 2017, at 19:37, Doug Hill  wrote:
> 
> 
>> On Jan 25, 2017, at 11:23 AM, Dave > <mailto:d...@looktowindward.com>> wrote:
>> 
>> I also tried searching “release method documentation” but nada!
> 
> I hear you about the search functionality of Apple's developer documentation. 
> They definitely need a better search engine for documentation in both Xcode 
> and the developer website as finding things can be iffy at best. They seem to 
> suffer from what I call the 'Dictionary Problem.' You can't find the spelling 
> of a word in a dictionary unless you already roughly know the spelling. 
> Similarly,  you can't find anything in Apple's documentation unless you 
> roughly know where it is.
> 
> A couple of recommendations:
> 
> 1. Use Google search to search developer.apple.com 
> <http://developer.apple.com/>
> 
> For example, searching for 'nsobject release' returns the protocol it's 
> defined as the first result, the method documentation as the second.
> 
> 2. Feel free to encourage Apple to improve their search functionality

it used to work much better, then Apple “improved it” and now it is as it is. 
One can only assume they changed it for good reason so why moan about it to 
them. I’ve largely found it a complete waste of time, once Apple decide to 
“improve” something then it is automatically better in their eyes and no amount 
of logic or use (or lack of use) cases can change their minds. Just look at 
XCode code in general…… They probably don’t have the resources to do it 
properly any more as they are spending their money on teams of accountants to 
research tax dodging….. 

All the Best
Dave
 
___

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: Overriding the release mehod

2017-01-25 Thread Dave
I also tried searching “release method documentation” but nada!


___

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: Overriding the release mehod

2017-01-25 Thread Dave
Cheers, I tried searching “release method definition” but that doesn’t bring it 
up - go figure!

All the Best
Dave

> On 25 Jan 2017, at 19:04, Doug Hill  wrote:
> 
> 
>> On Jan 25, 2017, at 10:59 AM, Dave > <mailto:d...@looktowindward.com>> wrote:
>> 
>> Hi,
>> 
>>> Look at Apple's Foundation NSObject protocol reference document for the 
>>> -release method. It includes this statement:
>> 
>> Could you point me to the URL I still can’t find it. Apple’s documentation 
>> is absolutely shocking! I’m looking at 
>> https://developer.apple.com/reference/objectivec/protocol?language=objc 
>> <https://developer.apple.com/reference/objectivec/protocol?language=objc> 
>> but no mention of release to be found?
>> 
>> All the Best
>> Dave
> 
> https://developer.apple.com/reference/objectivec/1418956-nsobject?language=objc
>  
> <https://developer.apple.com/reference/objectivec/1418956-nsobject?language=objc>
> 
> release - Decrements the receiver’s reference count.
> 
> Language - Objective-C
> 
> Declaration
> 
> - (oneway void)release;
> 
> Discussion
> 
> The receiver is sent a dealloc message when its reference count reaches 0.
> 
> You would only implement this method to define your own reference-counting 
> scheme. Such implementations should not invoke the inherited method; that is, 
> they should not include a release message to super.

___

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: Overriding the release mehod

2017-01-25 Thread Dave
Hi,

> Look at Apple's Foundation NSObject protocol reference document for the 
> -release method. It includes this statement:

Could you point me to the URL I still can’t find it. Apple’s documentation is 
absolutely shocking! I’m looking at 
https://developer.apple.com/reference/objectivec/protocol?language=objc but no 
mention of release to be found?

All the Best
Dave


___

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: Overriding the release mehod

2017-01-25 Thread Dave
Hi,

Yes, I understand that, but really, I just wanted to know where it was written 
in black and white and I couldn’t find it by searching. I could have worked out 
where it was necessary to override release myself, I just wanted to know the 
effect of calling it and not calling it. Asking why I am doing it assumes that 
is it a) my code I am talking about, b) that I am intending to add it as new 
code, c) that I don’t know what I’m doing as I said I was 99.999% sure that 
it needed to be called in this case but wanted to see it in black and while.

All the Best
Dave

> On 25 Jan 2017, at 16:57, Greg Weston  wrote:
> 
> Dave wrote:
> 
>> I hate it when people ask [why are you doing X]!
> 
> Decades of experience seeing such questions make us think that when someone 
> is asking how to do something extraordinary there's about 99% chance they 
> don't actually need to do it and are making things harder for themselves. 
> Sometimes the best answer to "How do I do X?" is "You don't. Do Y instead." 
> If someone is trying to give the best answer they may need to know what the 
> asker is really trying to accomplish.
> ___
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: Overriding the release mehod

2017-01-25 Thread Dave

> On 25 Jan 2017, at 16:48, Bill Cheeseman  wrote:
> 
> 
>> On Jan 25, 2017, at 11:23 AM, Dave > <mailto:d...@looktowindward.com>> wrote:
>> 
>> I hate it when people as that question! There are some memory leaks in a 3rd 
>> party package. It overrides release to unregister an observer but doesn’t 
>> call super. If I call super the leaks go away and all is well. I just want 
>> to know where is it documented really, I can’t find it searching the docs.
> 
> 
> Look at Apple's Foundation NSObject protocol reference document for the 
> -release method. It includes this statement:
> 
> "You would only implement this method to define your own reference-counting 
> scheme. Such implementations should not invoke the inherited method; that is, 
> they should not include a release message to super."
> 
> My framework does NOT define its own reference-counting scheme, within the 
> meaning of that quotation. Instead, my framework overrides -release for the 
> SOLE PURPOSE of unregistering an observer the last time a standard -release 
> is called on the given object -- that is, when the separately maintained 
> weakRetainCount reaches the specified value. In all other respects, my 
> framework relies on the -release method to do what it always does.
> 
> Therefore, it IS in fact necessary to include [super release] at the end of 
> the override.

Ok, I was looking in NSObject! 

Yes, I thought so, it occurred to me that I’ve seen instances where singletons 
override release so the (one) version of the object never gets release which is 
what I assume that document means by "your own reference-counting scheme”. I 
never implement singletons that way, preferring to use a factory class that 
allows N of each object to be created and just set N to 1.

All the Best
Dave


___

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: Overriding the release mehod

2017-01-25 Thread Dave
I hate it when people as that question! There are some memory leaks in a 3rd 
party package. It overrides release to unregister an observer but doesn’t call 
super. If I call super the leaks go away and all is well. I just want to know 
where is it documented really, I can’t find it searching the docs.

Cheers
Dave

> On 25 Jan 2017, at 15:55, Mike Abdullah  wrote:
> 
> You’re inevitably going to get asked this:
> Why on earth are you overriding release? It’s an incredibly niche thing to 
> do, and the answer probably depends a lot on why you’re overriding it.
> 
>> On 25 Jan 2017, at 16:52, Dave  wrote:
>> 
>> Hi,
>> 
>> Does [suoer release] need to be called if you override this method? I’m 
>> 99.9% sure it does, but I can’t find it anywhere it actually says it in 
>> black and white.
>> 
>> All the Best
>> Dave
>> 
>> 
>> ___
>> 
>> 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/mabdullah%40karelia.com
>> 
>> This email sent to mabdul...@karelia.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

Overriding the release mehod

2017-01-25 Thread Dave
Hi,

Does [suoer release] need to be called if you override this method? I’m 
99.9% sure it does, but I can’t find it anywhere it actually says it in 
black and white.

All the Best
Dave


___

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

Clarification on MMM rules for init?

2017-01-21 Thread Dave
HI,


This is for a Mac based App.

I’m looking at some old code and have found what I think is a long standing 
bug. This is a class that has an initWithXXX method which may fail, in this 
case it calls [self autorelease] and returns nil. However, I have found a case 
whereby does a [self autorelease], but instead of retuning nil, it returns 
self. Is this an error?

If so, this framework is being called from an ARC based App, what would be the 
effect of this error on the App?

All the Best
Dave
___

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

App to Monitor Accessibility Notifications?

2016-11-09 Thread Dave
Hi All,

I remember seeing an Application/Tool that monitored Assistive Notifications. 
Does anyone know if this still exists and where I can get it from?

Thanks in Advance,

All the Best
Dave
___

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: CoreData headaches

2016-10-27 Thread Dave Fernandes
The managed objects exist in a MOC whether you have a reference to that MOC or 
not. You can get a reference to the MOC that an MO “belongs to" from the 
-[NSManagedObject managedObjectContext] instance method. Since the properties 
you need are so few and simple, why don’t you just pass these in to the 
NSOperation when you create it on the main thread instead of giving it the 
managed object? Then the MO will never be accessed off the main queue.

> On Oct 28, 2016, at 12:02 AM, Steve Mills  wrote:
> 
> On Oct 27, 2016, at 22:49:15, Dave Fernandes  
> wrote:
>> 
>> But what managed object are you dealing with? Is the Asset a managed object? 
>> If so, you can only access its properties from the queue of its managed 
>> object context. So if it is a main queue context, you can only access the 
>> MO’s properties from the main queue. If it is a private queue context, you 
>> use performBlock on the MO’s context to execute a block of code in the 
>> context’s queue and you must access the MO’s properties from inside that 
>> block. If I’m stating something you already know, forgive me. It is not 
>> clear from your post. Example code would help.
> 
> Yes, the Asset is an NSManagedObject. In this call chain, there is no 
> NSManagedObjectContext in sight. The NSCollectionView is simply creating item 
> views to display for each Asset. It asks the Asset to create an image 
> thumbnail. The Asset does so in via the steps I outlined before.
> 
> Now way back in the document's init method, I set up an 
> NSManagedObjectContext with type NSMainQueueConcurrencyType. So yes, there is 
> a main queue type context, but the code that is requesting the thumbnails 
> knows nothing about it or even cares.
> 
>>> On Oct 27, 2016, at 11:24 PM, Steve Mills  wrote:
>>> 
>>> I'll explain what's going on. Each NSCollectionViewItem in the 
>>> NSCollectionView is being assigned its representedObject (the Asset, which 
>>> is a reference to an image file). At that point, I ask the Asset to 
>>> requestPreviewImageAtSize:, which creates an NSBlockOperation (and adds it 
>>> to an NSOperationQueue), whose block creates a CGImageSourceRef. Before it 
>>> can create the CGImageSourceRef, it needs to get the url. It does this by 
>>> asking for its .folder and .name properties. Those are nonatomic properties 
>>> of the Asset. Once it has the url and the CGImageSourceRef, it creates the 
>>> CGImageRef, converts that to an NSImage, and finally assigns that to the 
>>> Asset's atomic .thumb property.
>>> 
>>> The folder and name properties were generated by mogenerator, a tool for 
>>> creating document model classes for CoreData .xcdatamodeld files. The thumb 
>>> property is something I added manually to cache the thumbnail, and the 
>>> AssetItemView's NSImageView's Value binds to it as well.
>>> 
>>> So I'm not directly dealing with any NSManagedObjectContext here. That's 
>>> all taken care of when the items are added to it or when a document is 
>>> opened. All I'm doing is generating a preview for each managed object.
> 
> --
> Steve Mills
> Drummer, Mac geek
> 
> 
> ___
> 
> 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/dave.fernandes%40utoronto.ca
> 
> This email sent to dave.fernan...@utoronto.ca


___

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: CoreData headaches

2016-10-27 Thread Dave Fernandes
But what managed object are you dealing with? Is the Asset a managed object? If 
so, you can only access its properties from the queue of its managed object 
context. So if it is a main queue context, you can only access the MO’s 
properties from the main queue. If it is a private queue context, you use 
performBlock on the MO’s context to execute a block of code in the context’s 
queue and you must access the MO’s properties from inside that block. If I’m 
stating something you already know, forgive me. It is not clear from your post. 
Example code would help.

> On Oct 27, 2016, at 11:24 PM, Steve Mills  wrote:
> 
> On Oct 27, 2016, at 19:00:14, Dave Fernandes  
> wrote:
>> 
>> Are you accessing the properties from within a 
>> NSManagedObjectContext.performBlock block? Sounds like you may be accessing 
>> the managed objects from the wrong queue.
> 
> I'll explain what's going on. Each NSCollectionViewItem in the 
> NSCollectionView is being assigned its representedObject (the Asset, which is 
> a reference to an image file). At that point, I ask the Asset to 
> requestPreviewImageAtSize:, which creates an NSBlockOperation (and adds it to 
> an NSOperationQueue), whose block creates a CGImageSourceRef. Before it can 
> create the CGImageSourceRef, it needs to get the url. It does this by asking 
> for its .folder and .name properties. Those are nonatomic properties of the 
> Asset. Once it has the url and the CGImageSourceRef, it creates the 
> CGImageRef, converts that to an NSImage, and finally assigns that to the 
> Asset's atomic .thumb property.
> 
> The folder and name properties were generated by mogenerator, a tool for 
> creating document model classes for CoreData .xcdatamodeld files. The thumb 
> property is something I added manually to cache the thumbnail, and the 
> AssetItemView's NSImageView's Value binds to it as well.
> 
> So I'm not directly dealing with any NSManagedObjectContext here. That's all 
> taken care of when the items are added to it or when a document is opened. 
> All I'm doing is generating a preview for each managed object.
> 
> --
> Steve Mills
> Drummer, Mac geek


___

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: CoreData headaches

2016-10-27 Thread Dave Fernandes

> On Oct 27, 2016, at 5:24 PM, Steve Mills  wrote:
> 
> I have an app that uses CoreData to store document data, and an 
> IKImageBrowserView to display the items in the CoreData. Finding that 
> IKImageBrowserView is being deprecated, and since Xcode 8 causes a goofy 
> scrolling bug that the user can't work around, I decided to move away from 
> IKImageBrowserView and reimplement the display as an NSCollectionView. OK, 
> that works. In order to match the speed at which IKImageBrowserView builds 
> thumbnails in the background, I used an NSOperationQueue in which to load 
> each thumbnail via CGImageSourceCreateThumbnailAtIndex. This mostly works 
> fine, except I get random crashes when accessing properties of a 
> NSManagedObject (the image file's folder's url and image file's name). Any 
> suggestions for making this work correctly? I'm just hacking at it right now 
> by adding @synchronize() wrappers around code, but it's not helping.

Are you accessing the properties from within a 
NSManagedObjectContext.performBlock block? Sounds like you may be accessing the 
managed objects from the wrong queue.

> 
> Since CoreData and managed objects are full of so much voodoo (and because 
> it's been a long time since I originally wrote this app, so the CoreData 
> stuff is pretty fuzzy by now), I wonder if there isn't a better system I 
> could use to store document data. The app is an image organizer that can 
> store references to thousands of images and movies (not the actual images), 
> sort and filter them any number of ways (which is all handled by an 
> NSArrayController), and tag them with keywords (also NSManagedObject).
> 
> What does CoreData give me that I can't get by simply archiving an array of 
> NSDictionary? Well, aside from undo, writing only changed objects to the 
> file, and all the rest of the stuff it does.

I think you just answered your own question. The relationship management and 
delete rules are also helpful — there is less bookkeeping for you to do.

> 
> The previous version of the app used my own file format. I don't recall it 
> being particularly slow or featureless. Hmm.

If you aren’t dealing with large numbers of objects, then all the optimizations 
in Core Data may not be important to you.

> 
> --
> Steve Mills
> Drummer, Mac geek
> 
> 
> ___
> 
> 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/dave.fernandes%40utoronto.ca
> 
> This email sent to dave.fernan...@utoronto.ca


___

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 count Atoms

2016-10-07 Thread Dave Fernandes
> 
> In practice, you’d actually initialize the semaphore like this:
> 
>>  dsema = dispatch_semaphore_create (0); // start with a zero count
>>  dispatch_semaphore_signal (dsema); // increment to the number of 
>> resources in the pool.
> 
> That’s because if you create the semaphore with a non-zero count, then later 
> try to release the semaphore object when its count is something different 
> (which can happen if you have a more complex loop that you break out of), 
> your app will crash. The API design assumption is that if you didn’t free all 
> the original resources, your app has a bug (which I happen to think is bogus 
> reasoning, but anyway…).

Wow, I’ve never come across that issue. But I don’t see how incrementing it 
after creating it is any different from creating it with a non-zero count. 
Either way, if you have resources available, the count will be non-zero, and 
you will crash if you try to deallocate. But I’m somewhat sure I’ve never seen 
a crash like that. Maybe I was just lucky?
___

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

Subclassing and Archiving/Unarchiving

2016-09-25 Thread Dave
Hi All,

I have an App that produces Archives files that are loaded by another App. The 
Classes that get archived are in a set of common files that both Apps share. 

During the build process I need to carry extra information that only the writer 
app knows about. My first instinct was to create a subclasses in the writer App 
for each Class I need the “extra” information, but of course this won’t work 
because the App that loads the files won’t know about the subclasses.

I was thinking of putting a wrapper around these classes but it is quite ugly 
compared to subclassing. The other thing I could do is to builder a new base 
class from the subclass that mean a lot of  deep copying.

Is there any way that I can get the archiver to just select the Base Class and 
ignore the extra properties in the Subclass? Or is there a better way of doing 
this?

All the Best
Dave




___

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 Dave
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  wrote:
> 
> 
>> On Sep 22, 2016, at 5:20 AM, Dave > <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/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 Dave
Hi Jens,

There is definitely something fishy going on, I’ll explain the process and how 
I am handling it. There is probably a much better way of doing it and if so I’m 
happy to redesign it.

In order to kick off a Network an third part App needs to be run which starts 
up a process that “looks” for available networks. When it finds one it makes it 
available for my App.

My App needs to grab the state of a Network which is handling by a third party 
package. The only way in which to check if a network is available is to attempt 
to create a Network Object (e.g. myNetwork [[Network alloc] initWithX];). 
If it returns nil, then the Network was not available. So the only way to 
ensure a Network is available is to Poll it. 

My App does this:

User Clicks the  “Connect” button, this launches the Third Party App and then 
runs an AppleScript to tell it to start looking for Network.

The Button handler in my App then starts a timer that Polls the Network every 
0.10 seconds. The Timer handler basically does a Alloc/Init and if it gets nil 
restarts the timer to try again a bit later on. If it gets non nil, then it 
sends a “NetworkConnected” notification. 

The Button Handler then calls “waitForNetworkConnection” which checks if there 
is a valid Network stored in a “connectedNetworksDictionary which is a property 
of the WindowController.
If it is not in the dictionary it calls itself back after a delay. So the 
button handler will return, but the “waitForNetworkConnection” will be called 

The  “NetworkConnected” notification handler then the stores the Network in the 
“connectedNetworksDictionary” property.

Accesses to the “connectedNetworksDictionary” are protected in an @synchronised 
block.

I noticed that the UI stops responding while stepping through the following 
code.

//** THIS STATUS MESSAGE IS SEEN

myNetworkStatusString = [[NSString alloc] initWithFormat:@"Executing Script %@ 
for Target Network: 
%@",myNetworkleScriptFilePath,theNetworkConfigInfo.pNetworkConfigInternalID];
[self updateUIStatusWithInfoMessage:myNetworkStatusString];

myNetworkleScriptSourceString = [[NSString alloc] 
initWithContentsOfFile:myNetworkleScriptFilePath encoding:NSUTF8StringEncoding 
error:&myErrorInfo];
if (myErrorInfo != nil)
{
myNetworkStatusString = [[NSString alloc] initWithFormat:@"Script 
Compile Error %@ for Target Network: 
%@",myNetworkleScriptFilePath,theNetworkConfigInfo.pNetworkConfigInternalID];
[self updateUIStatusWithErrorMessage:myNetworkStatusString];
return NO;
}

myNetworkleScript = [[NSNetworkleScript alloc] 
initWithSource:myNetworkleScriptSourceString];
[myNetworkleScript executeAndReturnError:&myErrorDictionary];
if (myErrorDictionary != nil)
{
myNetworkStatusString = [[NSString alloc] initWithFormat:@"Script 
Execution Error %@ for Target Network: 
%@",myNetworkleScriptFilePath,theNetworkConfigInfo.pNetworkConfigInternalID];
[self updateUIStatusWithErrorMessage:myNetworkStatusString];
return NO;
}

//** UI STOPS UPDATING HERE

myNetworkStatusString = [[NSString alloc] initWithFormat:@"Script Complete %@ 
for Target Network: 
%@",myNetworkleScriptFilePath,theNetworkConfigInfo.pNetworkConfigInternalID];
[self updateUIStatusWithInfoMessage:myNetworkStatusString];

So I’m wondering if it is something to do with the AppleScript handling? The 
Script works ok if I run it from the Script Editor and it compiles and runs ok.

Any help on this would be greatly appreciated.

All the Best
Dave

> On 21 Sep 2016, at 17:20, Dave  wrote:
> 
> Hi,
> 
> This doesn’t work probably because the Class is that is calling back the 
> delegate method that updates the Scroll View is also being run on the main 
> thread. Sorry I should have said this earlier. I tried updating the UI on a 
> background thread and it seemed to work BUT I got warning message from 
> CALayer or maybe CATransaction and I think it caused the App to hang.
> 
> The time consuming method I am calling is in a third party library and it 
> must be called in the main thread. 
> 
> All the Best
> Dave
> 
>> On 21 Sep 2016, at 17:01, Sandor Szatmari  
>> wrote:
>> 
>> In general, one simple form is:
>> 
>> dispatch_async( dispatch_get_main_queue(), ^{
>> // do UI updates on the main thread.
>> });
>> 
>> This can also be done with NSOperationQueue:
>> 
>> [[NSOperationQueue mainQueue] addOperationWithBlock:^{
>> // do UI updates on main thread.
>> }];
>> 
>> Sandor Szatmari
>> 
>> On Sep 21, 2016, at 11:40, Dave > <mailto:d...@looktowindward.com>> wrote:
>> 
>>> Hi All,
>>> 
>>> How can I update my UI from a background thread?
>>> 
>>> I have a method that does a LOT of intense processi

Re: How to update UI from a background thread

2016-09-21 Thread Dave
Hi,

This doesn’t work probably because the Class is that is calling back the 
delegate method that updates the Scroll View is also being run on the main 
thread. Sorry I should have said this earlier. I tried updating the UI on a 
background thread and it seemed to work BUT I got warning message from CALayer 
or maybe CATransaction and I think it caused the App to hang.

The time consuming method I am calling is in a third party library and it must 
be called in the main thread. 

All the Best
Dave

> On 21 Sep 2016, at 17:01, Sandor Szatmari  
> wrote:
> 
> In general, one simple form is:
> 
> dispatch_async( dispatch_get_main_queue(), ^{
> // do UI updates on the main thread.
> });
> 
> This can also be done with NSOperationQueue:
> 
> [[NSOperationQueue mainQueue] addOperationWithBlock:^{
> // do UI updates on main thread.
> }];
> 
> Sandor Szatmari
> 
> On Sep 21, 2016, at 11:40, Dave  <mailto:d...@looktowindward.com>> wrote:
> 
>> Hi All,
>> 
>> How can I update my UI from a background thread?
>> 
>> I have a method that does a LOT of intense processing, it calls a delegate 
>> method in my Window Controller which appends it to a Logging Scroll View, 
>> however nothing shows up in the Scroll View although it NSLog’s the string 
>> ok.
>> 
>> Firstly is it ok to do this? When I tried it I got a CALayer error reported 
>> in the NSLog output.
>> 
>> All the Best
>> Dave
>> 
>> 
>> ___
>> 
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
>> <mailto: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 
>> <http://lists.apple.com/>
>> 
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/cocoa-dev/admin.szatmari.net%40gmail.com
>>  
>> <https://lists.apple.com/mailman/options/cocoa-dev/admin.szatmari.net%40gmail.com>
>> 
>> This email sent to admin.szatmari@gmail.com 
>> <mailto:admin.szatmari@gmail.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

How to update UI from a background thread

2016-09-21 Thread Dave
Hi All,

How can I update my UI from a background thread?

I have a method that does a LOT of intense processing, it calls a delegate 
method in my Window Controller which appends it to a Logging Scroll View, 
however nothing shows up in the Scroll View although it NSLog’s the string ok.

Firstly is it ok to do this? When I tried it I got a CALayer error reported in 
the NSLog output.

All the Best
Dave


___

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 Launch an App using the Bundle ID?

2016-09-21 Thread Dave
Hi,

Thanks a lot! I was surprised that NSWorkspace doesn’t include this seemingly 
useful method.

All the Best
Dave



> On 20 Sep 2016, at 16:16, Charles Srstka  wrote:
> 
>> On Sep 20, 2016, at 5:48 AM, Dave > <mailto:d...@looktowindward.com>> wrote:
>> 
>> Hi All,
>> 
>> 
>> I’m using launchApplication method from Shared Workspace, however, it accept 
>> an Application Name and all I have is the Bundle ID. How can I launch an App 
>> using the Bundle ID?
>> 
>> All the Best
>> Dave
> 
> Get the URL of the application by using -[NSWorkspace 
> URLForApplicationWithBundleIdentifier:], then launch the application by the 
> URL.
> 
> 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

How to Launch an App using the Bundle ID?

2016-09-20 Thread Dave
Hi All,


I’m using launchApplication method from Shared Workspace, however, it accept an 
Application Name and all I have is the Bundle ID. How can I launch an App using 
the Bundle ID?

All the Best
Dave




___

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: NSMenuItem’s userKeyEquivalent lost if changing title

2016-09-20 Thread Dave Lyons
(Ooh! I know that one!)

The custom shortcut for Finder's File > Compress menu item continues to work, 
because Finder goes slightly out if its way to achieve it.  The item's -title 
remains unchanged as ”Compress”, even when you see "Compress “foo”" or 
"Compress 42 Items” -- in that case, you're seeing the -attributedTitle.  
(Ditto for "Burn to Disc…” item.)

Small downside: If you look carefully while the menu item is disabled, it looks 
a bit different from other disabled menu items.

--Dave

> On Sep 19, 2016, at 10:59:32 PM, Allan Odgaard  
> wrote:
> 
> Some menu items use titles dynamically updated in validateMenuItem: (based on 
> application state, like if there are selected content).
> 
> This seems to be incompatible with System Preferences → Keyboard → Shortcuts 
> → App Shortcuts, as the menu item check for custom bindings using their 
> current title rather than original title.
> 
> I notice however that Finder is not affected by this. For example if I add a 
> custom shortcut for “Compress” then this it still work with selected content 
> (which updates the menu item’s title).
> 
> Anyone know how to go about handling dynamic menu item titles and still 
> support custom app shortcuts?
> ___
> 
> 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/dlyons%40apple.com
> 
> This email sent to dly...@apple.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: loadNibNamed deprecated, but newer version crashes

2016-09-19 Thread Dave
Yeah, you need to either assign the Array to a strong property OR you need to 
extract what you want from the Array and store those items as a strong property.

Cheers
Dave

> On 19 Sep 2016, at 11:19, Alastair Houghton  
> wrote:
> 
> On 19 Sep 2016, at 10:02, Gabriel Zachmann  wrote:
>> 
>> Thanks a lot for your response.
>> 
>> When I replace this line 
>>  [NSBundle loadNibNamed: @"ConfigureSheet" owner: self];
>> by this:
>>  NSBundle * bundle = [NSBundle bundleForClass:[self class]];
>>  [bundle loadNibNamed: @"ConfigureSheet" owner: self topLevelObjects: 
>> nil];
>> 
>> then System preferences crashes with this stack trace:
> 
> The problem is likely that you aren’t retaining all of the top level objects 
> in the nib file, and something you’re relying on is being disposed of.  The 
> simplest fix for older code that was using the original -loadNibNamed:owner: 
> method is often just to add an NSArray member variable to your class to hold 
> the top level object references.
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: Window Opened Notification?

2016-09-08 Thread dave
I think I’ve worked out how to do it without making it so buggy but it will 
take a lot of experimentation…...

> On 7 Sep 2016, at 10:41, dangerwillrobinsondan...@gmail.com wrote:
> 
> 
>> On Sep 7, 2016, at 6:09 PM, Dave  wrote:
>> 
>> I’m already using Accessibility but the notification I get when a window is 
>> created is posted to too late for it to help in this case.
>> 
>> I’m also using Event Taps, I want to be able to stop events being fired to 
>> the window until I have received and procesed the Window Created 
>> Accessibility Notification.
> 
> The only other thing I could think of you might do is intercept events that 
> heuristically might create a window. Let them through then stall other events 
> until that notification or the CGWindowList changed. 
> 
> This is going to be slow and probably buggy and definitely awkward for most 
> users. 
> 


___

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: Window Opened Notification?

2016-09-08 Thread dave

> On 6 Sep 2016, at 01:29, Andy Lee  wrote:
> 
> Dave, can you clarify whether you want is:
> 
> 1. a notification when the frontmost window changes, or
> 2. a notification when some application opens a new window?
> 
> If #1, observing these NSWorkspace properties looks like the way  to go.  If 
> #2, bear in mind that applications can open windows that don't become the 
> active window.  For example, it is possible to open links in emails, tweets, 
> etc., that cause the browser to open a new window in the background.  The 
> link might not open a new window at all, but rather a new tab in an existing 
> browser window.
> 
> I'm guessing you want #1, which is fortunately the easy (or easier) case. :)  
> Just checking.
> 

No, I’m after option 2! 

All the Best
Dave


___

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: Window Opened Notification?

2016-09-07 Thread Dave
Hi,

I’m already using Accessibility but the notification I get when a window is 
created is posted to too late for it to help in this case.

I’m also using Event Taps, I want to be able to stop events being fired to the 
window until I have received and procesed the Window Created Accessibility 
Notification.

Cheers
Dave

> On 6 Sep 2016, at 11:15, じょいすじょん  wrote:
> 
> 
>> On 2016 Sep 6, at 18:49, Dave > <mailto:d...@looktowindward.com>> wrote:
>> 
>>> 
>>> Ah. 
>>> Well in that case, you get accessibility and you need users to allow it 
>>> once. 
>> 
>> I said in my original post - without using Accessibility 
>> 
>> Cheers
>> Dave
> I know. I remember. 
> Point is, the AX API is your only realistic option to achieve this.
> What you never really said is what you are really trying to accomplish.
> With that, somebody might be able to point you to something useful.
> 
> You could try something with NSWorkspace & NSRunningApplication + CGWindowList
> 
> You could also try to hack together an NSEvent global event monitor or a 
> CGEventTap approach and try to intercept and guess at events.
> Pretty sure that would be very difficult with sandboxing.
> 
> Neither one would do quite what you would really like

___

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: Window Opened Notification?

2016-09-06 Thread Dave

> On 6 Sep 2016, at 10:37, dangerwillrobinsondan...@gmail.com wrote:
> 
> Ah. 
> Well in that case, you get accessibility and you need users to allow it once. 

I said in my original post - without using Accessibility 

Cheers
Dave

>> On Sep 6, 2016, at 5:49 PM, Dave  wrote:
>> 
>> Hi,
>> 
>>>> The two key properties in NSWorkspace
>> 
>> I saw these properties but I don’t think they will do what I want since 
>> frontmostApplication and menuBarOwningApplication refer to an Application 
>> not a Window within an Application.
>> 
>> For instance:
>> 
>> Launch Text Edit
>> Empty Window Opens- I want to catch this window open/create
>> User creates a New Window-I want to catch this window open/create
>> 
>> Cheers
>> Dave
>> 
>> 
>> ___
>> 
>> 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/dangerwillrobinsondanger%40gmail.com
>> 
>> This email sent to dangerwillrobinsondan...@gmail.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: Window Opened Notification?

2016-09-06 Thread Dave
Hi,

>> The two key properties in NSWorkspace

I saw these properties but I don’t think they will do what I want since 
frontmostApplication and menuBarOwningApplication refer to an Application not a 
Window within an Application.

For instance:

Launch Text Edit
Empty Window Opens  - I want to catch this window 
open/create
User creates a New Window   -I want to catch this window open/create

Cheers
Dave


___

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: Window Opened Notification?

2016-09-05 Thread Dave
> Would it be possible to observe which window becomes the front window and 
> then send a notification?
> 

That’s what I am trying to find out……

Cheers
Dave



___

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: Window Opened Notification?

2016-09-05 Thread Dave

> On 5 Sep 2016, at 18:27, dangerwillrobinsondan...@gmail.com wrote:
> 
> Not really. 
> You could use CGWindowList but you'll be polling. 

I was wondering if it would be possible to make the Window list Key-Value 
observable? 

I’m Trying to avoid running a timer and polling the Window list.

Cheers
Dave
> 
> 
> Sent from my iPhone
> 
>> On Sep 6, 2016, at 1:09 AM, Dave  wrote:
>> 
>> Hi All,
>> 
>> Is there any way other that using Accessibility that you can tell when a 
>> window is opened is any application? Something like a running app 
>> notification?
>> 
>> If it is not possible using Cocoa? Is there any way of doing this via the 
>> Window Server? 
>> 
>> All the Best
>> Dave
>> 
>> 
>> ___
>> 
>> 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/dangerwillrobinsondanger%40gmail.com
>> 
>> This email sent to dangerwillrobinsondan...@gmail.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

Window Opened Notification?

2016-09-05 Thread Dave
Hi All,

Is there any way other that using Accessibility that you can tell when a window 
is opened is any application? Something like a running app notification?

If it is not possible using Cocoa? Is there any way of doing this via the 
Window Server? 

All the Best
Dave


___

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: Does setFormatter() retain?

2016-09-02 Thread Dave

> On 29 Aug 2016, at 03:26, Andy Lee  wrote:
> 
> On Aug 24, 2016, at 4:25 PM, Jens Alfke  wrote:
>> 
>>> On Aug 24, 2016, at 1:04 PM, Andreas Falkenhahn  
>>> wrote:
>>> 
>>> Now, will "setFormatter" call retain on "formatter" or not? Looking
>>> at "retainCount" seems to suggest so, although I know that this
>>> isn't reliable and shouldn't be done at all...
>> 
>> These days, with ARC, we call those “strong references” vs. “weak” or 
>> “unretained” references.
> 
> It used to be that when someone mentioned looking at retainCount there would 
> a flurry of admonitions not to do that.  This thread doesn't feel complete 
> without such an admonition, so I'll refer you to this.
> 
> :)
> 
> <https://developer.apple.com/reference/objectivec/1418956-nsobject/1571952-retaincount>
>> Do not use this method.

On MMM Apps I look at retainCount all the time for debugging, it’s not that you 
shouldn't use it, its more you shouldn’t *rely* on it in active code. The value 
may not be what you expect in that it *might* greater, however if you know what 
your code is doing and you realise that the OS may change, or know that the 
object in question has no possibility of being referred to by the OS, it can be 
useful for debugging purposes.

 For instance on thing I’ve done in the past is to override the “retain” and 
“release”, etc. methods on certain objects and hold my own retain count as a 
separate property of the object, then if “retainCount” is not equal to the 
private retain count, you know the OS has retained it.

Cheers
Dave


___

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: Objective-C basics - (Why NSNumber conforms to NSCopying protocol)

2016-08-11 Thread Dave
Also, beware the “copy” attribute on properties, this *always* creates an 
immutable copy. If you want to copy a Mutable Object you need to explicitly 
call mutableCopy, e.g.

newObject.prop = [self.prop mutableCopy];

I mention this, because if you are writing copyWithZone methods then this will 
bite you!

You should also look at NSCoding, this is the mechanism used to archive and 
unarchive objects (e.g. create (functionally) Identical Copies), once you 
understand how this works, it should be obvious why copy and isEqual work the 
way they do.

All the Best
Dave



> On 11 Aug 2016, at 12:31, Sasikumar JP  wrote:
> 
> Quincey, David,
> 
> Thank you for the detailed explanation.
> 
> Regards
> Sasikumar JP
> 
> On 11 August 2016 at 12:34, Quincey Morris <
> quinceymor...@rivergatesoftware.com> wrote:
> 
>> On Aug 10, 2016, at 23:32 , Sasikumar JP  wrote:
>> 
>> 
>> what was the reason NSNumber conforms to NSCopying protocol.
>> 
>> 
>> 1. It actually inherits conformance from its superclass, NSValue.
>> 
>> 2. The fact than an object is immutable does not (in general) mean that a
>> copy can be represented by the same object reference. For example, an
>> object that contained its own date of creation might be immutable, but a
>> copy might have a different date, and therefore be a different object.
>> Putting this another way, the immutability does not make NSCopying
>> conformance irrelevant.
>> 
>> 3. NSNumber is one of a group of classes that represent “serializable”
>> objects (for property lists, for example). Since these are often arranged
>> in heterogenous hierarchies using arrays, sets and dictionaries, it’s
>> convenient that they share behavior. If all property list classes conform
>> to NSCopying, then property lists can be deep copied without special code.
>> 
>> 4. Objects used as NSDictionary keys must conform to NSCopying. It would
>> be a hardship if this excluded NSNumber.
>> 
>> So it turns out to be easier to have NSNumber conform to NSCopying, than
>> to avoid conformance.
>> 
>> 
> ___
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: Objective-C basics - (Why NSNumber conforms to NSCopying protocol)

2016-08-11 Thread Dave

> Hmm… I’m not so sure that this is *quite* right… what if I want a copy of the 
> original object, with the same creation date? Not doing so could lead to some 
> strange pitfalls, depending on what is then done with the alleged “copy”, and 
> how it reacts to other methods (like -hash and -isEqual, or any sort of 
> serialization methods it implements).

Well you have to write a copy method so you can do whatever you want either 
keep the same creation date or change it.


> "The exact meaning of “copy” can vary from class to class, but a copy must be 
> a functionally independent object with values ___identical___ to the original 
> at the time the copy was made.” (emphasis mine)

it’s up to you (or the class) to decide what a “copy” means, but the Cocoa 
classes that support copying define their own version of what a copy is.

Don’t forget there are two ways to test that two objects are “Equal”, 

object1 == object2  //Exactly the same object as so by 
definition Equal

[object1 isEqual:object2]   //Functionally Equal

So in the case of the creation date, isEqual would not check the date property 
in the comparison if it didn’t matter…..

> Which, IMHO, means that *all* the values stored in the object must be the 
> same.

All non-object values should be identical, objects should be *functionally* 
identical (and *you* define what functional means, if you need the same 
creation date in one class and a new one in another that’s ok, they function 
differently).

All the Best
Dave



> On 11 Aug 2016, at 09:50, Britt Durbrow 
>  wrote:
> 
> 
>> On Aug 11, 2016, at 12:04 AM, Quincey Morris 
>>  wrote:
>> 
>> 2. The fact than an object is immutable does not (in general) mean that a 
>> copy can be represented by the same object reference. For example, an object 
>> that contained its own date of creation might be immutable, but a copy might 
>> have a different date, and therefore be a different object. Putting this 
>> another way, the immutability does not make NSCopying conformance irrelevant.
> 
> Hmm… I’m not so sure that this is *quite* right… what if I want a copy of the 
> original object, with the same creation date? Not doing so could lead to some 
> strange pitfalls, depending on what is then done with the alleged “copy”, and 
> how it reacts to other methods (like -hash and -isEqual, or any sort of 
> serialization methods it implements).
> 
> From the documentation:
> 
> "The exact meaning of “copy” can vary from class to class, but a copy must be 
> a functionally independent object with values ___identical___ to the original 
> at the time the copy was made.” (emphasis mine)
> 
> Which, IMHO, means that *all* the values stored in the object must be the 
> same.
> 
> By extension; [anObject hash] and [[anObject copy] hash] must return the same 
> value; and [anObject isEqual:[anObject copy]] must return YES.
> 
> For the case of an immutable object, those conditions are indeed fulfilled by 
> simply returning self; because by definition an immutable object and a copy 
> of an immutable object at a different memory address would behave the same, 
> forever. Returning self is, in this case, just an implementation detail (an 
> optimization, specifically).
> 
> It is, however, perfectly valid (if not encouraged for performance and memory 
> use reasons) to actually create a new object, with all the same values as the 
> original.
> 
> 
> At a higher level, instead of having -copy return an object that was *almost* 
> a copy; I think I would (if possible) refactor the problem to put that 
> information somewhere else… or better yet, don’t do that at all (and given 
> that copies come and go; I don’t think that non-invariant metadata like that 
> is going to do what is usually desired, in the broader sense of solving the 
> problem at hand; whatever problem it may be).
> ___
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: Keyboard/Mouse Event Interaction

2016-07-18 Thread Dave
Yes, I guess because in this case then is the possibility of the Mouse/Finger 
moving outside the Control between the Down and Up events…...

> On 18 Jul 2016, at 14:05, dangerwillrobinsondan...@gmail.com wrote:
> 
> To be fair, iOS and mouse events tend to finish on the concept of up. 
> (Though often it's up & inside to trigger some action)
> 
> Sent from my iPhone
> 
>> On Jul 18, 2016, at 10:00 PM, Steve Mills > <mailto:sjmi...@mac.com>> wrote:
>> 
>>> On Jul 18, 2016, at 07:52:02, Dave  wrote:
>>> 
>>> Hi,
>>> 
>>> Thanks, I’m looking at it now.
>>> 
>>> I’m a bit confused over the keyboard handling. I would have thought that 
>>> the processing would take place on the KeyUp event, but it seems like its 
>>> occurring on the KeyDown event which is where I am going wrong. 
>>> 
>>> I’m not sure what use NSKeyUp is in this case? The other thing is that a 
>>> KeyDown with the AutoRepeat flag == YES seems to imply a an NSKeyUp? IOW, 
>>> the events I see are:
>>> 
>>> NSKeyDownRepeat == NO
>>> NSKeyDownRepeat == YES) If the Key is held down…..
>>> NSKeyDownRepeat == YES)
>>> NSKeyDownRepeat == YES)
>>> NSKeyDownRepeat == YES)
>>> NSKeyUpRepeat == NO
>> 
>> Nope, as you discovered, KeyDown is where the action usually happens for 
>> most things, because if it waited for KeyUp, then all the KeyRepeats that 
>> came after the KeyDown would be missed, and you don't want to queue them all 
>> up and release them on KeyUp. Just think of how it works when you're in a 
>> text editor and hold down a key (just make sure you have that stupid system 
>> pref set to NOT show the silly alt key popup thing, but work like a real key 
>> repeat should).
>> 
>> --
>> Steve Mills
>> Drummer, Mac geek
>> 
>> 
>> ___
>> 
>> 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/dangerwillrobinsondanger%40gmail.com
>>  
>> <https://lists.apple.com/mailman/options/cocoa-dev/dangerwillrobinsondanger%40gmail.com>
>> 
>> This email sent to dangerwillrobinsondan...@gmail.com 
>> <mailto:dangerwillrobinsondan...@gmail.com>
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com 
> <mailto: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 
> <http://lists.apple.com/>
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/dave%40looktowindward.com 
> <https://lists.apple.com/mailman/options/cocoa-dev/dave%40looktowindward.com>
> 
> This email sent to d...@looktowindward.com <mailto:d...@looktowindward.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: Keyboard/Mouse Event Interaction

2016-07-18 Thread Dave
Hi,

Thanks, I’m looking at it now.

I’m a bit confused over the keyboard handling. I would have thought that the 
processing would take place on the KeyUp event, but it seems like its occurring 
on the KeyDown event which is where I am going wrong. 

I’m not sure what use NSKeyUp is in this case? The other thing is that a 
KeyDown with the AutoRepeat flag == YES seems to imply a an NSKeyUp? IOW, the 
events I see are:

NSKeyDown   Repeat == NO
NSKeyDown   Repeat == YES   ) If the Key is held down…..
NSKeyDown   Repeat == YES   )
NSKeyDown   Repeat == YES   )
NSKeyDown   Repeat == YES   )
NSKeyUp Repeat == NO

All the Best
Dave
  

> On 18 Jul 2016, at 13:05, dangerwillrobinsondan...@gmail.com wrote:
> 
> You might review the Event programming guide (especially the part about short 
> circuiting) and the responder chain. 
> That will pull this together in some detail. 
> 
> Sent from my iPhone
> 
>> On Jul 18, 2016, at 7:57 PM, Dave  wrote:
>> 
>> Hi Alastair,
>> 
>> Thanks a lot for this - it makes my life harder but at least I know how it 
>> works now.
>> 
>> All the Best
>> Dave
>> 
>>> On 17 Jul 2016, at 21:03, Alastair Houghton  
>>> wrote:
>>> 
>>> On 17 Jul 2016, at 14:06, Dave  wrote:
>>>> 
>>>> My question is, do the keyboard and Mouse Down Events come in pairs, so 
>>>> that the following would/should not occur:
>>> 
>>> No.  KeyDown happens when the key goes down, KeyUp happens when they key 
>>> comes back up.  Likewise with MouseDown and MouseUp, and they can happen in 
>>> any order relative to one another (or relative to another KeyDown/Up or 
>>> MouseDown/Up).
>>> 
>>>> Thanks a lot for any info on this. From looking at it, I think that the 
>>>> MouseDown/Up and KeyboardDown/Up must come if pairs with no events to the 
>>>> other device(s) in between, but it would be nice to know for sure!
>>> 
>>> The reason you see this kind of behaviour sometimes is that *some* views 
>>> process events in a loop in their -mouseDown: handler.  See this blog post 
>>> I wrote in 2007 about event handling, which shows two different ways of 
>>> handling -mouseDown: and talks a bit about eating keypresses during 
>>> processing.
>>> 
>>> https://alastairs-place.net/blog/2007/11/19/commands-and-mo/
>>> 
>>> 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/dangerwillrobinsondanger%40gmail.com
>> 
>> This email sent to dangerwillrobinsondan...@gmail.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: Keyboard/Mouse Event Interaction

2016-07-18 Thread Dave
Hi Alastair,

Thanks a lot for this - it makes my life harder but at least I know how it 
works now.

All the Best
Dave

> On 17 Jul 2016, at 21:03, Alastair Houghton  
> wrote:
> 
> On 17 Jul 2016, at 14:06, Dave  wrote:
>> 
>> My question is, do the keyboard and Mouse Down Events come in pairs, so that 
>> the following would/should not occur:
> 
> No.  KeyDown happens when the key goes down, KeyUp happens when they key 
> comes back up.  Likewise with MouseDown and MouseUp, and they can happen in 
> any order relative to one another (or relative to another KeyDown/Up or 
> MouseDown/Up).
> 
>> Thanks a lot for any info on this. From looking at it, I think that the 
>> MouseDown/Up and KeyboardDown/Up must come if pairs with no events to the 
>> other device(s) in between, but it would be nice to know for sure!
> 
> The reason you see this kind of behaviour sometimes is that *some* views 
> process events in a loop in their -mouseDown: handler.  See this blog post I 
> wrote in 2007 about event handling, which shows two different ways of 
> handling -mouseDown: and talks a bit about eating keypresses during 
> processing.
> 
>  https://alastairs-place.net/blog/2007/11/19/commands-and-mo/
> 
> 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

Keyboard/Mouse Event Interaction

2016-07-17 Thread Dave
Hi Dave,

I’ve noticed the following behaviour:

In  an XCode Text Window (or any text editor type App), do this:

Click and Hold the Left Mouse Button
Type a character on the keyboard(Nothing happens)
Release the Mouse   (The Character 
appears)

or

Hold down a key on the keyboard so the character is repeating in the text 
window.
Click and Hold the Left Mouse Button(The Characters stops repeating 
in the window)
Release the Mouse   (Many 
Characters appear in the window)

My question is, do the keyboard and Mouse Down Events come in pairs, so that 
the following would/should not occur:

KeyDown Event
MouseDown Event 
KeyUp Event
MouseUp Event

MouseDown
KeyDown
KeyUp
MouseUp

Thanks a lot for any info on this. From looking at it, I think that the 
MouseDown/Up and KeyboardDown/Up must come if pairs with no events to the other 
device(s) in between, but it would be nice to know for sure!

All the Best
Dave




___

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

Apple Developer Reference Library Safari Plugin

2016-07-01 Thread Dave
I posed this a while back and got no response, does anyone know where I can get 
this Safari Plug In from? 

I know its been on this list before but I can’t seem to find the right search 
term for it?

Thanks a lor
Dave

Hi All,

I know this has come up before but after 20 mins of searching I’ve not managed 
to find it.

There is a Safari Plugin that add Apple Developer Reference Library support. I 
used to have this installed but I had to reinstall and I must have forgotten to 
copy it. If anyone could point me to the URL for this I’d be really grateful.

All the Best
Dave



___

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

How to Handle Array of Dictionaries when Archiving/Unarchiving?

2016-06-23 Thread Dave
Hi,

I have an Object that I Archive and Unarchive, e.g it conforms to the NSCopying 
and NSCoding Protocols. The Object in question contains NSArray and 
NSDictionary Object and I handle them like this:

initWithCoder:

myDictionary = [theCoder decodeObjectForKey:@"pLookUpDictionary "];
self.pLookUpDictionary = [[NSMutableDictionary alloc] 
initWithDictionary:myDictionary copyItems:NO];


encodeWithCoder:

[theCoder encodeBool: self.pLookUpDictionary forKey:@"pLookUpDictionary”];


copyWithZone:

myDictionaryCopy = [self.pLookUpDictionary mutableCopy];
myObjectCopy.pLookUpDictionary = myDictionaryCopy;


I now need to add another archivable property as so:

@property (nonatomic,strong)
NSMutableDictionary*>*
pLookUpDictionaryArray;

How do I handle this in the above three methods? Specially do I need to walk 
the Array and do a mutableCopy on each of the Dictionaries in the Array?

All the Best
Dave


___

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

CGWindowList Documentation bug?

2016-06-13 Thread Dave
Hi All,

I got this from CGWindow Reference manual:

Window List Option Constants
Specifies which windows in the current user session to include in a generated 
list.

enum
{
   
kCGWindowListOptionAll
 = 0,
   
kCGWindowListOptionOnScreenOnly
= (1 << 0),
   
kCGWindowListOptionOnScreenAboveWindow
 = (1 << 1),
   
kCGWindowListOptionOnScreenBelowWindow
 = (1 << 2),
   
kCGWindowListOptionIncludingWindow
 = (1 << 3),
   
kCGWindowListExcludeDesktopElements
= (1 << 4)
}

Constants
kCGWindowListOptionAll
List all windows, including both onscreen and offscreen windows. When 
retrieving a list with this option, the relativeToWindow parameter should be 
set to kCGNullWindowID.
kCGWindowListOptionOnScreenOnly
List all windows that are currently onscreen. Windows are returned in order 
from front to back. When retrieving a list with this option, the 
relativeToWindow parameter should be set to kCGNullWindowID.
kCGWindowListOptionOnScreenAboveWindow
List all windows that are currently onscreen and in front of the window 
specified in the relativeToWindow parameter. Windows are returned in order from 
front to back. 
kCGWindowListOptionOnScreenBelowWindow
List all windows that are currently onscreen and in behind the window specified 
in the relativeToWindow parameter. Windows are returned in order from front to 
back. 
kCGWindowListOptionIncludingWindow
Include the specified window (from the relativeToWindow parameter) in the 
returned list. You must combine this option with the 
kCGWindowListOptionOnScreenAboveWindow or 
kCGWindowListOptionOnScreenBelowWindow option to retrieve meaningful results. 
kCGWindowListExcludeDesktopElements
Exclude any windows from the list that are elements of the desktop, including 
the background picture and desktop icons. You may combine this option with the 
other options. 
Discussion
The kCGWindowListOptionIncludingWindow and kCGWindowListExcludeDesktopElements 
constants may be combined with the other constants by adding (or ORing) them 
together and passing the resulting value to the appropriate function.
These constants let you retrieve windows in the current user session only. You 
cannot use them to retrieve windows from other active user sessions running on 
the system. 

Note this:

kCGWindowListOptionIncludingWindow
Include the specified window (from the relativeToWindow parameter) in the 
returned list. You must combine this option with the 
kCGWindowListOptionOnScreenAboveWindow or 
kCGWindowListOptionOnScreenBelowWindow option to retrieve meaningful results. 

Reading the above led me to believe that I had to specify 
kCGWindowListOptionOnScreenAboveWindow or 
kCGWindowListOptionOnScreenBelowWindow in order to retrieve the *one* window I 
was interested in. From experimenting it seems that THIS IS NOT THE CASE, as:

myWindowListOptions = kCGWindowListExcludeDesktopElements | 
kCGWindowListOptionIncludingWindow;
myWindowArray = (NSArray*) 
CFBridgingRelease(CGWindowListCopyWindowInfo(myWindowListOptions,theWindowID));
myWindowInfoDictionary = [myWindowArray lastObject];

Returns the *ONE* info dictionary for the *ONE* window specified by 
“theWindowID”. 

I’ve tested this and it works on 10.10.5 and 10.11 and it works ok. Is this a 
Bug in the documentation? I’m wondering if I should rely on this, if not I’m at 
a loss how to retrieve the Info for the one window I want? When I include the 
Above or Below option, it returns a while load of window info dictionaries I 
don’t care about and this is enough to slow it down so as to cause a 
“juddering” effect.

Any suggestions or help on the would be greatly appreciated.

All the Best
Dave




















___

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 get Window Info Dict for just one Window?

2016-06-10 Thread Dave
More experimenting:

if I use

myWindowListOptions = kCGWindowListExcludeDesktopElements | 
kCGWindowListOptionIncludingWindow;
myWindowArray = (NSArray*) 
CFBridgingRelease(CGWindowListCopyWindowInfo(myWindowListOptions,theWindowID));

it seems a bit better, but I’m not sure if it is valid or not?

Cheers
Dave

> On 10 Jun 2016, at 16:15, Dave  wrote:
> 
> Hi,
> 
> If I do this:
> 
> myWindowListOptions = kCGWindowListExcludeDesktopElements | 
> kCGWindowListOptionOnScreenAboveWindow | kCGWindowListOptionIncludingWindow | 
> kCGWindowListOptionIncludingWindow;
> myWindowArray = (NSArray*) 
> CFBridgingRelease(CGWindowListCopyWindowInfo(myWindowListOptions,theWindowID));
> 
> Then this works ok, but slows down a LOT when the Window is over a “Crowed” 
> area of the Screen(s). Is there no way to get JUST the Window I am interested 
> in, e.g. the one Specified by theWindowID (which is obtained from the Info 
> Dictionary ONCE via the kCGWindowNumber key).
> 
> I cannot believe that there isn’t a function to do this simple thing?
> 
> Cheers
> Dave
> 
> 
> ___
> 
> 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/dave%40looktowindward.com
> 
> This email sent to d...@looktowindward.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: How to get Window Info Dict for just one Window?

2016-06-10 Thread Dave
Hi,

If I do this:

myWindowListOptions = kCGWindowListExcludeDesktopElements | 
kCGWindowListOptionOnScreenAboveWindow | kCGWindowListOptionIncludingWindow | 
kCGWindowListOptionIncludingWindow;
myWindowArray = (NSArray*) 
CFBridgingRelease(CGWindowListCopyWindowInfo(myWindowListOptions,theWindowID));

Then this works ok, but slows down a LOT when the Window is over a “Crowed” 
area of the Screen(s). Is there no way to get JUST the Window I am interested 
in, e.g. the one Specified by theWindowID (which is obtained from the Info 
Dictionary ONCE via the kCGWindowNumber key).

I cannot believe that there isn’t a function to do this simple thing?

Cheers
Dave


___

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

How to get Window Info Dict for just one Window?

2016-06-10 Thread Dave
Hi All,

I’m using:

myWindowArray = (NSArray*) 
CFBridgingRelease(CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly,kCGNullWindowID));

To get an Array Containing the Info Dictionaries for all Visible Window, this 
works great, however I think find the Window I am interested in I save it, and 
sometime later I want to retrieve the Info Dictionary for just this one window 
rather than looping through the Array each time.

Is there a function I can use that will just return the Info Dictionary of the 
Window referenced by kCGWindowNumber or some other data in the Info dictionary?

All the Best
Dave
 
___

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   5   6   7   8   9   10   >