Jump to content

6 posts in this topic

Recommended Posts

Posted

https://gyazo.com/697ffc462b8cddc2b966b7e3c4e17b0c

 

 

Hey, so I am trying to make (NSString *)groups equal all of the strings in the picture, but for some reason it only recognizes one, ive tried doing @"", @"", @"" etc etc, but i get an unused @ error, so, how would i make it equal all of those strings :? sorry for the confusing question, but i was thinking of making an array?

Posted (edited)

https://gyazo.com/697ffc462b8cddc2b966b7e3c4e17b0c

 

 

Hey, so I am trying to make (NSString *)groups equal all of the strings in the picture, but for some reason it only recognizes one, ive tried doing @"", @"", @"" etc etc, but i get an unused @ error, so, how would i make it equal all of those strings :? sorry for the confusing question, but i was thinking of making an array?

Yes. You would need to make an NSArray to store multiple strings. Then if you need to retrieve data from it, you would use getter methods.

You could also retrieve data by enumerating through the array with a 'for' loop

Updated by KingRalph
Posted

You almost did it right. Don't use 'group =' before every string but seperate them with a comma. If you want to make it equal you would need '==' by the way

Posted (edited)

@niro Now that I think about it, if you store multiple strings in an argument, how do you plan on accessing them? O.o

 

With a huge amount of effort which would never be worth it..

 

Just use an array, nobody uses strings in the way you're attempting to @niro. What you're trying to do with one string is possible, just its not feasible. With an array you can store each variation of the strings "groups" as its own element and then call said element(s) when needed with ease.

Updated by alphaMatterr
Posted

With a huge amount of effort which would never be worth it..

 

Just use an array, nobody uses strings in the way you're attempting to @niro. What you're trying to do with one string is possible, just its not feasible. With an array you can store each variation of the strings "groups" as its own element and then call said element(s) when needed with ease.

Tru dat. Also, it's easy to iterate through all indexes an array with a for loop. An if you plan on modifying the string, you're going to have a really tough time doing that.

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
×
  • 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