Few questions from Trial user


(Benito T) #1

Hello

I’m trying trial version of elements C#. I’m impressed of this product and at same time disappointed/flustrated Delphi user. It was time to forget delphi and try something “normal” to write mobile applications. No matter for me to learn C#, make 3 different layouts for every platform, I just had enough delphi bugs, 6 months waiting for bug fixes or just answer: “as designed”. It seems that elements is what we need in our company to make true and professional apps. I have try C# for ios and all looks nice and working good with some exceptions:

  1. Code completion for ios. For example if I wish to write:

UINavigationBar.appearance().setBarTintColor(UIColor.UIColorFromRGB());

There is no code completion like in Xcode (or similar). I must to know/remember all exact procedures/methods names to complete line. I mean after write: UINavigationBar.appearance(). after dot, there is no setBarTintColor procedure name in code completion, while all is correct and working with setBarTintColor typed. Similar for UINavigationBar.appearance().setTintColor(UIColor.whiteColor());

  1. Working with storyboards and .xcodeproj directory generated by VS, there is one big issue. After make changes in storyboard on mac, changes are not reflected in visual studio. Everytime I must clean project to see changes in emulator. Please try to do any change on storyboard like create button, save it, build and run from vs, back to mac, change button to red, save, back to vs and click build and run. It’s a bit not comfortable. Slso after clean VS re-download ios symbols (because of clean).

  2. It’s possible to simulator popup (bring to front like in xcode), after run project from VS? Now when working on full screen storyboard, I need to cmd+tab to bring simulator to front everytime I run project. It can be always on top, but is not a good solution for small screen areas like macbook.

  3. Is not possible to access Images.xcassets directory in xcode, because they are as AssetCatalog. Xcode do not see them. How to update launch icons without manually edit .plist file? Adding images to Images.xcassets will not be visible in xcode. For new images solution is to create new directory, set as resource and they are visible in xcode, but we loose multiresolution functionality (it works only for images in Images.xcassets directory).

  4. Compiler do not warn when references are not added. For example:

CATransition transition = CATransition.animation();

This need to add QuartzCore reference. Without it, compiler will show many internal errors (or even crash - not always), but not clear for user. It’s possible to do some checks agains missing references?

Hope to hear answer soon :slight_smile:
Btw. I’m using VS community 2013 and latest elements ver. 8.1.85.1801

b.r.


(RemObjects) #2

Thanks, logged as bugs://72576


(RemObjects) #3

Thanks, logged as bugs://72577


(marc hoffman) #4

i’m happy to hear that!

Hmm, you should be getting full code completion for iOS (and all platforms). If you don’t, there’s something going wrong. Are you not seeing any CC at all, or juts not the specific items (more on that below) that you ar expecting?

barTintColor is a property, first and foremost, so it shows in CC as property. Internally, the deter method for the property is called setBarTintColor and due to how the ObjC runtime works, you can call the method directly instead of setting the property (thats why it compiles), but we purposely don’t show property getters/setters in CC, because if we did, every property would show three times, cluttering the list up a lot.

TBH, this has bitten me two in a couple cases where ei was looking for a setSomething, and it wasn’t in CC. But really, i do thing its cleaner that way.

Hmm, that;s weird. Whats your network setup for the interaction between Xcode on your mac and VS on Windows? a VM with ashamed folder? if so, is your project Mac side or Windows side?

The way tis works is that Elements/VS doesn’t really read your storyboards at all,. they just exist on disk, and when you change them in Xcode and save, the change on disk. the build should just pick up the changed storyboards as part pf the compile process.

when you change the SB in Xcode and Save, can you

  • check the folder on disk, on Windows, to see if the file date reflects your change
  • check the build log (maybe set it to verbose) for the next build, to se if it processed the files ok?

It is, yes. i’ll log an issue for that. Fire already does this, but we don’t currently from VS. Good idea!

72576: CrossBoxHelper: option to bring simulator to front when running app from VS

i’m not sure i understand. Xcode should handle Images.xcassets as is, and show it as editable asset catalog. It does so in all my testing here. On disk, its a folder (its content managed by Xcode), in your Elements project in VS (and Fire) it should show as a opaque single file. Can you send me a couple screenshots of what you are seeing that is wrong?

