Upgrading interface builder document? - xcode

After opening an old iOS 6 App Xcode asked me if I wanted to upgrade my IB doc to version 5.0 or skip. I hit skip so I could learn about what it would do first.
Now I'm unable to find a way to re-upgrade the document?

After a little looking around it's located in the file inspector under Interface Builder Document.
You simply change the "Opens in - Xcode 4.6" to "Default (5.0)" and it upgrades your IB doc

Related

MVVMCross Problem with adding new ContentPage

Could you tell me what I am doing wrong? I've downloaded and installed extension MVVMCross available on https://www.mvvmcross.com/. I've installed it using Tools/Extensions and Updates in VisualStudio 2017 environment. When I created new MVVMCross Multi-Page Xamarin Forms Application then for two existing pages, all works perfectly.
I next needed to add ContentPage, but I have a problem since my new Xamarin Forms ContentPage is not correct: file *.cs is visible in my solution but *.xaml is hidden.
The version of MVVMCross and MVVMCross.binding (core, forms, platform) are 5.2.1 and Xamarin.Forms is 2.3.4.270 and Xamarin.Essentials is 1.5.2.
Could anyone explain to me why I can't add a new page? Thank you in advance.
All steps attached as screens...
Yes Lucas Zhang - MSFT, you may be right. It looks like a problem with version of Xamarin.Forms or MVVMCross. I'm not sure what more? I had version 15.7.xx of VS2017. After creating new MVVMCross Multi-Page Xamarin.Forms application I have versions: MVVMCross (all libraries) 5.2.1, Xamarin.Forms 2.3.4.270. Then I've not got any errors but I couldn't add new ContentPage.
Below all my steps which I made myself to resolve this problem:
I've installed VS2019 too, but it has not resolved the problem.
I've updated Xamarin.Forms to the latest stable version 4.6.0.726 but I had on both version of VS the same problem after updating:
Error NETSDK1022 Duplicate 'EmbeddedResource' items were included. The .NET SDK includes 'EmbeddedResource' items from your project directory by default.
I've read the article on Stack Overflow about this but I couldn't fix the problem.
But then it was possible to add correct new ContentPage.
In my opinion, the best solution is to update Xamarin.Forms and fix the problem with Duplicate Resource. If you know what to do for this, tell me please.
Finally, I've back to my old version of VS2017 and I've updated it to the latest version 15.9.22. Now, I can create ContentPage and application works but from my point of view doesn't work perfectly. I can add picture to this comment but in my Solution after adding new Page I have two separate files in Page folder: *xaml, *.cs. They don't have connection like other pages (like on the screen below). But it works.
I think if I update Xamarin.Forms and I fix Duplicate Resource problem, It will work perfectly.
I had a lot of problem after updating Xamarin.Forms therefore I've returned and I've installed update of VS2017.
It would be perfect to describe how we can fix similar problems :-)

Xcode 8.3: how to install multiple custom "Project Templates" in Xcode 8.3?

I am trying to install two custom "project templates" in Xcode 8.3.3.
To be more specific, I'm trying to install Cocos2D-obj templates for v2.1 and v2.2. (Cocos2D v3 or higher no longer use Xcode templates, but v2.x does.)
During the installation, each Cocos2D v2.1 and v2.2 creates its own Xcode template folders and those folders are simply copied into the Xcode's custom template folder:
~User/Library/Developer/Xcode/Templates/cocos2d v2.2
~User/Library/Developer/Xcode/Templates/cocos2d v2.1
I was hoping to see that there are two separated templates (cocos2d v2.2 and cocos2d v2.1) available in the template menu when a new Xcode project is being created. However only one (either v2.2 or v2.1) appears in the template menu. (Interesting thing is that the last modified one appears.)
Basically it seems like Xcode doesn't allow to have more than one custom template in its menu.
(However, "File template" menu shows both v2.2 and v2.1 "file template" correctly in Xcode, so only the project template doesn't.)
As far as I know this is something related to Xcode's custom template related behavior, but I cannot find any official document regarding custom template from Apple's document depository.
So the question is, how can I have two custom project templates (v2.1 & v2.2) appear in the template menu when new project is being created?
Any good answers or helpful comments are appreciated.
Thanks in advance.
Finally I have figured it out how it goes.
When it comes to "project template", Xcode looks like tracing the "identifier string" in the plist files of each templates. And when there are more than one template files exist under the same "identifier string", it chooses only one template randomly(?) among them and shows that in its template menu when an new project is being created.
After manually modifying those identifier strings from the templates (in v2.1) not to have same ones against templates in other package (v2.2), Xcode brings them all in its template menu correctly. So I manually modified all cocos2d-v2.1 templates not to have same identifier strings against v2.2. Also, it is worth to be noted that some templates have "ancestors" in its fields such that those ancestors are also needed to be updated accordingly when the entire template package is modified for this reason. I wish I could see any official documents from Apple regarding how to handle Xcode's templates, (for the latest version of Xcode).

Xcode 5 Link Document Type

Am following tutorial at
http://www.raywenderlich.com/1980/email-tutorial-for-ios-how-to-import-and-export-app-data-via-email-in-your-ios-app
To link a document type to my application so that my application is responsible for opening up of that document.
XCode 5 works very different... Under your Target, Info tab is a "Document Types" line... am not sure how to use this, is there a sample for me?
Thanks
I'm sure you've either figured this out or moved on, but a little tip for most of these tutorials: you can often download the completed code from the website. I did so, and loaded it up in Xcode 5.0, and it works fine. Here's a screenshot of the plist entries (that's under Resources/ScaryBugs-Info.plist) for Document and Export:
Another way to change the Document types in Xcode is via the Project Info (select the project in the Navigator, then the target in the projects and targets list, then the info tab). Here's a screenshot of what that stuff looked like for me:
Here's another very helpful link straight from apple support. Watch the screenshot they have under Example and literally replicate everything from this screenshot and just change their custom extension from catinfo to pdf, ttf, xml or whatever you like
NOTE: Make sure you test this on actual iphone / ipad and not on simulator.
https://developer.apple.com/library/ios/qa/qa1587/_index.html

