Help on making SBSettings toggle

Discussion in 'iOS Development' started by boopyman, Apr 17, 2010.

  1. boopyman

    boopyman Member

    Joined:
    Mar 30, 2009
    Messages:
    188
    Likes Received:
    0
    Device:
    4G iPod touch
    Hey guys,
    I'm trying to make an SBSettings toggle for my application. So I started by making the most basic toggle ever, just an NSLog giving feedback when the icon is clicked. Really basic. Ok well first of all, I decided to try to build this in XCode, by renaming my binary file to Something.dylib. (I found out I could do this in the MobileSubstrate template thread). I then make the appropriate folder in /var/mobile/Library/SBSettings/Toggles, and ldid and respring. When I look at SBSettings, I can't see my toggle. (SBSettings says the toggle is on in the "more" option). First, I thought that this was due to the fact that I didn't have an icon for the toggle. So what I did was made a folder in the correct Themes folder, and copied the icons over from the location toggle, which I disabled. I respring, and still no toggle in SBSettings.

    Does anyone know what could be causing this? Sorry if I wasn't clear, just ask if you can't understand the question.

    Thank you in advance,
    Boopyman
  2. bddckr

    bddckr Active Member

    Joined:
    Dec 2, 2007
    Messages:
    1,434
    Likes Received:
    18
    Device:
    iPhone 4 (Black)
    Are you building a .dylib or did you just rename your .app executable file? Seems you aren't building a .dylib.
  3. boopyman

    boopyman Member

    Joined:
    Mar 30, 2009
    Messages:
    188
    Likes Received:
    0
    Device:
    4G iPod touch
    I'm renaming my executable file, the one in the .app folder. Again, I've never done this before, so I'm probably missing something quite obvious. Can you build a .dylib in XCode?

    EDIT:

    I don't know if this makes a difference, but I'm doing what this says:

  4. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    compile with this
    Code:
    /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple-darwin10-gcc-4.2.1
    set the dynamiclib flag, perhaps specify an init function, and link whatever frameworks you need, yourself.
  5. boopyman

    boopyman Member

    Joined:
    Mar 30, 2009
    Messages:
    188
    Likes Received:
    0
    Device:
    4G iPod touch
    Thanks for the help Axis, but I'm still having some issues; first off, I don't have that compiler in that location, and searching for it on my hard drive didn't return any results. Second, if I were to have it, what would I have to do to change the compiler? I think I would change the Compiler Version key in the build settings, but I"m really not sure.
  6. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    you may not have that exact compiler, but there should be an arm gcc in that directory
  7. boopyman

    boopyman Member

    Joined:
    Mar 30, 2009
    Messages:
    188
    Likes Received:
    0
    Device:
    4G iPod touch
    Yeah I do, my bad, it's arm-apple-darwin9-gcc-4.2.1.
    So to use that compiler, should I replace the Compiler Version string in the build settings?
    Sorry about all the questions, it's my first time using a different compiler.
  8. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    no, I meant to just do it on the command line (forgot that in my first post). Xcode won't let you compile a dylib for iPhone.
  9. boopyman

    boopyman Member

    Joined:
    Mar 30, 2009
    Messages:
    188
    Likes Received:
    0
    Device:
    4G iPod touch
    Ok, I compiled it with arm-apple-darwin-gcc on a Cygwin Toolchain, and it seems everything went fine, but still, the toggle doesn't show up in SBSettings. Anyone have an idea?
    Thanks for all the help so far, it's been quite useful!
  10. Pelaez-1

    Pelaez-1 New Member

    Joined:
    May 5, 2008
    Messages:
    822
    Likes Received:
    0
    Device:
    iPhone
    Make sure it's signed and permissions are 755.

Share This Page