that sounds like a bug, i’ll log an issue and get that fixed. thanx!

72577: Nougat: Confusing errors (and crashes) when missing indirect references


(Benito T) #5

Hello

Thanks for response :smile: I have code completion, it’s only case what I wrote about properties (You have clarify me). It’s clear for me now and thanks for explanation.

My network setup is desktop PC with win8.1 > Wi-Fi > macbook. I open on mac shared folder with my project on PC. Build or rebuild doesn’t help, I have tried many times. After save storyboard, changes are reflected on disk, because I open storyboard in VS and it show me that file changed and I see that changes (for example change button name). I have also checked in option “Project and solutions/Build and run/On run when project are out of date >>> Always build”. Looks like VS do not handle changes in Main.storyboard file without clean project. I have checked it again now, to be 10000000000% sure, at least at my pc :smile: Changing build verbosity do not help. I did experiment, to made changes in storyboard file in VS directly (change button text). It was reflected on mac, xcode reload file and show changed button text, but VS build project with older (looks like cached) storyboard file.

I have created new, empty project, clicked “Sync user interface files to xcode”. It create directory testProj-UI.xcodeproj with files which I access on mac. I have attach zip file with storyboard files and 3 screenshots.

asAssetsCatalog.png - This is like is now. I don’t see Images.xcassets directory, so I cannot reach files, add/modify icons etc.

asAppResource.png - This is when I set Images.xcassets as AppResource. It’s accessible in xcode, can add/modify icons, add new images with multires support, but builded application do not see it, because should be as Assets :smile:

MissingPNG.png - Additionally screen. This notification come from xcode, because it detect that missing launch image. If I click to add it by xcode, then Default-568h@2x.png file is added to obj directory, not resource. It’s wrong, because xcode still show missing file and propose to add it.

I see Images.xcassets in VS, but I cannot add there any files and see it in xcode (attached VS.png). Maybe I’m doing something wrong or VS2013 community make all that problems?

Tomorrow I go to holidays, so I can answer next week.

testProj-UI.xcodeproj.zip (2.1 MB)

[EDIT]

Another issue with storyboard:

  • define in any class:

      [IBAction]
      public void unwindToViewController2(UIStoryboardSegue sender)
      {
      
      }
    

It’s IBAction to link any button to page Exit button in storyboard

  • Sync UI in VB
  • storyboard do not see this change.

To make change visible there are 2 ways:

  1. close storyboard and open again to reload all
  2. in project navigator click on Classes.h. Xcode refresh information and see changes.

B.r.


(Benito T) #6

Hello

I have access to internet, so I can answer if any reply will be available :slight_smile: Waiting for response. Thanks

b.r.


(marc hoffman) #7

My apologies for the delayed response.

i didn’t expect that to fix the problem. But i’d expect it to give more details. Can you do the following thing:

  • do a “clean”
  • do a “rebuild”

post the change log. i assume this version now built works and is up to date.

  • make a change to the SB in Xcode, save it
  • confirm that on Windows the date has change don disk for the SB
  • hit build

post the resulting change log, as well. i assume this version now built did NOT get the latest change.

Unrelated, can you try if the same scenario works fine for you in Fire on the Mac?

thanx.
marc


(Benito T) #8

Hello

Np. for delay :smile:
Now I do all on VM, because i’m on macbook only. I have installed windows 8.1/oxygene/VS 2013 community in that VM and create new test project. It’s same behaviour as on my home desktop <> mac settings.

Here 2 logs:
log1.txt = after clean/rebuild
log2.txt = after changes in storyboard and build

logs.zip (25.6 KB)

Changes in storyboard changed file date of storyboard file.
I cannot check now Fire on mac. I’ll check it after back from holidays (slow internet connection to download Fire)

Please for tips/response about Images.xcassets issue (check previous mail for screenshoots)

b.r.


(Benito T) #9

About issue with syncing storyboard between VS and mac (my last post with EDIT annotation). I think is normal behaviour . In Objective-C when IBAction/IBOutlet is defined, then user need to open Classes.h file anyway, so all is refreshed at this time.

