Questions tagged [nsarray]

An immutable, integer-indexed array of objects from the Apple Foundation framework.

An NSArray object manages an immutable array; once you have created the array, you cannot add, remove, or replace the objects in the array. You can, however, modify the individual elements themselves (if they support modification). The mutability of the collection does not affect the mutability of the objects inside the collection. You should use an immutable array if your data rarely changes, or changes all at once. Consider using a mutable array () if your data changes frequently.

Resources:

5346 questions
1
vote
2 answers

Initializing multidimensional NSArray for iPhone devel

I'm starting with iPhone development and I need to use a multidimensional array. I initialize it using: NSArray *multi=[NSArray arrayWithObjects:[NSMutableArray arrayWithCapacity:13], [NSMutableArray array],nil]; But when I try to assign…
Cris
  • 12,124
  • 27
  • 92
  • 159
1
vote
0 answers

Animate Gradient View iOS on Linear path using

I am trying to animate a gradient layer continuously. Please see the below gif? I am using CAGradientLayer, but it only animates on color at a time. var gradient: CAGradientLayer! self.gradient = CAGradientLayer() self.gradient.frame = CGRect(x: 0,…
CapeFurSeal
  • 183
  • 2
  • 13
1
vote
1 answer

How does the objective-c SBJson library map an array? (do you recommend it?)

SBJsonParser *parser = [[SBJsonParser alloc] init]; NSMutableArray *componenti = [parser objectWithString:@"[\"Item1\",\"Item2\"]"]; NSAssert([componenti isMemberOfClass:[NSMutableArray class]],@"err"); This code…
gurghet
  • 7,591
  • 4
  • 36
  • 63
1
vote
2 answers

Display array from a value in the array

So if I have a array that look like this: var myArray = ["BMW", "Toyota", "Ford", "Lamborghini", "Ferrari", "Lada"] I want to display the value inside the array after "Ford", so BMW, Toyota and Ford doesn't show up.. How can I do this?
Roduck Nickes
  • 1,021
  • 2
  • 15
  • 41
1
vote
2 answers

Extracting data from NSArray

My php script sends a JSON response to my swift iOS app in the format shown below. This is parsed as an NSArray using the following code : let jsonArray = try NSJSONSerialization.JSONObjectWithData(data_fixed!, options:[]) I have created the…
Alk
  • 5,215
  • 8
  • 47
  • 116
1
vote
1 answer

How to sort array of dictionaries by date using sort descriptor

I have an array of dictionaries where dictionary is like this. Rows = ( "", "" ); Sections = ""; Here DriverRowRecord and…
siva krishna
  • 1,149
  • 2
  • 15
  • 23
1
vote
2 answers

Better way to compare custom objects of two NSArray and list out distinct objects in those array's

I have a model object called car which has following attributes Name Color Type In an array(Name: oldArray) I have several car objects. In a common Interval I will hit an API and get an another array (Name: newArray) of several car object. I need…
Peer Mohamed Thabib
  • 636
  • 2
  • 9
  • 29
1
vote
1 answer

What's making NSArray access so slow?

I'm working up a graphics effect for an iPhone app that simulates a low-res plasma effect from old demoscene days. I've got 600 squares on screen that are updating as fast as possible. Since I am using CoreGraphics (for now), I can get a very…
avance
  • 1,993
  • 2
  • 21
  • 23
1
vote
4 answers

sorting mutable array in alphabetical order

I am having a nsmutable array and in that nearly 50 -60 object having different names ,and can i sort this array in alphabetical order (Is it possible, How?)
mrugen munshi
  • 3,497
  • 9
  • 36
  • 50
1
vote
3 answers

UIImageView animation is not working

I am working on the UIImageView transition in swift. I an storing six images in an array and giving that array to “imageview.animationImages ” and I am trying to making it to work as ‘Gif animation’ the code I wrote is as follows : logoImages =…
anusha hrithi
  • 709
  • 2
  • 9
  • 13
1
vote
2 answers

How to add Image with a NSDictionary and send the List of Array to server using POST method in iOS

I'm working on a project where I need to add multiple NSDictionary object's into an NSArray and that NSArray need to be send to server using the POST request . For this I'm using AFNetworking framework . Well every thing worked fine till the time I…
SBK
  • 11
  • 6
1
vote
1 answer

NSArray from NSString (in plist format)

I use NSURLConnection to get the contents of a plist file from a remote server. On connection:didRecieveData: I add the latest data to an NSMutableString. Now my problem is adding this data to an array. So you have arrayWithContentsOfURL - which is…
Thomas Clayson
  • 29,657
  • 26
  • 147
  • 224
1
vote
1 answer

Creating Person Class with Objective-C

I'm starting to learn Objective-C and I want to create a simple Person class with name, photo, address (house number, street name, postal code, city), phone. I'm not sure if I have to use NSArray or NSDictionary for the address attribute. I already…
Nedim
  • 127
  • 1
  • 2
  • 11
1
vote
3 answers

UITableViewCell Nib From NSString

I am trying to change the custom cell that will be used depending on information stored in my array. I have tried everything but cannot seem to get it working without an error. The code does not seem to accept a string input for the cell nib. Is…
Curtis Boylan
  • 827
  • 1
  • 7
  • 23
1
vote
2 answers

Setting data in correct JSON format using Array and Dictionary

Below is the model for which I have to set the data. I am using array and dictionary to achieve this, Here is the code which I tried. But its giving me the output which is invalid JSON. One more thing I want to ask is why the log of an array starts…
Kunal Kumar
  • 1,722
  • 1
  • 17
  • 32
1 2 3
99
100