View Full Version : Sim Strategy (work in progress)

10-12-2017, 11:57
Hi All,

Those that may know I created a strategy calculator for Pcars1 on excel/open office and google sheets. I have constantly wanted to create a UDP version with live data from the game. So I have revisited some code I have for iOS today. I have some issues since Swift has updated since I last looked at it :mad:

Eventually I hope to be able to create strategy calls based on the data direct from the game, I have all the theory on my head but I've had t learn how to code from scratch, I've only had experience with excel formulas.

See below my errors i'm working through (thank google and stack overflow) hopefully I've have something that works eventually. In it's current state it connected to UPD and received data I just need to amend the UI labels to the ones I want and do the maths bit.

I cannot remember which amazing member of this community send me a base app with UDP but I thank them a lot.


This is my old version without UDP connected, I have a new version now. It just show some calculations I managed.


I am determined to complete this.

15-12-2017, 20:27
Ok people I'm really struggling with this error can anyone help?


fixed quite a few of the others.

15-12-2017, 20:46
Really not into Apple and/or Swift, but what are you trying to do?

You seem to declare a variable and at the same time check if it is equal to the result of a function. It's not very likely to be true, because it has just been initialised(null?)

A normal declaration would go something like this:
var ip: String

ip = "The value I want to give it"
(maybe that could be shortened to
var ip: String = "The value I want to give it"
as I said, I don't know and want to Swift)

And after that you can check it against something:

if ip = String(Cstring:.....){
some code

15-12-2017, 21:16
I appear to have a successful build, you're question helped me fix it. Thank you.

Making progress...........

16-12-2017, 08:33
My app development isn’t going well!

I managed to fix all the above issues and began to test the app/game connection, unfortunately my iphone has moved onto iOS 11 my Macbook (mid 2009) only supports Xcode upto iOS 10!

I’m at a crossroads to complete this for current platforms i’ll need a new Mac!