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

    • Heroes vs. Hordes: Survivor v5.1.3 [ +11 Cheats ] Currency Max
      Modded/Hacked App: Heroes vs. Hordes: Survivor By Swift Games GmbH
      Bundle ID: com.swiftgames.roguelikesurvival
      iTunes Store Link: https://apps.apple.com/us/app/heroes-vs-hordes-survivor/id1608898173?uo=4

       
      Hack Features

      - Currency

      - Resource

      - Gold Unlimited [ Bonus Wave ]

      - Ch Unlocked [ Play All Off ]

      - Always Last Wave

      - Talents Cost 0

      - Hero DMG Only

      - HP & DMG [ Just Equip & Unequip ]

      - Enemy Freeze

      - Enemy ATK NO

       
      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/
        • Agree
        • Thanks
        • Winner
        • Like
      • 70 replies
    • Heroes vs. Hordes: Survivor v5.1.3 [ +11 Jailed ] Currency Max
      Modded/Hacked App: Heroes vs. Hordes: Survivor By Swift Games GmbH
      Bundle ID: com.swiftgames.roguelikesurvival
      iTunes Store Link: https://apps.apple.com/us/app/heroes-vs-hordes-survivor/id1608898173?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

      - Currency

      - Resource

      - Gold Unlimited [ Bonus Wave ]

      - Ch Unlocked [ Play All Off ]

      - Always Last Wave

      - Talents Cost 0

      - Hero DMG Only

      - HP & DMG [ Just Equip & Unequip ]

      - Enemy Freeze

      - Enemy ATK NO


      Jailbreak required iOS hacks: https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APKs: https://iosgods.com/forum/68-android-section/

       

      iOS Hack Download IPA Link


      Hidden Content

      Download via the iOSGods App
        • Agree
        • Thanks
        • Winner
        • Like
      • 85 replies
    • Merge & Blast: Dream Island v2.22.1 [ +2 Cheats ] Auto Win
      Modded/Hacked App: Merge & Blast: Dream Island By Dreamo, Inc.
      Bundle ID: com.dreamo.woodyblast
      iTunes Store Link: https://apps.apple.com/us/app/merge-blast-dream-island/id1668748189?uo=4


      🤩 Hack Features

      - Auto Win
      - Coin + Moves [ Disable After Get ]




      🍏 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/
        • Like
      • 13 replies
    • Merge & Blast: Dream Island v2.22.1 [ +2 Jailed ] Auto Win
      Modded/Hacked App: Merge & Blast: Dream Island By Dreamo, Inc.
      Bundle ID: com.dreamo.woodyblast
      iTunes Store Link: https://apps.apple.com/us/app/merge-blast-dream-island/id1668748189?uo=4

       

      🤩 Hack Features

      - Auto Win
      - Coin + Moves [ Disable After Get ]




      🍏 Jailbreak iOS hacks: https://iosgods.com/forum/5-game-cheats-hack-requests/
      🤖 Modded Android APKs: https://iosgods.com/forum/68-android-section/
      • 18 replies
    • Merge Cruise: Mystery Puzzle v0.36.360 [ +2 Cheats ] Currency Max
      Modded/Hacked App: Merge Cruise: Mystery Puzzle By STUDIO PEERPLAY GAMES LTD
      Bundle ID: com.peerplay.megamerge
      iTunes Store Link: https://apps.apple.com/us/app/merge-cruise-mystery-puzzle/id6459056553?uo=4
       

      🤩 Hack Features

      - Cash
      - Energy

        • Agree
        • Haha
        • Thanks
        • Like
      • 13 replies
    • Merge Cruise: Mystery Puzzle v0.36.360 [ +2 Jailed ] Currency Max
      Modded/Hacked App: Merge Cruise: Mystery Puzzle By STUDIO PEERPLAY GAMES LTD
      Bundle ID: com.peerplay.megamerge
      iTunes Store Link: https://apps.apple.com/us/app/merge-cruise-mystery-puzzle/id6459056553?uo=4
       

      🤩 Hack Features

      - Cash
      - Energy

        • Winner
        • Like
      • 17 replies
    • Pop Island v1.0.8 [ +1 Cheats ] Coins Max
      Modded/Hacked App: Pop Island By HISTAR INTERACTIVE PTE. LTD.
      Bundle ID: com.hmbdgames.match
      iTunes Store Link: https://apps.apple.com/us/app/pop-island/id6505047210?uo=4


      🤩 Hack Features

      - Coins [ Win Match Disable After Hack ]


        • Agree
        • Like
      • 13 replies
    • Pop Island v1.0.8 [ +1 Jailed ] Coins Max
      Modded/Hacked App: Pop Island By HISTAR INTERACTIVE PTE. LTD.
      Bundle ID: com.hmbdgames.match
      iTunes Store Link: https://apps.apple.com/us/app/pop-island/id6505047210?uo=4


      🤩 Hack Features

      - Coins [ Win Match Disable After Hack ]


        • Winner
        • Like
      • 12 replies
    • Survivor Kingdoms V3.23 [ +11 Cheats ] Easy Win
      Modded/Hacked App: Survivor Kingdoms By Gamee Joint Stock Company
      Bundle ID: com.gamee.kingdoms.survivor.io
      iTunes Store Link: https://apps.apple.com/us/app/survivor-kingdoms/id6444824577?uo=4


      Hack Features:
      - IAP Free [ Buy Anything ]

      - Health

      - Damage

      - Skill CD Slow

      - Skill CD Fast [ Maybe Game Slow ]

      - Skill Size Big

      - Shooting Speed Fast

      - Movement Speed

      - Auto Revive Unlimited [ Never Die ]

      - Ultimate Power CD

      - Avatar & Frame 


      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/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 41 replies
    • Survivor Kingdoms V3.23 [ +11 Jailed ] Easy Win
      Modded/Hacked App: Survivor Kingdoms By Gamee Joint Stock Company
      Bundle ID: com.gamee.kingdoms.survivor.io
      iTunes Store Link: https://apps.apple.com/us/app/survivor-kingdoms/id6444824577?uo=4

       

      🚀 Hack Features

      - IAP Free [ Buy Anything ]

      - Health

      - Damage

      - Skill CD Slow

      - Skill CD Fast [ Maybe Game Slow ]

      - Skill Size Big

      - Shooting Speed Fast

      - Movement Speed

      - Auto Revive Unlimited [ Never Die ]

      - Ultimate Power CD

      - Avatar & Frame 


      🍏 Jailbreak iOS hacks: https://iosgods.com/forum/5-game-cheats-hack-requests/
      🤖 Modded Android APKs: https://iosgods.com/forum/68-android-section/
        • Informative
        • Agree
        • Winner
        • Like
      • 26 replies
    • [ Seven Deadly Sins KR ] 일곱 개의 대죄: GRAND CROSS Cheats v8.6.71 +5
      Modded/Hacked App: 일곱 개의 대죄: GRAND CROSS By Netmarble Corporation
      Bundle ID: com.netmarble.nanakr
      iTunes Store Link: https://apps.apple.com/kr/app/%EC%9D%BC%EA%B3%B1-%EA%B0%9C%EC%9D%98-%EB%8C%80%EC%A3%84-grand-cross/id1449552940?uo=4


      Hack Features:
      - God Mode
      - One Hit Kill
      - Multiply Attack
      - Multiply Defense
      - Make Enemies God Mode for some quests


      iOS Hack Download Link: https://iosgods.com/topic/154899-seven-deadly-sins-kr-%EC%9D%BC%EA%B3%B1-%EA%B0%9C%EC%9D%98-%EB%8C%80%EC%A3%84-grand-cross-cheats-v750-5/
        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 174 replies
    • EverMerge: Merge & Match Game v1.62.3 +30 Jailed Cheats [ Cheat Menu ]
      Modded/Hacked App: EverMerge: Merge & Match Game By Big Fish Games, Inc
      Bundle ID: com.bigfishgames.mergetalesios
      iTunes Store Link: https://apps.apple.com/us/app/evermerge-merge-match-game/id1446344746?uo=4

       


      🚀 Hack Features

      - Cheat Menu -> Head into Settings and toggle the Support button.
        • Like
      • 5 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