User Tag List

Results 1 to 7 of 7

Thread: Reading ini value from XCode

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Jan 2012
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reading ini value from XCode

    I wanna do a remove ads option and doing it the easy way of If ini value is 1 then don't display ads works fine in fusion .
    However chart boost is in XCode. I want to put it in a simple if function. So if ini is 1 then don't activate chart boost code. Does anyone know how to do this? Thanks in advance

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Tuna's Avatar
    Join Date
    Feb 2008
    Location
    Central Texas
    Posts
    1,853
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    you wouldn't need to read the ini file with xcode... go ahead and read the ini value using your fusion code, then set a variable to 1 or 0 based on yes or no. then you need only check a variable's value in xcode.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Jan 2012
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not with chartboost its an addition to your project so its not accessible from within mmf

    /edit reread

    in that case how to i reference the newly created variable?

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Tuna's Avatar
    Join Date
    Feb 2008
    Location
    Central Texas
    Posts
    1,853
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Surely there must be a way to simply check a Fusion variable from xcode... but i haven't had need to do it...

  5. #5
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, ┼rhus
    Posts
    3,455
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    I don't really recommend manually reading from an INI file.

    Here is how if you wish to do it manually anyway:
    Code:
    //Put this at the top of the file:
    #import "CIni.h"
    
    ...
    
    //Put this where you want to read from a Fusion2.5 INI file:
    CIni* ini = [[CIni alloc] init]
    [ini loadIni:];
    int value = [[ini getPrivateProfileString: @"My_group_name_here" withParam1:@"My_item_name_here" andParam2:@"0" andParam3:@"name_of_your_ini_file_here.ini"] intValue];
    [ini release];
    
    if(value == 1)
    {
       //Hide ads
    }
    else
    {
       //Show ads
    }
    Note: The Runtime's CRunApp must be created at the time you call this code.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Jan 2012
    Posts
    95
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks that looks cool, I'm not sure what to put in
    My_group_name_here
    and
    My_item_name_here
    though

    All i've got in the app is an ini called ad.ini I don't think I have any groups or items?

    I'm also not sure how to do this part
    "CRunApp must be created"

    I should have a couple of coders finish up the code I need tomorrow so i'll have to see how they do it and if it works too.

  7. #7
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, ┼rhus
    Posts
    3,455
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    You insert the names of the groups and item names as if you had used those names from within Fusion with the regular INI object.
    The group name is optional, just leave it blank if you don't have any groups in your INI file. The item name is mandatory though, how else do you know which name value to retrieve?

    "CRunApp must be created":
    If you don't know where to put the code I can't help you much. If you are getting help from an external programmer then they know what to do with the info.

Similar Threads

  1. Reading the CFile in iOS SDK
    By AyreGuitar in forum Extension Development
    Replies: 2
    Last Post: 1st June 2012, 11:16 AM
  2. reading from RSS
    By Panchos in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd February 2011, 03:57 PM
  3. Reading web content
    By ClickerGuy in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 21st April 2010, 03:35 AM
  4. Com port reading?
    By spyfrog in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 28th November 2008, 09:27 PM
  5. reading INI file
    By bearcub in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 24th December 2007, 04:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •