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
1 answer

ignoring a range of items from an nsarray

I have an NSArray of unknown items. I know there will always be more than 10 items. I would like to assign all but the first 10 items to an NSString. Something like: NSString *itemString = (NSString*)[itemArray StartingIndex:10]; Is there a…
Abbacore
  • 385
  • 1
  • 3
  • 8
1
vote
1 answer

Issue facing in isKindOfClass in iOS10

Recently I have upgraded XCode8 I am facing issue in isKindOfClass method this code is working till to iOS9 but in iOS10 suddenly [items isKindOfClass: [NSMutableArray class]] compiler not going in for loop condition may I know what is the reason?…
Mayank Patel
  • 3,868
  • 10
  • 36
  • 59
1
vote
0 answers

filter multi level array which contains custom class object using NSPredicate

I have one NSMutalbeArray which contains another two array one has string value and another has NSMutableArray of custom object Custom Class @interface Message : NSObject @property (nonatomic,strong) NSString *strMessgaeID; @property…
Dhaval Dobariya
  • 171
  • 1
  • 12
1
vote
1 answer

How to create JSON from array and map in Android?

In iOS if I have arrays and maps nested, I can call NSJSONSerialization.dataWithJSONObject method, and it will render it to a JSON string. For map, or NSDictionary I can use the setValueForKey method, for array, or NSArray I can use add method to…
János
  • 32,867
  • 38
  • 193
  • 353
1
vote
3 answers

How to convert UIImage into byte array in objective-c

I am converting UIImageinto byte like this NSUInteger len = [imageData length]; Byte *byteData= (Byte*)malloc(len); memcpy(byteData, [imageData bytes], len); when I print this byteData in log I see a value like this. (lldb) po…
Irrd
  • 325
  • 1
  • 6
  • 18
1
vote
3 answers

Where to store a small NSArray of NSDictionaries? Not in my yard!

I have a UITableView with some login form and I manually wrote the configuration values of the UITextFields in this NSArray as NSDictionaries. It is bothering because it's data in the code. I don't want data in my code! And I think that nobody wants…
gurghet
  • 7,591
  • 4
  • 36
  • 63
1
vote
0 answers

No NSArray being used, but getting "fatal error: NSArray element failed to match the Swift Array Element type"

I'm using Swift 3 in Xcode 8 beta 6, targeting iOS 10.0. I am implementing a simple UISearchController in a UITableView backed with an NSFetchedResultsController. I have two properties var patients = [Patient]() // Assigned to…
jjatie
  • 5,152
  • 5
  • 34
  • 56
1
vote
1 answer

I need to remove double quotes from JSON for use in NSDictionary

I have a JSON return that I'm trying to save into a NSDictionary, However, Since there are spaces in the data being returned, the Dictionary won't save this array because of the quote being included. Is there a way to parse the SBJSON to remove the…
Michael Robinson
  • 1,439
  • 2
  • 16
  • 23
1
vote
2 answers

How to use web request results (xml, plist, etc) as a datasource for UITableView

I want to use coldfusion web query results to populate a UITableView in iOS. The query results come back as a string and I guess I need to convert them to NSArray or NSDictionary... Thanks, Phill
phill2k12
  • 59
  • 1
  • 2
1
vote
0 answers

NSString convert to NSArray based on text or special Characters

All, I have requirement of getting a Array from NSString for Example I have String NSString* aStr = @""This is test" Test "Test This""; Now In Array i need in below format "This is Test", Test, "Test This" How can we do this
kiri
  • 1,977
  • 5
  • 27
  • 55
1
vote
1 answer

removeAtIndex and removeObjectAtIndex is missing in autosugesion in latest xcode

Hello I am working on swift. I want to delete a row from tableView. The problem is that there is no option of remove object from an array is coming in autosuggestion. is there any other method apple has introduced to delete a row. I can't find these…
hellosheikh
  • 2,929
  • 8
  • 49
  • 115
1
vote
1 answer

Separate array of strings by several arrays

I have an array, that consist of following strings: [NSString stringByAppendingFormat:@"

%@%@%@%@

", wrappingBy, pack1, pack2, strFirmName]; For example, it have…
Evgeniy Kleban
  • 6,794
  • 13
  • 54
  • 107
1
vote
2 answers

NSArray valueForKey:@"@max.self"?

I have an Array of numbers in which I want to find the highest value. I am doing this as follows: NSNumber *test = [fuelConsumption valueForKey:@"@max.self"]; When I Build then Run, I am presented with the following error: Terminating app due to…
Fritzables
  • 257
  • 1
  • 4
  • 10
1
vote
2 answers

Swift JSON Object for Key Nested Arrays and/or Dictionaries

I am a student, and hoping I am using the correct terminology. I need to get to the "descriptions" key in order to populate Label.text. I am able to Pull "results", but nothing else I was able to achieve this, but was getting a subscript error when…
1
vote
1 answer

NSPredicate ( nsdictionary+array+nsdictionary)

I have try to NSPredicate but all time get response 0. check blow code and provide your suggestion where going fault. soureceArray:- { CityId = 0; TreatmentProgramServices = ( { TreatmentServicesId = 9; …
shiv
  • 39
  • 8