I'm not sure if I'm missing something or my installation is broken or it's a bug.
The problem: following the storyboards tutorial:
http://docs.xamarin.com/ios/tutorials/Introduction_to_Storyboards
doesn't work. The part where I'm supposed to close the IB and see generated .cs file in MonoDevelop doesn't happen.
I did this several different ways, restarted the computer per one source's suggestion, tried closing, quitting everything in every order per other suggestions.
What doesn't work is adding a new View Controller in IB and closing the storyboard should cause new .cs and .h files to be generated but they aren't
I guess I missed the minute detail of assigning a Custom Class name for the view controllers.
Make sure you select the view controller in IB (not some view inside) and set the Custom Class (not Label) to a name you wish. Save and close IB, MonoTouch should now generate .cs file
Related
Trying j2me app development. I got a simple Hello to work, and a simple TextBox user as well. But when I tried to compile code for a file browser I got "javax.microedition.io.file does not exist".
The WTK according to the Sun website is supposed to include JSR75. And there's a camera demo .java file that uses it.
I've looked in various places (the WTK, BlueJ, even Netbeans) for menu options to turn it on. Nothing. And a search of this forum turned up exactly ONE message and it pertains to another IDE, and it seemed to work for him in BlueJ.
So what am I missing and how do I get it?
In NetBeans, you go to Project Properties (right-click the project, and select Properties). Then click "Platform" and mark "File Connection and PIM Optional Packages 1.0".
On a whim I did a search for JSR75 jar download and found a few zipped jar files that seemed to contain the file classes. I unzipped one of them and put it in the Libraries/Userlib directory of BlueJ; and now I seem to have the File... Classes. Reading and writing seem to work in the emulator.
I'll take another look at Netbeans when I get a chance.
Is there a feature in JetBrains AppCode allowing to display automatically the .h associated with the opened .m file (and the other way around).
The associated file would be displayed in a tab of a splitted window (Available through the AppCode menu "Window > Editor Tabs > Split Vertically").
I'm looking for a feature similar to Xcode "automatic counterparts" feature (see picture http://i.stack.imgur.com/tbH8r.png )
I don't think this is possible in an automatic way. But BTW: Xcode almost never displays what you need in the Assistant Editor.
Similar to Xcode, it's possible to switch between .h und .m files with a key command. Having switched, you might want to open e.g. .m file in a split editor (as you described it). Then simply switch back to the .h file in the original window - and there you are.
It takes some more time to get into AppCode. But it's worth it.
I ran Visual Studio 2012 today and tried to create a new solution with projects contained within.
The class source code for the boiler-plate Class1 file is not visible. If I create a new class, the source code is also not visible.
When I click on a class file, the tab file opens with the class name but there is no source code. Just a background color that was there before. If I try to open any class file in notepad then the source code is visible. The only thing I have done today is uninstall continuous tests after having a play with it. This happens on any new project I create or with existing projects.
Has anyone seen this before and do you have a solution? Ta very much.
*I cannot post images as I do not have enough reputation yet.
Ok, so problem solved. I had uninstalled Continuous Tests via the control panel and that was that. However, the plug-in was still visible from the Visual Studio add-in manager. I performed an uninstall from there and everything started working fine again. Source code is now visible. I can only put it down to the incorrect uninstall procedure. – DannyDuttser
I have created an new UIMap in my project. I was able to work with it day before this error appeared. Now, when I right click on the new UIMap in VS (Visual Studio) and Click "Edit With Coded UI Test Builder" option - above error pops up.
I tried starting VS as admin, editing the .uitest file in the project folder (bad practice even if you know what you're doing) and saving it (it allowed me to do this), but still won't let me record using the new UIMap.
Additionally the original UIMap still works. I am using different names for UIMap if anyone is wondering.
I am using VS2012.
Any ideas would be appreciated. Thanks.
I have found the problem and A Solution for it, but not the cause. The properties of UIMaps .cs and .Designer.cs files were set to read-only. Please do let me know if anyone does find out what causes this and how to prevent this from occuring in the future.
My Solution:
Right click on the UIMaps .cs and .Designer.cs files in the project folder
Click on Properties
Untick Read-only tickbox
Voilà!
Thanks all.
What is the the best way to rename a class which inherits a UIViewController and has a designer.cs class linked to a storyboard?
I first tried to Rename the .cs file in MonoDevelop. This worked but the designer.cs file did not get renamed with it, and neither did the class name.
I then renamed the class name. This successfully changed the class name in both the .cs and .designer.cs files but still did not change the .designer.cs filename. It also did not change the name of the "Custom Class" for the controller in Xcode.
So in XCode I changed the name of the Custom Class and saved then switched back to MonoDevelop , to my horror it had created a new .cs with the same name as the renamed one and a new .designer.cs file which it put under the original (renamed) .cs file next to the old (not renamed) a.designer.cs file!
Can anyone tell me the sequence of steps I should have taken?
Renaming the file is tricky, since MD doesn't support renaming grouped files. You'd have to manually edit the csproj, or remove the files from the project, rename in Finder, and add them back.
Renaming the class is somewhat easier, but the key is to understand that the class actually has two names - the .NET name, and the Obj-C name. Renaming the .NET name should be easy, you can simply use the rename command in MD.
The Obj-C name is applied to the class on the [Register("SomeName")] attribute, and is the name that's used in xibs and in Xcode. However, beware that MonoDevelop will attempt to create .NET counterparts of any classes that it thinks were created in Xcode. This means you should change the Obj-C name in MonoDevelop first, then switch to Xcode and change the Custom Class there.
You have to go into the .csproj file and add a tag. For example:
<Compile Include="MainWindow.cs" />
<Compile Include="MainWindow.designer.cs">
<DependentUpon>MainWindow.cs</DependentUpon>
</Compile>
This will then show the correct relationship between the files in the MonoDevelop project window.
Incidentally, my experience so far is that this dependency is purely for convenience. Add the new designer.cs file into the solution and the code compiles just fine: dependency seems to be a sort of documentation.
ALSO: To delete or rename these dependent files, you can't do that in the MonoDevelop project pane: you do have to go to Finder (if you're in OSX, Explorer if you're in Windows) and deal with the files there, to rename or otherwise manipulate them, THEN repair the MonoDevelop csproj file by hand. The good news is, it's not hard, and it works fine when you do this, and you get a cool new hardcore understanding about how the project is knit together.
Many people also has to think about the version control system. This way works for me:
Quit MonoDevelop
In the version control system, rename the files
Open the csproj file in a text editor - search&replace
Open MonoDevelop
Open the XxxViewController.cs - search&replace
Open the XxxViewController.designer.cs - search&replace
Open the XxxViewController.xib - search&replace
You might be tempted to use Refactor/Rename instead of search & replace in step 5 but that will cause MonoDevelop to rename XxxViewController.designer.cs to XxxViewController_1.cs for some reason.
Also, you might be tempted to remove the files from the project before renaming them in the version control system and then add them back into your project again (so that you won't have to edit the csproj file manually). This will work but the "DependentUpon" part will disappear from the csproj file, which causes the designer file to not be below its counterpart. No big deal but it looks less nice in the Solution Explorer.
I tried all the solutions above and didn't work. Finally I just used the "Replace in Files" looking the whole solution. After that I did a "Rebuild" in the project and worked fine.