Click here to Skip to main content
15,883,922 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,
I want to create an array where the data is coming from callback. so need to create an array with all the values i got from the callback. this is used to display in fronted UI in iOS using Swift.

Thanks for the help....
Posted
Comments
Sergey Alexandrovich Kryukov 25-Dec-14 1:41am    
You did not even indicate what language you are using...
—SA
N.Ravi Raj 25-Dec-14 1:57am    
Sorry for that. Its in Swift Language IOS and i am using Xcode for developing.
Sergey Alexandrovich Kryukov 25-Dec-14 11:31am    
Nothing to sorry about; I'm sorry; this is my fault that I forgot that there is such language as Swift, which I'm almost unfamiliar with.
—SA

1 solution

As you can see from original documentation, Swift arrays are very flexible, so you can add elements to the array using the method append or the operator '+=': https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/CollectionTypes.html[^].

This way, you can add the data which comes from your callback (whatever it is) as array elements.

—SA
 
Share this answer
 
Comments
Volynsky Alex 25-Dec-14 15:34pm    
Nice Sergey Alexandrovich!
Sergey Alexandrovich Kryukov 25-Dec-14 16:29pm    
Thank you, Alex, but it's not much; I have a very vague idea how to use this language. :-)
—SA
Volynsky Alex 25-Dec-14 17:51pm    
In my opinion, this language is a little easier than the Objective-C language. It's good for game creation, for example

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900