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 
> <cocoa-dev@lists.apple.com> 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 <NSApplicationDelegate>
> 
>    @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

Reply via email to