Questions for nsarray


8155

sorting an NSArray of NSDates

I have an NSArray of NSDate objects and I want to sort them so that today is at 0, yesterday at 1 etc.
345

Is it ok to re-sort an array each time you need to access an element at a specific index?

I have a TableViewController that displays a list of elements CoreData relationship. In my cellForRowAtIndexPath:, I am getting a sortedArray from the set and then accessing the element at indexPat...
700

Filter and NSDictionary of NSArray of NSDictionary's

I have an NSDictionary which contains some 150 keys of boiler manufacturers. The value for each key is an NSArray of an NSDictionary. Each NSDictionary represents a boiler with some properties:
4812

NSArray -initWithObjects: does not store objects

I'm getting a really bizarre output from that contructor. It does not actually store any of the objects. I debugged the method and the objects being stored are initialized properly.
8300

Edit plist in objective c

I have a plist file and i want edit this file, but setObject() in NSDictionary dont operate, my code is:
369

Filter NSArray of custom objects

I have a NSArray of Contact objects, we can call it contacts. Contact is a superclass, FacebookGroup and Individual are subclasses of Contact. FacebookGroup has a property called individuals which...
7457

How to add objects to IBOutletCollection?

I declared NSArray in my class
4883

key values from an NSDictionary formatting with “()”

I'm trying to pull two values from this Dictionary, But the values I'm getting have "()" around them. Any Ideas what is causing this?
2005

removeObjectsAtIndexes causing a crash

Can't figure out whats causing the crash here. Im enumerating over a NSMutableArray and placing the indexes of certain objects into a mutable index set, then attempting to remove the corresponding
9775

How do I get the startDate of an event that is already on my iPhone's calendar?

I am making an app for myself and I need to access the startDate and endDate of specific events that are already in my calendar. How can I go about doing this? I have tried storing a list of events...
8732

Objective C - Subclassing NSArray

I am trying to subclass NSArray, but it crashes the app when trying to access the count method. I know that NSArray is a class cluster.
9917
8809

Search NSArray of NSDictionaries

I have an array with dictionaries,
126

how do I sort the result of @distinctUnionOfObjects?

I am using the following code to get my unique order types:
2655

What is the BOOL *stop argument for enumerateObjectsUsingBlock: used for?

I've been using enumerateObjectsUsingBlock: a lot lately for my fast-enumeration needs, and I'm having a hard time understanding the usage of BOOL *stop in the enumeration block.
4979

NSMutablearray move object from index to index

I have a UItableview with reordable rows and the data is in an NSarray. So how do I move an object in the NSMutablearray when the appropriate tableview delegate is called?
4749

NSArray removeObjectAtIndex Error

I am using the following code to check whether an object exists or not before removing it if it does:
2676

iOS: get 3 different random elements from an NSMutableArray

I have a NSMutableArray of N Integer elements (N>4), I want to get 3 different random elements from this array. I do not really need a perfectly-uniform distribution, just 3 different random elements
7881

saving array to disk in a singleton

I have a singleton which has an NSArray that is created when the first instance of the singleton is. When should I save this array to disk, in dealloc method? I checked the Apple docs and its says...
9185

Store App names in NSArray from JSON DATA which Stored in NSDictionary

I have retrive following response form Server in JSON format which I have sucessfully store in NSDictionary.
4201

IOS get object from NSArray

I am developing an IOS application. How can I get the object from NSArray list. What is the best way to avoid getting memory error? Can you tell me the correct method? Thanks
2995

Filtering NSArray string elements

So, basically I have an NSArray.
9455

Assign string values to a NSArray - iOS

I have an iOS app which downloads/parses strings from a JSON file. I need to store these strings in ONE NSArray. But every time I try I get the error:
3196

Dynamically create NSString from NSArray - NSXMLParser

I have a class that implements methods from NSXMLParser and parses an XML document. Since class will be used to parse several xml documents, the keys passed into my class will change.
9402

Split String into Array Objects

I am getting response from web-service like this
9613

Delete or clear ALL data objects in UITableView with alert button?

OK, I really have searched through the topics that seem to cover this but still have not found one that works for me. This list is made by sending every UIWebView page load here. At some point if the
9682

NSArray: Why is SIGABRT sent instead of an 'index out of bounds' kind of error?

Ok. So I had this extremely weird SIGABRT error on a complex Objective-C iOS program that I'm working on, and after one day of tracking I found the culprit.
4798

Performing valueForKeyPaths against multiple keyPaths

Let's say I have an object with some number of properties and I load up 1000s of these objects into an array. Next, I perform a series of valueForKeyPaths against these properties:
6743

Get all the objects inside an NSArray whose string property starts with a particular letter

I have an NSArray containing instances of MyCustomObject; each has a NSString called firstName.
7990
8253

Saving addressbookUI data to an array

I'm trying to save the kABFirstNamePropert, kABLastNameProperty and kABAddressProperty all saved into an array for recall later, I'm just not getting it, can anyone lend me a hand or point me in the
8575

NSArray sort and isolate

I have an NSArray of names, I want to sort them alphabetically into a UITableView and separate them into sections.
2079

How do I check if an object exists at a certain index of an NSMutableArray?

For instance, how could I verify if there is an item at the index 3?
8153

removing one object from nsarray removes all

I have an nsarray of distinct nsmutablearray's called: playerSkillsByLevelSnapshots. At the beginning of the code below the array contains 6 objects.
7279

initWithArray vs initWithArray copyItems

I have a question what's the difference between these two methods on initializing an array?
161

Compare every object of an array with every other object

I am trying to crate an if statement like this:
8252

How to Fix EXC_BAD_ACCESS on NSArray Property?

This is yet another EXC_BAD_ACCESS question. Although I've done my homework and am certain that I am not over-releasing my NSArray.
9974

my xmlDictionary its allway (null)

im trying to get the same value on xmlDictionary and dicionarioXML but, my dicionarioXML its allway (null), any help?
6620

Is there a way to get an easy overview of an NSArray?

I'm getting an NSArray filled with something from a helper class. I have a small clue that it might contain NSDictionarys. But i'm not sure. I tried to save the array to a plist but it didn't work
9829

Sorting Array of Objects by Date into TableView

I used this answer to sort 2 objects by date, and it worked perfectly: Get one NSArray
6546

re-populating a tableview with new array elements when a cell is clicked in swift

thanks for all the help so far. I need, when a cell in UITableView is clicked, to re-populate the view with an array read from another class - just can find a way to refresh the view. Code as follo...
6972
1978

IOS - Add subview to certain UICollectionView Cells only

This is the flow of my app: I have UICollectionview with thumbnails of images. User selects images and taps on Save button. Images get saved to camera roll.
9763

Objective C, iOS, how do I attach a couple of int variables to UIImageView which is part of an IBOutletCollection?

I need to keep track of some image views which can be dragged around the screen and located within other images views. For example footballs in goals. I'd like to do this by having some extra prope...
7847

how can i create plist like below in image?

Iam trying to create a plist with following feature.
9247

Implementation of NSArray

How is a NSArray implemented, is it similar to std::vector.
2536

data from txt file to NSArray

What I would like to do is the following:
2051

What is the most elegant way to get a subarray from a NSArray?

In Python I can get a subarray easily like this
4680

How would I convert an NSMutableArray filled of UNIX dates to standard dates?

I have an NSMutableArray filled up of UNIX dates (1305410327), and I want to convert all of them to readable dates like Fri, 06 Feb 2009 07:28:06 +0000. I'm so lost and this is the code I have:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.