I'm quite blank when it comes to swift, I've been developing using Obj-c. But a tutorial that I've been following uses Swift. Can anyone help me convert the following line of Swift into Objective-C. It's basically to load a String onto an Array.
self.iDArray.append(objectIDs[i].valueForKey("objectId") as! String)
Should be
However, the Swift code is force-casting
[objectIDs[1].valueForKey: @"objectID"]
to type String (A Swift string).That suggests to me that self.iDArray may be a Swift array. Swift arrays normally contain only a single type. You create an array of String objects, or an array of Dictionary objects. You can also create an array of
AnyObject
.NSArray is an array of
id
type.I'm not 100% positive how to force-cast to String type in Objective-C. maybe: