iOS INI files are not working

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I have deployed several INI files for my project with preset data. I am using this approach to get around the lack of .arr support for iOS in MMF2. On Windows reading the INI files works without issue as it pulls then from "C:\Windows". On iOS nothing happens.

    In my MMF2 file I have an event which sets the INI file to "something.ini". It then sets the current group to "data" (e.g. [Data] in the file). I then read a value. End result: nothing. The files are loaded into my XCode project under resources and when I compile, I can right click on the compiled app and do a "Show Package Contents" ... my INI files are present and accounted for. The case of the names matches without issue. The files show up under "Copy Bundle Resources" under Targets.

    What is going on? This is really holding me back from getting a key deliverable out.

  • Not sure if it helps, but remember reading somebody else on these forums having problems using set group part of the INI object - he managed to get it working without groups.

    Kevin Ayre Please login to see this link.
    My iOS Apps: Please login to see this link., Please login to see this link. and Please login to see this link.

  • Yea, i prefer not setting a group alone, but using the "Set Group and Item" at once to load a value.

    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

  • Ini works for me (used it in memory shop)..

    I always get MMF to create the initial ini in the application folder... to make sure its working.

    Then remember you have to manually copy the ini file to the resources folder on the X-code project.

    Games Twitter : Please login to see this link.
    Websites: Please login to see this link. - Game Dev.

  • Getting rid of the group and using the default "[]" made no difference. Is there any special UTF format etc. or other things I cannot do with INIs that I should be using for iOS? I do set the INI source using the following "Set current file to "somefilename.ini". Should I be using one per INI instead of reusing it for all 14 of my INIs? FYI - I am using INIs because I cannot use the .arr data source.

  • Hmmm, I have been using groups in my game. If I let the MMF app create it when it first runs, all works ok. If I put a pre-made ini file in to the Xcode project and try to write back to it, my app locks up although I was able to read values from it. I have not tried without using groups either way.

    Andy H @ Please login to see this link. - Please login to see this link.
    Retro Gaming @ Please login to see this link.

  • Keith: Can you PM the project to me instead?
    Francois is on vacation and cannot test it until he is back.

    Please login to see this picture. Please login to see this link. - Please login to see this picture.

  • Just a reminder - you must manually add your something.ini into xcode resources folder. (in xcode right click on resources , select add file ...)

    INI works fine for me, group or not :)

  • There does seem to be some problems in ini (have just updated to the latest version).. having problems creating an ini again (this was a problem i had in an old Beta version)... wonder if something has been overwritten at some point?

    Games Twitter : Please login to see this link.
    Websites: Please login to see this link. - Game Dev.

  • I was able to resolve this problem by debugging the iOS code generated for my project. The problem was straightforward:

    Basically they are taking a line in the INI file like this:

    Some Value=15

    ... and looking for =. Once they get it they create a string in order to say "is the string on this line before the = the same value as the key 'Some Value' I am looking for?", but when they build this string to compare they forget that they want the location of = less 1.

    I resolved this issue by changing the following in CIni.m:

    s2=[s substringToIndex:range.location];

    to

    s2=[s substringToIndex:range.location - 1];

    Once in place all INI file reading is golden.

    I'll let the iOS guys look at this closer to make sure this works in all scenarios, but if anyone has a problem this was how I was able to resolve it.

  • This forum is giving me some problems, it marks unread posts as read.

    Keith:
    It isn't the correct fix though, it depends on your ini file.

    The bug is because the ini parser doesn't trim out whitespace from the key name and then cannot find the key you are looking for.

    This bug has been fixed for the next version.

    If you are interested in the fix it is this:

    Code
    s2=[[s substringToIndex:range.location] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];

    Please login to see this picture. Please login to see this link. - Please login to see this picture.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!