nsmutablearray

Failing to remove items from mutable array

in my previous question i was given some code in order to make up this statment. favoriteArray is an Mutable Array... if (![self.favoritesArray containsObject:@"added"]) { [self.favoritesArray addObject:@"added"]; } else { [self.favoritesArray removeObject:@"added"]; } //NSUInteger newRow = [self.favoritesArray cou...

NsMutable array retain count

Hey, i used the instruments to find leaks in my iphone app and i found that i have leak in this line in my code tableViewController.dataSource = [[NSMutableArray alloc] initWithArray:[subjects_dic allKeys]]; the property dataSource defined as retain. is this a mistake ?! ...

How to use containsObject in NSMutableArray

Hi everyone, I am trying to find if there is any object in the mutable array that matches with the object I pass. Please see the function below. The name comes from table view controller, so the row that is tapped is saved into name and passed to this function. I am trying to check whether the name in the table view controller equals t...

Filling an NSMutableArray with a Set of Classes and Then Getting them Back

Hi, Hopefully I can make this clear, but I am new to Objective-C and to be honest not great with Arrays in the first place. So, I have a Singleton class (called SingletonState) that I am using to pass variables around my app (please can we leave the whether I should use Singleton classes out of this - I will fix that later). In this c...

Sort NSMutableArray

please help me I want to sort NSMutableArray and yes I can do this by NSSortDescriptor *sortPoint = [[NSSortDescriptor alloc] initWithKey:@"point" ascending:YES]; [hightScore sortUsingDescriptors:[NSArray arrayWithObject:sortPoint]]; but in NSMuatableArray(hightScore), I have 2 NSMutableDictionary like this [item setObject:@"player_n...

how to convert NSString to NSMutableArray?

hi, i have an NSString that is value in plist format. i download this string from url. but i dont wanna write it to a file. when the string comes Asynchronous, i want to put it to nsmutablearray. how can i convert string (in plist format) to nsmutablearray? there is some methods, initWithContentsOfURL, initWithContentsOfFile. but no inti...

How to bind 2 NSMutableArray?

hi, i have 2 NSMutableArray with same type. i want to add second nsmutablearray to first one. NSMutableArray *tmpArray1 (10 objects in it) NSMutableArray *tmpArray2 (10 objects in it) if i use [tmpArray1 addobject:tmparray2]; tmpArray1's count goes to 11. but i want to append tmparray2 to firstone. count must be 20. thanks... ...

Cannot addObject into a NSMutableArray?

Hi, everyone, I have a question about the objective-C. I use the following code to add a contains from an array to another array. However, the second array is null. Can anyone help me? Thank you. titleArray = [[csvDataArrayString objectAtIndex:0] componentsSeparatedByString:@","]; NSString *title; dataTitleArray = [[NSMutableArray al...

Why isn't this NSMutableArray getting populated?

I have an NSMutableArray I am trying to populate using a for-loop and making NSStrings for it. These are to be the data source for my UIPickerView. You'll see some commented out lines where I manually made NSArrays and they showed up fine, but my for-loop NSMutableArray doesn't seem to accept the strings I'm making. The NSLogs show th...

Convert quoted strings in a CSV to an NSMutableArray without the quotes.

Hi, everyone, I have a question about the objective C. I have the following NSString *name shown below: "First Name","Second Name","Last Name"; Actually, name is the header of the CSV and receive from the URL. And I use the follow statement to break the statement to array. NSMutableArray *csvTitleArray; csvTitleArray = [[name compo...

Sort Date[dd/MM/yyyy] which is in NSString data type inside an array in Objective-C for iPhone

Hello, I have an NSMutableArray which holds the dates in format dd/MM/yyyy of type NSString. Now i need to display the sorted array of dates. Please suggest me how to achieve it. Thank You. ...

Is "removeAllObjects" supposed to release?

I decided to start using removeAllObjects so that I could re-use some of my NSMutableArrays. However, I am finding that the call to removeAllObjects causes the array to get released and so it crashes when the viewController is displayed for the second time. I've looked on the web and it seems that some people are saying that removeAllOb...

Remove an object in NSMutableArray?

I have a NSMutableArray like this: NSMutableArray *array =...; (array contain my custom object) NSMutableArray *toRemove = [array getObjectsToRemove]; But when I try to call removeObjectsInArray ( [array removeObjectsInArray:toRemove]; ) it breaks my app! Can anybody tell me how to solve my problem :( ...

How to change a value inside a dictionary in an array that's inside a dictionary?

I have a plist dictionary with several arrays where each have different number of items. These items are dictionaries too. So basically it looks like this: Root dictionary names array places array Item 0 dictionary Item 1 dictionary placeName string: "House" description string: "My House" height number: 10 Item 2 dictionary ... colo...

Core Data not returning NSMutableArray property

Dear all I'm starting to feel rather stupid - I've browsed the site and found a few things that come close to my problem but just can't figure it out (help M. Zarra, after reading your book I felt pretty good about Core Data but now I'm at my wits' end!). Despite the expert's advice I've chosen to store an NSMutableArray as a transforma...

Getting EXC_BAD_ACCESS when trying to addObject to NSMutableArray

I have the following code: NSInteger phoneCount = ABMultiValueGetCount(phones); NSMutableArray *phoneKeys = [[[NSMutableArray alloc] init] autorelease]; NSMutableArray *phoneKeyValues = [[[NSMutableArray alloc] init] autorelease]; for(CFIndex i=0; i < phoneCount; i++) { //NSString *label = [(NSString *)ABMultiValueCopyLabelAtIndex(...

Reducing an array of objects to unique objects based on attributes

Ok. I have an array with multiple objects populated by my core data stack . Lets say each object has a name, startdate, enddate and amount attribute associated with them What I need to do is reduce this array down to only the unique objects (not just values) based on the name, which is an NSString. I've tried isEqual methods within fo...

Multiple NsfetchedResultsController on a UItableView

Hi guys! sorry if this is a noob question but i'm having difficulty implementing 2 nsfetchedresultsController in a tableView. i wanted a fetchedresultsController in each section of the table (2 sections), something like this: Wishlist product product2 Bought product3 I know that for this example i wouldn't need 2 nsfetchedResult...

iphone: Caching an NSMutableArray?

I'm currently writing a Twitter client for iPhone and need a way to cache the public timeline. The data fetched is stored as 'Status' objects in an NSMutableArray. The NSMutableArray stores 20 objects at a time. What is the best way to do this? ...

NSCFString countByEnumeratingWithState:objects:count: ERROR while searching NSMuttableArray

Hy Everybody, i have the following situation. I have an NSMuttableArray filled with an xml file which I want to search. When I enter something in the searchfield I get this Error: "-[NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x5b388b0" What does it means and how can I fix it?!? I s...