Still exists problem with Images.xcassets which is not visible in storyboard. Have checked Xamarin page and examples and there definitelly it’s accessible. Without access to Images.xcassets is probably (I have no success) to set and use images with ios convention (@2x, @3x). I did test by adding 3 images to resources: icon.png, icon@2x.png, icon@3x.png and run it on iphone5 and get it by UIImage image = UIImage.imageNamed("icon"); . icon.png is selected (have checked png resolution) by ios system instead icon@2x.png.
You have mention (mh) that Images.xcassets is visible for You and is editable? Which version of elements You test?
For me is not working and is clear that it should not, because I have checked project.bpxproj file and section with resources. xcassets catalog is not included there, so is not visible in storyboard on mac. If I set build action to AppResource for xcassets, then is included in project.bpxproj and visible in storyboard and editable, but not visible by application itself. Ppp have no icon and files are no accessible by UIImage.imageNamed.
So xcassets is in Resources, but build action = AssetCatalog causes that is not included as resource in project.bpxproj file.

b.r.


(marc hoffman) #10

Hmm. Can you check which files actually make it into your .app bundle? This sound like a build/packaging issue, then.

I’ve tested with 8.1, but nothing changed that should affect this for the 8.2 beta.

Thus should only mater for being able to edit in Xcode, not for what gets packaged. FWIW. Of course it should be there though. Is the build action set to AssetCatalog?

This what i see, fresh new iOS app: http://share.dwarfland.com/c9O3. The .xcasset is set to correctly, and i do see it in the generated Xcode project. I also see all versions of the icon packaged correctly: http://share.dwarfland.com/c9Gh.

Can you send me your exact project?

That’s expected. AppResource means it will be blindly packaged as resource, “as is”; it won’t be processed, and so it won’t be usable in your app at runtime, because iOS, at runtime, doesn’t know what a .xcasset file is or does.


(Benito T) #11

Thanks for response

Hmm. Can you check which files actually make it into your .app bundle? This sound like a build/packaging issue, then.

All files are included. I’m not sure if UIImage.imageNamed uses images with naming convention (@2x, @3x) only if they in Image.xcassets directory. If I put images to Resources directly, then ios do not load correct image. I’ll check yet with icons, they are in xcassets directory. If UIImage.imageNamed will pickup correct one (@2x for iphone 5), then it somethins is wrong here.

I’ve tested with 8.1, but nothing changed that should affect this for the 8.2 beta.

I’m still on 8.1.85.1801 trial, so it should works for me too

Thus should only mater for being able to edit in Xcode, not for what gets packaged. FWIW. Of course it should be there though. Is the build action set to AssetCatalog?

This what i see, fresh new iOS app: http://share.dwarfland.com/c9O3. The .xcasset is set to correctly, and i do see it in the generated Xcode project. I also see all versions of the icon packaged correctly: http://share.dwarfland.com/c9Gh.

Can you send me your exact project?

As I see from screens, it works for You as expected, but not works for me :frowning: Here is sample project with compiled ipa too:

testcase.zip (1.8 MB)

That’s expected. AppResource means it will be blindly
packaged as resource, “as is”; it won’t be processed, and so it won’t be
usable in your app at runtime, because iOS, at runtime, doesn’t know
what a .xcasset file is or does.

For sure, I just did experiments to find the way to make xcassets works.

b.r.


(marc hoffman) #12

indeed something is. imageNamed should go purely by the flat image names. if you have icon@2x.png in your app bundle, it should pick that up when you ask for “icon”. if it does not, something si wrong that’s outside of what our compiler controls. That’s basic iOS system behavior, iOS cannot and does not handle .xcasset catalogs at runtime, at all.

i’ll have a look at that tomorrow.


(marc hoffman) #13

works fine for me as well: http://share.dwarfland.com/c9Ap
but wait: are you using Fire or VS?

i don’t see an “icon” file though, so i cant comment on the runtime issues you are seeing, with this sample, but the Xcode sync of the asset catalog works fine (from Fire). I’ll resets VS tomorrow, when i’m back in the office, with access to my Windows VM.


(Benito T) #14

