nsmutablearray

NSMutableArray 'addObject:' Crashing iPhone App

This is my error: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI addObject:]: unrecognized selector sent to instance I have no idea why this is happening. Both the array (which is NSMutableArray) and the object being added are definitely not nil, and the @property for the array is straig...

iphone: how can i synchronize the contents of 2 NSMutableArrays?

I currently have an NSMutableArray which stores a collection of Video objects. Each Video object has an ID and TITLE. I also have another NSMutableArray of video objects generated from parsing an XML API call. When the user hits a 'synchronize' button, I want the system to be able to figure out the minimum number of operations needed ...

Edit Individual Cell In NSArray

Hi I have an array with 10 objects and I put this into a table. How can I edit one of the individual objects in the array or refresh it? All the objects just hold text, so after I change the text how can I refresh the array? See where I am coming from? Thanks. ...

How to do comparison Check through multiple NSString with objects

Hi, I am having difficulties with some logic. What I am trying to do is I have a nsmutablearray which I want to do a check with an object. If i have selected multiple creditcards in a particular view i store that card details name is my nsmutablearray called filteredCard. Then I have objects of companies which has one or more creditcard...

NSMutableArray addObject not affecting count???

Can anyone tell me why logging [self.giftees count] keeps returning 0 even though I'm adding objects to it? header: #import <UIKit/UIKit.h> @interface Test2AppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; NSMutableArray *giftees; } @property (nonatomic, retain) UIWindow *window; @property (nonatomic, retai...

Reload the main tableView data

I'm writing an iPad split view-based application and I've a NSMutableArray with some objects passed to the main tableView with this code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CellIdentifier"; // Dequeue or create a cell of th...

Question about an NSMutableArray of a certain class

Basically I have an NSMutableArray set up like so, with instances of another class as the array elements. [[NSMutableArray alloc] initWithObjects: [[Shape alloc] init], [[Shape alloc] init], nil]; Each of the shape classes has an instance variable that holds what kind of shape it is. I want to be able to make this array so that it ass...

Loop through NSArray Setting objectAtIndex Value

Hi I have a bunch of NSStrings in a NSMutableArray. I have added them to the array and now I want to loop through the array, getting each object in it (the strings) and set them to a common value @"No Lessons". This is how I have the loop so far: But how can I get the object then set it? Currently its fairly simple, just getting loopin...

well using NSXMLParser the values inside an array are all set to the last entry

I use an NSXMLParser to parse YouTube's API and I get all the content I want and put it into a class called Video. When I am writing to the class from inside parserDidEndElement and I end that video I write the class to an NSMutableArray. Then I NSLog the title of the video that was logged into the array. This is different for each video...

How to append values to an array in Objective-C

Hi friends... I m doing this- for(int i=0;i>count;i++) { NSArray *temp=[[NSArray alloc]initWIthObjects]i,nil]; NSLog(@"%i",temp); } it returns me 0,1,2,3....count one by one. but i want array with appending these values {0,1,2,3,4,5...}. This is not a big deal but i m unable to find it....sorry...i am new to Iphone. ...

sorting mutable array in alphabatical order

Hi i am having a nsmutable array and in that nearly 50 -60 object having different names ,and can i sort this array in alphabatical order (Is it possible, How?) (is it a duplicate question ?) ...

NSMutableArray - App runs in simulator but not on device

My app runs fine in the simulator, but when running on the device, it terminates with SIGABRT. I have narrowed it down to the following code: - (void)loadImage { int imageNumber = currentImageNumber; // check to see if the image has already been downloaded. // if not, get it and add it to an array if ([imageData count] < totalNumberOfIm...

Can't remove object from NSMutableArray

Hi guys, i am trying to remove objects from my NSMutableArray but i keep getting bad_access error. I used "removeAllObjects" and "removeObjectAtIndex" but none of these work. If i add objects to this array , everything is fine. What i want to do is to clear my array before filling it again. I didnt release the array before trying to...

iphone [removeObjectIdenticalTo:] doesnt work

I have the following code that populates an array (this is within a loop): NSString *code = [NSString stringWithFormat:@"%@ - (%@) %@",[tempDic objectForKey:@"state"],[tempDic objectForKey:@"city"],[tempDic objectForKey:@"name"]]; [tempArrayOfAirports removeObjectIdenticalTo:code]; // checks for a previous object, then removes if found...

Tutorial for saving an array of custom objects

Is there a tutorial for saving and restoring an array of custom objects? ...

Objectiv C iPhone. Getting NSMutableArray in Table

Hi! I try to get the data of an array in an TableView but get an bad access error all the time. My code looks like this: NewsViewController.h #import "StatusMessage.h" @interface NewsViewController : UIViewController { IBOutlet UITableView *table; NSMutableArray *statusMessages; } @property(nonatomic, retain) NSMutableArray...

Array writeToFile

Let's say I create an object like this: Person: NSString *name; NSString *phone; NSString *address I create several of these objects. Then I create an NSMutableArray called people and store them in there. Can I save this array to disk with Array writeToFile? Does it need to be converted to NSData? ...

NSKeyedArchiver archivedDataWithRootObject:

Is the parameter for NSKeyedArchiver archivedDataWithRootObject: supposed to be the array I am trying to save, or the array converted into NSData? ...

Why does this crash?

I made a class. This is the h file. // MyClass.h #import <Foundation/Foundation.h> @interface MyClass : NSObject <NSCoding> { NSString *string1; NSString *string2; } @property (nonatomic, retain) NSString *string1; @property (nonatomic, retain) NSString *string2; @end This is the m file. // MyClass.m #import "MyClass.h"...

Why does my app crash

I made a class. This is the h file. // MyClass.h #import <Foundation/Foundation.h> @interface MyClass : NSObject <NSCoding> { NSString *string1; NSString *string2; } @property (nonatomic, retain) NSString *string1; @property (nonatomic, retain) NSString *string2; @end This is the m file // MyClass.m #import "MyClass.h" ...