I'm going to edit my question.
When I want to developer in C++, I go to:
Xcode => New Project => macOS => Command Line Tools => File C++.
When I edit the main.cpp, the content is to defect (with int main(int argc, const char * argv[])....//More code..).
I create a new templates here (To right of Command Line Tools):
enter image description here
Then, I need to create a new project here:
Library/Developer/Xcode/Templates/Project_Templates/name_group = Applications(for_example)/nametemplate.xctemplate /
Here there are several files:
-main.cpp (my template basic c++)
-TemplateIcon.icns (icon of 128 px)
-TemplateInfo.plist : file configured
But this file I don´t know how modify :(
I´ve tryied to put file templateInfo.plist of this directory: Applications/Xcode.app/Content Packets/Contents/Developer/Library/Xcode/Templates / File Templates / C++....
But Xcode don´t recognize, I know that problem is in TemplateInfo.plist but I don´t know how I can modify :(
Now, Do I explained me better?
Thank you!!
Related
Can anyone please help with the following?
I have a trivial Xamarin forms app working and I want to add an OpenTK view.
The following works fine:
In my MainPage.xaml.cs I have the following event handler for a button which spawns an empty OpenTK view on each click:
private void OnXAMLButtonClicked(object sender, EventArgs e)
{
var view = new OpenGLView { HasRenderLoop = true };
view.HeightRequest = 300;
view.WidthRequest = 300;
view.OnDisplay = r =>
{
//GL.ClearColor(red, green, blue, 1.0f);
};
m_SL.Children.Add(view);
}
(where m_SL is the name of my StackLayout).
I get a new black window on each click. Great.
Now, see that commented-out line, that's because the value GL is undefined.
This code is from the simple example here:
https://learn.microsoft.com/en-us/dotnet/api/xamarin.forms.openglview?view=xamarin-forms
I see at the top of that example there is the following:
using OpenTK.Graphics.ES30;
But I cannot include this, OpenTK is not recognized as a namespace. I expected to have to add it as a reference, but how?
I can add a reference to it in my .Android project so that I can add the above using statement in my MainActivity.cs page but that is not where it belongs (although I see that I then have GL defined, so this proves that I need to add these using statements to my MainPage.xaml.cs in order to get GL defined), but like I say, how do I add the reference to OpenTK for the project that contains MainPage.xaml.cs.
Thanks for any help,
Mitch.
----- EDIT -----
Thanks to the poster for helping me so far, the new problem is a reference to System.Private.Core that cannot be resolved. Here's the my full workflow for creating this error:
1: Create a new project.
This gives me the three projects:
2: Change to .NET standard 2.1 in the OGLMobile project:
The .Android and .iOS projects don't have a .NET choice option.
3: Add reference to OpenTK to OGLMobile project:
4: OGLMobile project builds fine but .Android project gives:
If I remove reference to OpenTK everything builds again. Makes no difference if I add OpenTK Nuget package to .Android project, I still get the same error.
So close,
thanks for any advice.
You need to install Nuget Package OpenTK.Graphics, then can use that.
Now can refer it:
Note: 4.0.1 of OpenTK.Graphics need .NET Standard 2.1.
Hello I'm new to programming in Objective-C. I'm reading the book "Programing in Objective-C Developers Library" and they're asking me to create a command line project using the foundation framework, but when I go to create one, I don't see an option to use Foundation.
Your first screen shot shows it:
You've already selected Command Line Tool, which is correct. So now click Next and you will be creating a command line tool that uses the Foundation framework. In your second screen shot, enter a name for the tool and click Next; you will then be asked for a place to Save this project. Do so. When you do, the code for main.m will say:
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
#autoreleasepool {
// insert code here...
NSLog(#"Hello, World!");
}
return 0;
}
See that first line? That is "using the Foundation framework".
One thing to know is that Foundation is so important in Objective-C that it's practically part of the language. It provides classes like NSNumber, NSString, NSArray, NSDictionary, and many others that we assume are always available. So Foundation is special in that every Objective-C project will use it, and it'll be included in any project templates like the Command Line Tool template you're working from. Other project templates will include additional frameworks (e.g. the Cocoa App template will set up your project with AppKit for you), and if you want to use other frameworks you'll add them yourself after you create the project.
I just installed SharpDX 2.5.0 into Visual Studio, and now there is one really curios and unexpected errror:
I wanted to start with Atari's 'Pong', so i drew a .bmp file with a ball, convertet it into a .dds file with
Easy2Convert BMP to DDS
added it to the Content, and tried to load it. So i added this line
ballTexture = Content.Load("Ball");
but it failed with the message AssetNotFoundException, the same with
ballTexture = Content.Load("Ball.dds");
and there are hardly no tutorials to find, neither did i find an useful answer...
Thats the full path to this picture:
H:\Programmieren\Pong\Pong\Content\Ball.dds
Looking forward to your answers, and please excuse my knowlegde, I was used to XNA, and it was much more easier...
In SharpDX.Toolkit content is loaded from a folder relative to the folder where your program is located. Also you should mark the texture with build action ToolkitTexture (open file properties in Visual Studio).
After build, the file should be copied to a path like this:
H:\Programmieren\Pong\Pong\bin\Debug\Content\Ball.tkb`
(the extension may be different - I don't remember exactly).
After this, you can load the asset by calling ballTexture = Content.Load(#"Content\Ball");
Alternatively, you can set the root path for content manager during initialization:
Content.RootDirectory = "Content";
...
//and load the textures with
ballTexture = Content.Load(#"Ball");
All this is demonstrated in SharpDX Toolkit samples (located in Samples\SharpDXToolkitSamples.sln).
can someone tell me how to convert code templates from xcode3 to xcode4?
I am reading article at http://iphonedevelopment.blogspot.com/2009/04/opengl-es-from-ground-up-part-2-look-at.html and author offers his OpenGLES code template, but I can't get it working in new xcode4, seems it have different format. Any suggestions?
Thanks in advance :)
I had the same problem, here is a list of the changes you need to do to make your xcode 3 templates works with xcode 4 :
First you have to move your templates to a new directory :
/YourUserDirectory/Library/Developer/Xcode/Templates/File Templates
(previously it was /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/File Templates)
Then you need to :
rename your templates from "*.pbfiletemplate" to ".xctemplate"
rename class.h into ___FILEBASENAME___.h (the class.m can stay unchanged)
inside all of your files change «FILEBASENAMEASIDENTIFIER» into ___FILEBASENAMEASIDENTIFIER___
Additonaly all the key words like «FILENAME», «PROJECTNAME», need to be replaced by ___FILENAME___, ___PROJECTNAME___, etc
«OPTIONALHEADERIMPORTLINE» needs to be replaced by #import "___FILEBASENAME___.h"
Hope this helps,
Vincent
Until XCode 4 is finalised, there's probably not much point in this. However, you can side by side install XCode 3 and 4 and the XCode project format is compatible between them. Hence, I'd just install the template in XCode 3, create your new project(s), then open the results in XCode 4.
How would I change the initial templates created by Xcode when creating a new Cocoa Class.
I am referring to the comments and class name created when using Xcode's new class wizard.
You wouldn't change the existing templates. In other words, don't modify anything under the /Developer hierarchy (or wherever you installed your developer tools).
Instead, clone the templates you want to have customized variants of. Then change their names and the information in them. Finally, put them in the appropriate location in your account's Library/Application Support folder, specifically:
File templates: ~/Library/Application Support/Developer/Shared/Xcode/File Templates/
Target templates: ~/Library/Application Support/Developer/Shared/Xcode/Target Templates/
Project templates: ~/Library/Application Support/Developer/Shared/Xcode/Project Templates/
That way they won't be overwritten when you install new developer tools, and you can tweak them to your heart's content.
Update
For newer versions of Xcode the updated path will be:
~/Library/Developer/Xcode/Templates/File Templates/Source
This may be useful for somebody:
As for XCode 6 to XCode 9 the file templates are in:
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/Source
Update:
As #carbo18 noted, it's proably better to create the directory ~/Library/Developer/Xcode/Templates/File Templates/Source and put your custom templates there. The best way may be to use as base one of the ones in /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/Source
Xcode uses template files for file and project templates and does variable expansion in both at creation time.
Xcode 3.0 templates can be found in [Dev Installation]/Library/Xcode/, likely /Developer/Library/Xcode. If you want to modify these templates or add your own, use the following directories to save your new/modified templates so that they are not wiped out by future Developer Tool upgrades:
File templates:
~/Library/Developer/Shared/Xcode/File
Templates/
Target templates:
~/Library/Developer/Shared/Xcode/Target
Templates/
Project templates:
~/Library/Developer/Shared/Xcode/Project
Templates/
I think that you can also use the /Library/Developer/Shared/Xcode/[File|Target|Project] Templates/ directory for templates shared by all users.
If you just want to change the MyCompanyName in the templates, the following command line will do the trick:
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ "ORGANIZATIONNAME" = "NewCompanyName";}'
A good tutorial on writing file templates is here [MacResearch.org].
In Xcode 4 and Xcode 5 the user file templates can be placed at:
~/Library/Developer/Xcode/Templates/[Category]
[Category] can be used to categorize your templates (choose a name of your choise)
If the folder doesn't exist already, create it!
As of Xcode 7
File templates: ~/Library/Developer/Xcode/Templates/File Templates
Project templates: ~/Library/Developer/Xcode/Templates/Project Templates
For example if I place a Empty Application.xctemplate in ~/Library/Developer/Xcode/Templates/Project Templates/Application
It will appear in the template dialog as
In xcode 5.0.1:
1.Go->Applications
2.right click "xcode" application
3.chose "Show Package Contents"
4.contents/Developer/Library/Xcode/Templates
If you are simply looking to change the Author Name and Organization see this answer.
It's much easier than modifying the templates.
For Xcode 4.4, none of the previously mentioned methods work. This gist provides a partial hacky solution. Please fork and enhance if you know a better way.
Right click on xCode and select Show Package contents, then go to contents/Developer/Library/Xcode/Templates. Here you can find the templates for all programming languages.
Here some visualization:
In XCode 4.5 right click on project, click Show File Inspector, then change Organization name in the file inspector's second tab (Project Document group)