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

    • Family Island — Farm game v2025148.1.76088 Jailed Cheats +1
      Modded/Hacked App: Family Island™ — Farm game by Melsoft
      Bundle ID: com.MelsoftGames.FamilyIsland
      iTunes Store Link: https://apps.apple.com/us/app/family-island-farm-game/id1464689103?uo=4&at=1010lce4


      Hack Features:
      - Cheat Engine Enabled


      iOS Hack Download Link: https://iosgods.com/topic/115337-arm64-family-island-%E2%80%94-farm-game-v20190824862-jailed-cheats-1/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 2,312 replies
    • Eternium Cheats v1.38.22 +11
      Modded/Hacked App: Eternium By Making Fun, Inc.
      Bundle ID: com.makingfun.mageandminions
      iTunes Store Link: https://apps.apple.com/us/app/eternium/id579931356?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

      - 5K Gems When Completed Stage
      - Infinite Gold
      - Infinite Cosmetic
      - Infinite Yellow Stone
      - Multiply Attack (Linked with Enemy)
      - No Skills Cooldown
      - No Consumable Cooldown
      - Multiply Attack Speed
      - Instant Regen Health
      - Always Crit
      - Material Drops (When you killed an Enemy it will drop materials for crafts)



      ⬇️ iOS Hack Download Link: https://iosgods.com/topic/194526-eternium-cheats-v13355-6/
        • Informative
        • Agree
        • Winner
      • 85 replies
    • Bloody Bastards Cheats v4.2.2 +2
      Modded/Hacked App: Bloody Bastards By Tibith Ltd
      Bundle ID: com.tibith.badboxing2
      iTunes Store Link: https://apps.apple.com/us/app/bloody-bastards/id1593430099?uo=4


      Hack Features:
      - Infinite Coins
      - Dumb Enemy (Single Player)


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/topic/158327-bloody-bastards-v315-jailed-cheats-1/


      iOS Hack Download Link: https://iosgods.com/topic/158325-bloody-bastards-cheats-v315-2/
        • Like
      • 159 replies
    • Westland Survival - Cowboy RPG v10.0 +7 [ Items Cheat ]
      Modded/Hacked App: Westland Survival - Cowboy RPG By HELIO LTD
      Bundle ID: com.heliogames.a1
      iTunes Store Link: https://apps.apple.com/us/app/westland-survival-cowboy-rpg/id1339238576?uo=4


      Hack Features:
      - Unlimited Energy / Instant Energy Refills
      - Unlock All Blueprints
      - Items Duplicate When Split / Items Hack
      - Unlimited Consumable Items
      - Unlimited Item Durability
      - God Mode / Never Die -> Linked with enemies. Useful for looting.
      - One Hit Kill / High Damage -> Linked with enemies. Use with caution.


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
        • Thanks
        • Winner
        • Like
      • 421 replies
    • Grand Mountain Adventure 2 v1.0405 Jailed Cheats +1
      Modded/Hacked App: Grand Mountain Adventure 2 By Toppluva AB
      Bundle ID: com.toppluva.grandmountain2
      iTunes Store Link: https://apps.apple.com/us/app/grand-mountain-adventure-2/id6475040075?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

      - Free iAP (Press cancel when Buy) -- Turn on cheat option inside iOSGods Menu first

       

      ⬇️ iOS Hack Download IPA Link: https://iosgods.com/topic/192158-grand-mountain-adventure-2-v1018-jailed-cheats-1/
        • Thanks
        • Like
      • 53 replies
    • Jurassic World Alive v3.14.66 - [ Dino Don't Move & More ]
      Modded/Hacked App: Jurassic World Alive By Ludia
      Bundle ID: com.ludia.jw2
      iTunes Store Link: https://apps.apple.com/us/app/jurassic-world-alive/id1231085864


      Hack Features:
      - Dino Don't Move
      - Inf. Battery
      - VIP Enabled

      This hack is an In-Game Mod Menu (iGMM). In order to activate the Mod Menu, tap on the iOSGods button found inside the app. This hack works on the latest x64 or ARM64 iDevices: iPhone 5s, 6, 6 Plus, 6s, 6s Plus, 7, 7 Plus, 8, 8 Plus, X, Xr, Xs, Xs Max, SE, iPod Touch 6G, iPad Air, Air 2, Pro & iPad Mini 2, 3, 4 and later.
        • Agree
        • Like
      • 1,692 replies
    • Car Match - Traffic Puzzle v2.61 +4 Jailed Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Car Match - Traffic Puzzle By GRAND GAMES OYUN VE YAZILIM ANONIM SIRKETI
      Bundle ID: com.grandgames.carmatch
      App Store Link: https://apps.apple.com/us/app/car-match-traffic-puzzle/id6504421808?uo=4

       
       

      🤩 Hack Features

      - Freeze Currencies
      - Unlimited Currencies -> Will increase instead of decrease.
      - Auto Win -> Quit the level.
      - Level Modifier
      • 1 reply
    • Car Match - Traffic Puzzle v2.61 +4 Cheats [ Unlimited Currencies ]
      Modded/Hacked App: Car Match - Traffic Puzzle By GRAND GAMES OYUN VE YAZILIM ANONIM SIRKETI
      Bundle ID: com.grandgames.carmatch
      App Store Link: https://apps.apple.com/us/app/car-match-traffic-puzzle/id6504421808?uo=4

       
       

      🤩 Hack Features

      - Freeze Currencies
      - Unlimited Currencies -> Will increase instead of decrease.
      - Auto Win -> Quit the level.
      - Level Modifier
      • 0 replies
    • Last War:Survival v1.0.300 [+1 Jailed Cheats]
      Modded/Hacked App: Last War:Survival By FUNFLY PTE. LTD.
      Bundle ID: com.lastwar.ios
      App Store Link: https://apps.apple.com/us/app/last-war-survival/id6448786147?uo=4



      Important


      Only work on Pve contents

      Enable on loading screen!

       

      🤩 Hack Features

      - Never Die
       
        • Thanks
        • Winner
        • Like
      • 17 replies
    • Last War:Survival v1.0.300 [+1 Cheats]
      Modded/Hacked App: Last War:Survival By FUNFLY PTE. LTD.
      Bundle ID: com.lastwar.ios
      App Store Link: https://apps.apple.com/us/app/last-war-survival/id6448786147?uo=4



      Important


      Only work on Pve contents

      Enable on loading screen!

       

       

      🤩 Hack Features

      - Never Die
       
        • Thanks
      • 23 replies
    • Dawn of Ages: Medieval Games v2.0.7 +5 Jailed Cheats [ Damage & Defence ]
      Modded/Hacked App: Dawn of Ages: total war battle By BoomBit, Inc.
      Bundle ID: com.stratospheregames.dawnofages
      App Store Link: https://apps.apple.com/us/app/dawn-of-ages-total-war-battle/id6477473268?uo=4

       


      🤩 Hack Features

      - Damage Multiplier
      - Defence Multiplier
      - God Mode
      - Dumb Enemy
      - Premium Enabled
      • 8 replies
    • Disney Speedstorm v1.13.0 +1 Jailed Cheat [ Unlimited Nitro ]
      Modded/Hacked App: Disney Speedstorm By Gameloft
      Bundle ID: com.gameloft.disneyspeedstorm
      iTunes Store Link: https://apps.apple.com/us/app/disney-speedstorm/id6449708682?uo=4


      Hack Features:
      - Unlimited Nitro -> Will not decrease.
      - Instant Nitro Max


      Jailbreak required hack(s): [Mod Menu Hack] Disney Speedstorm v1.5.0 +2 Cheats [ Unlimited Nitro ] - Free Jailbroken Cydia Cheats - iOSGods
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/
      • 85 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