Trying to follow the example

Again, I’m sorry for all the questions, but as a long-time Delphi developer, I’m sure these are questions which would be asked by other developers who are new to Elements/Fire

I’m trying to understand the code structure of apps along with XCode but I am having some difficulty with this document…
https://docs.elementscompiler.com/Platforms/Cocoa/XIB/WorkingWithXIBsAndStoryboards/

In particular, the bit after “Lets see this in action”. It says “let’s create a new “UIViewController with XIB”” but at what point are we doing this, do we need to create a new app before doing this? and if so, should it be a Simple App, Empty Project, Base Project, or something else…

Basic Project and Empty Project do not run on the simulator “out of the box”, I get exceptions… I don’t yet know why - one has a Program.pas file and the other doesn’t but I’m not sure what this is or whether it has anything to do with the templates not running.

I thought that I may be creating simple apps by now but, I’ve spent 3 days so far and don’t seem to be grasping the whole concept of view controllers, storyboards and all of the other new concepts which do not exist in Delphi.

Hopefully someone has some pointers which may help me (and I’m sure other Delphi developers out there)

Graham

Ok, making progress!

I’ve started with a Simple app template (which just has a navigation controller and a view)

I’ve then added a second UIViewController (MyViewController) and call this from a button on the first RootViewController.

Then added a third view (MyTableViewController) which, on loading, pulls down some JSON over HTTPS and logs it using NSLog.

It’s not going to make any money, or top any app charts but I’m feeling good that i’ve got to this stage :slight_smile:

Just got to now try and populate the tableview with the data.

One question, I’m using NSLog() to log the HTTP output like this (for debuggin)…

NSLog(content.Content);

It works fine but I get a warning - “Format string should be a literal”

What’s the correct way to call this function a string variable rather than a hard-coded string?

Right, back to the code…

No worries, found it

NSLog(’%@’, content.Content);

1 Like