Jump to content

Looping through an NSArray? + calling headers?!


11 posts in this topic

Recommended Posts

Posted

Hey So im trying to Loop through an NSArray I created and i keep coming back with 

 

error: unused variable 'jidd' 

 

here is my code.

 

 

%hook KikStanzaChangeGroupName


- (id) initWithGroup:(id)group andNewName:(id)name
{
NSArray *jid = @[@"[email protected]", @"[email protected]"];


for (int i = 0; i < jid.count; i++)
{
  NSString *jidd = jid[i];
      group = @"%@", jidd;
  }
 return %orig;
}


%end

could someone tell me what I am doing wrong/fix it?

 

I was thinking that i needed a .m or .h files but im not 100% positive.

 

 

Okay so the second question I have is, how would I call another header within a header? what i mean is this. If I for example, did

 

%hook CoreDataConversationManager


- (void) sendTextMessage:(id)command withRenderInstructionSet:(id)arg1 toConversation:(id)arg2 isSuggestedResponse:(BOOL)arg3
{

  if ([command isEqualToString:@"$ChangeName"]) command = @"new name";
return %orig;
}


%end

okay so if I typed out $ChangeName and clicked enter, it would do the same action as above (KikStanzaChangeGroupName) and change the name without actually having to go to that ChangeGroup Name ViewController and clicking save.

 

Posted (edited)

It's quite simple, you used the wrong accessor method.

To get the index of an item in an array, it makes more sense to use the "objectAtIndex:" method :)

%hook KikStanzaChangeGroupName

- (id) initWithGroup:(id)group andNewName:(id)name
{
NSArray *jid = @[@"[email protected]", @"[email protected]"];

for (int i = 0; i < jid.count; i++)
{
  NSString *jidd = [jid objectAtIndex:[NSNumber numberWithInt:i]];
      group = @"%@", jidd;
  }
%orig;
}


%end
Updated by KingRalph
Posted

 

It's quite simple, you used the wrong accessor method.

To get the index of an item in an array, it makes more sense to use the "objectAtIndex:" method :)

%hook KikStanzaChangeGroupName

- (id) initWithGroup:(id)group andNewName:(id)name
{
NSArray *jid = @[@"[email protected]", @"[email protected]"];

for (int i = 0; i < jid.count; i++)
{
  NSString *jidd = [jid objectAtIndex:[NSNumber numberWithInt:i]];
      group = @"%@", jidd;
  }
%orig;
}


%end

https://gyazo.com/cf12bca73e6dbab40042f119db4c9746 

 

I copied and pasted what you did and I got this :S?

Posted

The errors are related to type casting and stuff :3

 

Do this:

%hook KikStanzaChangeGroupName

- (id) initWithGroup:(id)group andNewName:(id)name
{
NSArray *jid = @[@"[email protected]", @"[email protected]"];

for (int i = 0; i < jid.count; i++)
{
  NSString *jidd = [jid objectAtIndex:(NSUInteger)[NSNumber numberWithInt:i]];
      group = @"%@", jidd;
  }
%orig;
}


%end

Posted

 

The errors are related to type casting and stuff :3

 

Do this:

%hook KikStanzaChangeGroupName

- (id) initWithGroup:(id)group andNewName:(id)name
{
NSArray *jid = @[@"[email protected]", @"[email protected]"];

for (int i = 0; i < jid.count; i++)
{
  NSString *jidd = [jid objectAtIndex:(NSUInteger)[NSNumber numberWithInt:i]];
      group = @"%@", jidd;
  }
%orig;
}


%end

that seemed to fix one, it still says the group = jidd is an unused expression... so would I do this?:  [NSString stringWithFormat:@"%@", jidd]

Posted

that seemed to fix one, it still says the group = jidd is an unused expression... so would I do this?:  [NSString stringWithFormat:@"%@", jidd]