Just installing fire to test. icon.png was name as example, You should see menuIcon.png (3 files). It’s same behaviour. I’m using VS 2013 community.

[EDIT]

In fire it’s working! So problem is with VS, question where?

I compared project.pbxproj files generated by VS and Fire (different projects, both new one, but one have 3 png in resources)

In fire file there is:

ECCBA04517C22CBC00E46CF9 /* XIBs & Storyboards */ = {
  isa = PBXGroup;
  children = (
    ECCB00000000000000000028 /* LaunchScreen.xib */,
    ECCB00000000000000000029 /* Main.storyboard */,
  );
  name = "XIBs & Storyboards";
  sourceTree = "<group>";
};
EC430FBA1987CCE700365C06 /* Asset Catalogs */ = {
  isa = PBXGroup;
  children = (
    ECCB00000000000000000027 /* Images.xcassets */,
  );
  name = "Asset Catalogs";
  sourceTree = "<group>";
};
ECCBA05017C22D1F00E46CF9 /* Generated Code */ = {
  isa = PBXGroup;
  children = (
    ECCB0000000000000000002A /* Classes.h */,
    ECCB0000000000000000002B /* Classes.m */,
  );
  name = "Generated Code";
  sourceTree = "<group>";
};

in VS:

ECCBA04517C22CBC00E46CF9 /* XIBs & Storyboards */ = {
  isa = PBXGroup;
  children = (
    ECCB00000000000000000044 /* LaunchScreen.xib */,
    ECCB00000000000000000045 /* Main.storyboard */,
  );
  name = "XIBs & Storyboards";
  sourceTree = "<group>";
};
ECCBA04E17C22CE000E46CF9 /* Resources */ = {
  isa = PBXGroup;
  children = (
    ECCB00000000000000000046 /* menuIcon.png */,
    ECCB00000000000000000047 /* menuIcon@2x.png */,
    ECCB00000000000000000048 /* menuIcon@3x.png */,
  );
  name = Resources;
  sourceTree = "<group>";
};
ECCBA05017C22D1F00E46CF9 /* Generated Code */ = {
  isa = PBXGroup;
  children = (
    ECCB00000000000000000049 /* Classes.h */,
    ECCB0000000000000000004A /* Classes.m */,
  );
  name = "Generated Code";
  sourceTree = "<group>";
};

Obviously missing Asset Catalogs node

b.r.


(marc hoffman) #15

menuIcon.png isn’t in the asset catalog, though. Make sure you use the proper casing when loading it. iOS’s file system is case sensitive.

looks like. the Elements/VS team will need to investigate this. At least there Xcode sync issue. As for why it doesn’t load your image at runtime, i’m still clueless (potential case issues aside). I’ll need to test mor eoin that front when im back in the office.


(Benito T) #16

menuIcon.png isn’t in the asset catalog, though. Make sure you use the
proper casing when loading it. iOS’s file system is case sensitive.

Yes it’s not in asset catalog because if I set build action for png file, then is not accessible in storyboard or even via code, that’s why I must set it as AppResource. At least Images.xcassets should be included, but as You can see in project.pbxproj example, it’s not. Nothing what is set as AssetCatalog is included in project.pbxproj so is not visible in storyboard. I know that iOS filenames are case sensitivie and I checked it :slight_smile: Simulator do not care for case sensitive, but real device is. Here is no mistake :slight_smile:

b.r.


(marc hoffman) #17

Right, but i thought the (second) issue was that it cant load the image if it’s in the asset catalog?


(RemObjects) #18

Thanks, logged as bugs://72652: Nougat: Asset Catalog doesn’t show in Xcode UI project, from VS (fine from Fire)


(Benito T) #19

Second issue was about naming convention (@2x, 3x in picture name) and I test png file as AppResource because this way I can access it. I test picture width,height when image was loaded by iOS instead of scale. Scale give real answer which one file was loaded. This works properly.
Anyway too many things in one thread. Next time I’ll create separate topic to not confuse, mix things :smile:

b.r.


(marc hoffman) #20

Ok, so that is sorted,and the only issue remaining is the lack of Asset Catalog sync when working in VS? If so, that’ll get fixed next week.