Creating MonoTouch Custom Cells using XCode 4 does not work

I was used to creating Custom Cells in MonoTouch using Interface Builder but ever since XCode 4 has this integrated I can't seem to get it to work.
Is this a know issue?
Does anyone know of an article that describes how to go about this? I have plenty of books and found articles about how this works in XCode 3 (Interface Builder) but I am looking at how this works in XCode 4 !!
Also, when creating iPad View Controllers in MonoTouch the files seem to be separated (I get an fHeader.cs and a fHeader.xib file) whereas before the fHeader.cs file was 'part of' the xib file (hierarchically below it). Why is this?
I am using Mono 2.10.9 - XCode 4.2 and Monotouch 5.2.11
Thanks
This has a nice tutorial:
http://blog.arcticmill.com/2012/05/uitableview-with-custom-uitableviewcell.html
Check this tutorial:
http://sabonrai.wordpress.com/2009/08/28/monotouch-sample-code-uitableview/
Normally you create a DataSource Delegate and there you override the GetCell function.
In this function you can create your custom cell.

Xcode 4 plugin development

I've been looking all over the place but I can't find anything. Does anyone know how to create an Xcode 4 plugin?
As far as I know there is no official way to create Xcode 4 plugins (just like there wasn't one for v3.x).
Here is an openradar on Xcode's lack of plugin support:
Please support the ability for 3rd
parties to extend Xcode via a public
plugin API. Aperture, Visual Studio,
Eclipse, TextMate and other
applications benefit from this
ability. I would like to see more
advanced refactorings, code analysis
(think Resharper by Jetbrains) and
modeling.
Provide plugin API for Xcode 4 (rdar://8622025)
Please dupe this if you want plugins!
Edit: Just stumbled upon this:
Cédric Luthi:
"Xcode 4 does support user-defined
plugins, see CLITool-InfoPlist
for an example of a working Xcode 4
plugin. You just have to add
XC4Compatible (true) in the
Info.plist."
https://github.com/0xced/CLITool-InfoPlist
That being said these GitHub repos might be handy, too:
Xcode4 Plugin-API Documentation (link dead)
Xcode Plugin Template (link updated)
Further more mogenerator's Xmod plugin might be a good starting point.
(Wasn't Xcode-4 compatible yet, last time I checked, though)
Best way to learn is to look at github plugin code (see long list below):
Basically its a plugin bundle.
No main.m No MainMenu.xib
First class loaded by setting NSPrincipalClass in info.plist
in its init: you register for AppKit notifications
See the code samples
some check the mainBundle app id to make sure this is XCode
The XCode Editor window class is DVTSourceTextView
Its a subclass of DVTSourceTextView :NSTextView : NSText
so you can register to listen for its notifications for NSTextView or NSText
such as NSTextViewWillChangeNotifyingTextViewNotification
Because its not an official standard I noticed each sample loads in different ways.
XCODE PLUGIN SAMPLES
compiled by either searching github/web for
'DVTSourceTextView'
This is the Xcode Editor window class name
or
Info-list key
'XC4Compatible'
https://github.com/omz/ColorSense-for-Xcode
https://github.com/ciaran/xcode-bracket-matcher
- uses a ruby parser run as pipe!
https://github.com/joshaber/WTFXcode
https://github.com/0xced/NoLastUpgradeCheck
http://code.google.com/p/google-toolbox-for-mac/downloads/list
see GTMXcode4Plugin
https://github.com/DeepIT/XcodeColors
https://github.com/0xced/CLITool-InfoPlist
https://github.com/sap-production/xcode-ide-maven-integration
https://github.com/ciaran/xcode-bracket-matcher
TO GET TO THE NSTextView that is the console
https://github.com/sap-production/xcode-ide-maven-integration
- (NSTextView *)findConsoleAndActivate {
Class consoleTextViewClass = objc_getClass("IDEConsoleTextView");
NSTextView *console = (NSTextView *)[self findView:consoleTextViewClass inView:NSApplication.sharedApplication.mainWindow.contentView];
if (console) {
NSWindow *window = NSApplication.sharedApplication.keyWindow;
if ([window isKindOfClass:objc_getClass("IDEWorkspaceWindow")]) {
if ([window.windowController isKindOfClass:NSClassFromString(#"IDEWorkspaceWindowController")]) {
id editorArea = [window.windowController valueForKey:#"editorArea"];
[editorArea performSelector:#selector(activateConsole:) withObject:self];
}
}
}
return console;
}
Have a look at this new plugin: https://github.com/sap-production/xcode-ide-maven-integration. Maybe you can derive some concepts for your plugin.
Yesterday ColorSense for Xcode 4 was released on Github. Since the code is really compact spread over just 3 classes, I think you should take a look over there.
Xcode does not have a public plug-in API.
This was the case with earlier versions, and is the case with Xcode 4 as well.
No, Xcode doesn't support plugins, alternatively you may try AppCode, another IDE for iOS/MacOS, it does support plugins development.

Resources