Nope. You could ignore it (if it's not fatal) or you could do this:

 

%hook KikStanzaChangeGroupName

- (id) initWithGroup:(id)group andNewName:(id)name
{
NSArray *jid = @[@"[email protected]", @"[email protected]"];

for (int i = 0; i < jid.count; i++)
{
  NSString *jidd = [jid objectAtIndex:(NSUInteger)[NSNumber numberWithInt:i]];
      group = @"%@", jidd;
  }
%orig;
}


%end 
Posted

 

Nope. You could ignore it (if it's not fatal) or you could do this:

 

%hook KikStanzaChangeGroupName

- (id) initWithGroup:(id)group andNewName:(id)name
{
NSArray *jid = @[@"[email protected]", @"[email protected]"];

for (int i = 0; i < jid.count; i++)
{
  NSString *jidd = [jid objectAtIndex:(NSUInteger)[NSNumber numberWithInt:i]];
      group = @"%@", jidd;
  }
%orig;
}


%end

 

Hey, so I made this, now it only does the first one in the array, how would I make it loop so it is equal to the first one and then the second??

 

%hook KikStanzaChangeGroupName

-(id) initWithGroup:(id)group andNewName:(id)name
{
    NSArray *verified_users = @[@"[email protected]", @"[email protected]"];

    for (int i = 0; i < verified_users.count; i++) {
group = [verified_users objectAtIndex:i];
}
return %orig;
}
%end

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • Age of Magic: Turn Based RPG v3.0.0 +2 Jailed Cheats
      Modded/Hacked App: Age of Magic: Turn Based RPG By Playkot Ltd
      Bundle ID: com.playkot.ageofmagic
      iTunes Store Link: https://apps.apple.com/us/app/age-of-magic-turn-based-rpg/id1175370741?uo=4

      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Cydia Impactor.
      - A Computer Running Windows/Mac/Linux.


      Hack Features:
      - Damage Multiplier
      - Never Die


      Jailbreak required hack(s): 

       


      iOS Hack Download Link:

      Hidden Content
      Reply to this topic to see the <a href='https://iosgods.com/topic/3762-info-how-to-unlockview-the-hidden-content-on-iosgods/?do=findComment&comment=78119'>hidden content & download link</a>.








      PC Installation Instructions:
      STEP 1: If necessary, uninstall the app if you have it installed on your iDevice. Some hacked IPAs will install as a duplicate app. Make sure to back it up so you don't lose your progress.
      STEP 2: Download the pre-hacked .IPA file from the link above to your computer.
      STEP 3: Download Cydia Impactor and extract the archive.
      STEP 4: Open/Run Cydia Impactor on your computer then connect your iOS Device and wait until your device name shows up on Cydia Impactor.
      STEP 5: Once your iDevice appears, drag the modded .IPA file you downloaded and drop it inside the Cydia Impactor application.
      STEP 6: You will now be asked to enter your iTunes/Apple ID email login & then your password. Go ahead and enter the required information..
      STEP 7: Wait for Cydia Impactor to finish sideloading/installing the hacked IPA.
      STEP 8: Once the installation is complete and you see the app on your Home Screen, you will now need to go to Settings -> General -> Profiles & Device Management. Once there, tap on the email you entered from step 6, and then tap on 'Trust [email protected]'.
      STEP 9: Now go to your Home Screen and open the newly installed app and everything should work fine. You may need to follow further per app instructions inside the hack's popup in-game.

      NOTE: For free Apple Developer accounts you will need to repeat this process every 7 days. Using a disposable Apple ID for this process is suggested but not required. Jailbroken iDevices can skip using Cydia Impactor and just install the IPA mod with AppSync & IPA Installer (or alternatives) from Cydia. If you have any questions or problems, read our Cydia Impactor topic and if you don't find a solution, post your issue down below and we'll do our best to help! If the hack does work for you, post your feedback below and help out other fellow members that are encountering issues.


      Credits:
      - Laxus
      - gogigogi1


      Cheat Video/Screenshots:

      N/A
      • 497 replies
    • Age of Magic: Turn Based RPG v3.0.0 +2 Cheats
      Modded/Hacked App: Age of Magic: Turn-Based RPG by Playkot Ltd
      Bundle ID: com.playkot.ageofmagic
      iTunes Store Link: https://apps.apple.com/us/app/age-of-magic-turn-based-rpg/id1175370741?uo=4&at=1010lce4


      Hack Features:
      - God Mode
      - Auto-Win


      Hack Download Link: https://iosgods.com/topic/98670-arm64-age-of-magic-cheats-v1236-2/
      • 1,765 replies
    • Piggy Kingdom v2.3.5 [ +5 APK MOD ] Currency Max
      Mod APK Game Name: Piggy Kingdom
      Rooted Device: Not Required.
      Google Play Store Link: https://play.google.com/store/apps/details?id=com.olleyo.piggy.king.free&hl=en

       

      🤩 Hack Features

      - Unlimited Coins / Disable After Hack
      - Unlimited Lives
      - Build Coins / Use Then Get / Disable After Hack
      - Unlimited Moves / Earn Coins Win Match
      - Booster / Don't Use Crash
      - Color Move Only [ Without Matching Move Anywhere ]

       

      ⬇️ Android Mod APK Download Link


      Hidden Content

      Download Modded APK







       

      📖 Android Installation Instructions

      STEP 1: Download the modded APK file from the link above using your preferred Android browser or download manager.
      STEP 2: Once the download is complete, open your file manager and locate the downloaded .apk file (usually in the Downloads folder).
      STEP 3: Tap the APK file, then select Install. If prompted, enable Install from Unknown Sources in your device settings.
      STEP 3A: If the mod includes an OBB file, extract it if it’s inside an archive. Then move the folder to: /Android/obb/
      STEP 3B: If the mod includes a DATA file, extract it if it’s archived. Then move the folder to: /Android/data/
      STEP 4: Once installed, open the game and toggle your desired cheats & features through the APK mod menu. Enjoy!

       

      NOTE: If you have any questions or issues, read our Frequently Asked Questions topic. If you still need help, post your issue below and we’ll assist you as soon as possible. If the mod works for you, please share your feedback to help other members!

       

      🙌 Credits

      - IK_IK

       

      📷 Cheat Video/Screenshots

      N/A

       

       iOS & iPadOS App Hacks
      If you’re looking for Non-Jailbroken & No Jailbreak required iOS IPA hacks, visit the iOS Game Cheats & Hacks or the iOSGods App for a variety of modded games and apps for non-jailbroken iOS devices.
      • 0 replies
    • Royal Adventure : Big World v1.0.057 [ +5 Cheats ] Auto Win
      Modded/Hacked App: Royal Adventure : Big World By KOOFEI LIMITED
      Bundle ID: com.koofei.matchmansion
      iTunes Store Link: https://apps.apple.com/us/app/royal-adventure-big-world/id6504521957?uo=4


      🤩 Hack Features

      - Coins

      - Stars

      - Booster

      - Lives

      - Auto Win


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/forum/79-no-jailbreak-section/
      🤖 Modded Android APKs: https://iosgods.com/forum/68-android-section/
      • 25 replies
    • Royal Adventure : Big World v1.0.057 [ +5 Jailed ] Auto Win
      Modded/Hacked App: Royal Adventure : Big World By KOOFEI LIMITED
      Bundle ID: com.koofei.matchmansion
      iTunes Store Link: https://apps.apple.com/us/app/royal-adventure-big-world/id6504521957?uo=4

       

      🤩 Hack Features

      - Coins

      - Stars

      - Booster

      - Lives

      - Auto Win


      🍏 Jailbreak iOS hacks: https://iosgods.com/forum/5-game-cheats-hack-requests/
      🤖 Modded Android APKs: https://iosgods.com/forum/68-android-section/
      • 33 replies
    • Piggy Kingdom - Match 3 Games v2.4.0 [ +6 Cheats ] Currency Max
      Modded/Hacked App: Piggy Kingdom - Match 3 Games By OLLEYO PTE. LTD.
      Bundle ID: com.olleyo.piggy.match
      iTunes Store Link: https://apps.apple.com/us/app/piggy-kingdom-match-3-games/id1635337354?uo=4


      🚀 Hack Features

      - Coins

      - Lives

      - Build Coins

      - Moves

      - Booster

      - Color Move Only [ Without Matching Move Anywhere ]


      🍏 For Non-Jailbroken & No Jailbreak required hacks: https://iosgods.com/forum/79-no-jailbreak-section/
      🤖 Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      • 33 replies
    • Piggy Kingdom - Match 3 Games v2.4.0 [ +6 Jailed ] Currency Max
      Modded/Hacked App: Piggy Kingdom - Match 3 Games By OLLEYO PTE. LTD.
      Bundle ID: com.olleyo.piggy.match
      iTunes Store Link: https://apps.apple.com/us/app/piggy-kingdom-match-3-games/id1635337354?uo=4


      🚀 Hack Features

      - Coins

      - Lives

      - Build Coins

      - Moves

      - Booster

      - Color Move Only [ Without Matching Move Anywhere ]


      🍏 Jailbreak iOS hacks: https://iosgods.com/forum/5-game-cheats-hack-requests/
      🤖 Modded Android APKs: https://iosgods.com/forum/68-android-section/
      • 36 replies
    • Castle Crush v2.34.0 [ +6 APK MOD  ] Auto Win
      Mod APK Game Name: Castle Crush
      Rooted Device: Not Required.
      Google Play Store Link: https://play.google.com/store/apps/details?id=com.mibo.CastleCrush&hl=en

       

      🤩 Hack Features

      - Auto Win / Just Hit Target
      - Unlimited Coins / Visual But Works
      - Unlimited Stars / Visual But Works / Earn 1 Then Use For All Task
      - Unlimited Lives / Visual But Works
      - Unlimited Booster / Visual Butt Works / Earn 1 Then Use Inf
      - Moves Freeze

       

      ⬇️ Android Mod APK Download Link


      Hidden Content

      Download Modded APK







       

      📖 Android Installation Instructions

      STEP 1: Download the modded APK file from the link above using your preferred Android browser or download manager.
      STEP 2: Once the download is complete, open your file manager and locate the downloaded .apk file (usually in the Downloads folder).
      STEP 3: Tap the APK file, then select Install. If prompted, enable Install from Unknown Sources in your device settings.
      STEP 3A: If the mod includes an OBB file, extract it if it’s inside an archive. Then move the folder to: /Android/obb/
      STEP 3B: If the mod includes a DATA file, extract it if it’s archived. Then move the folder to: /Android/data/
      STEP 4: Once installed, open the game and toggle your desired cheats & features through the APK mod menu. Enjoy!

       

      NOTE: If you have any questions or issues, read our Frequently Asked Questions topic. If you still need help, post your issue below and we’ll assist you as soon as possible. If the mod works for you, please share your feedback to help other members!

       

      🙌 Credits

      - IK_IK

       

      📷 Cheat Video/Screenshots

      N/A

       

       iOS & iPadOS App Hacks
      If you’re looking for Non-Jailbroken & No Jailbreak required iOS IPA hacks, visit the iOS Game Cheats & Hacks or the iOSGods App for a variety of modded games and apps for non-jailbroken iOS devices.
      • 0 replies
    • Zooba: Zoo Battle Royale Game v5.39.1 Jailed Cheats +2
      Modded/Hacked App: Zooba: Zoo Battle Royale Games By Wildlife Studios Limited
      Bundle ID: com.fungames.battleroyale
      iTunes Store Link: https://apps.apple.com/us/app/zooba-zoo-battle-royale-games/id1459402952?uo=4


      Hack Features:
      - Map Hacks
      - Allow Shoot in Water


      Jailbreak required hack(s): https://iosgods.com/topic/131104-arm64-zooba-zoo-battle-royale-game-cheats-all-versions-2/


      iOS Hack Download Link: https://iosgods.com/topic/131134-arm64-zooba-zoo-battle-royale-game-v320-jailed-cheats-2/
      • 1,367 replies
    • RollerCoaster Tycoon Touch Cheats v3.48.1 +5
      Modded/Hacked App: RollerCoaster Tycoon® Touch™ By Atari, Interactive
      Bundle ID: com.atari.mobile.rctempire
      iTunes Store Link: https://apps.apple.com/us/app/rollercoaster-tycoon-touch/id1164507836?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - Infinite Currencies
      - Instant Max Level (Complete some task - Only use when you finished Tutorial and get to Level 8 at least)
      - VIP Member
      - Card only need 1 to be upgraded

       

      Non-Jailbroken Hack: https://iosgods.com/topic/74948-rollercoaster-tycoon-touch-v3413-jailed-cheats-4/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/73710-rollercoaster-tycoon-touch-cheats-v3420-5/
      • 1,125 replies
    • Real Boxing 2 Cheats v1.58.0 +3
      Modded/Hacked App: Real Boxing 2 By Vivid Games S.A.
      Bundle ID: com.vividgames.realboxing2
      App Store Link: https://apps.apple.com/us/app/real-boxing-2/id932779605?uo=4

       

      📌 Mod Requirements

      - Jailbroken iPhone or iPad.
      - iGameGod / Filza / iMazing.
      - Cydia Substrate, ElleKit, Substitute or libhooker depending on your jailbreak (from Sileo, Cydia or Zebra).

       

      🤩 Hack Features

      - God Mode
      - One Hit Kill
      - No Punch Cooldown

       

      Non-Jailbroken Hack: https://iosgods.com/topic/195702-real-boxing-2-v1550-jailed-cheats-3/

       

      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/195685-real-boxing-2-cheats-v1550-3/
      • 22 replies
    • +99 Reinforced Wooden Stick v99.1.35 Jailed Cheats +2
      Modded/Hacked App: 99강화 나무몽둥이 : 키우기 By STUDIO LICO Corp.
      Bundle ID: com.studiolico.woodenstick
      App Store Link: https://apps.apple.com/kr/app/99%EA%B0%95%ED%99%94-%EB%82%98%EB%AC%B4%EB%AA%BD%EB%91%A5%EC%9D%B4-%ED%82%A4%EC%9A%B0%EA%B8%B0/id6737379268?uo=4

       

      📌 Mod Requirements

      - Non-Jailbroken/Jailed or Jailbroken iPhone or iPad.
      - Sideloadly or alternatives.
      - Computer running Windows/macOS/Linux with iTunes installed.

       

      🤩 Hack Features

      - God Mode
      - Multiply Attack

       


      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/193094-99-reinforced-wooden-stick-v99135-jailed-cheats-2/
      • 34 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines