nsarray

UIViewController not loading a UIView

Hey, I'm playing around with a script my teacher provided for a table based application. However I can't seem to get my own view to load. Files: SubViewOneController (which is a sub view, also has a nib) TapViewController (Custom UIView I created and want to add to a cell) RootViewController (Main controller which loads in the views) ...

iPhone - Sort UITableView by Array Index

I have an UITableView set up with a NSArray with 10 indexes. Right now, the first cell on the uitableview is the first index, the second cell is the second index, and so on so forth. Is there any way to make it so that the first cell displays the latest index? Maybe through some code in the uitableview delegate because I am adding data t...

show content based on navigation route? UITable

Hello All, I have a table which I'm using as a menu. If my user navigates from a table cell titled "basic math" I want to show a text view with text being populated from an NSArray titled the same as the cell title...so basicmath.txt Can anyone point me in the right direction or tell me if this is at all possible? or am I barking up ...

Obj-C: A reference or a copy?

Is the product item a copy, or just a reference to the object in the NSArray? Does it need to be released? Considering there is no alloc, I assume there is no need for release, correct? ProductItem *item = [appDelegate.productTextList objectAtIndex:[indexPath row]]; ...

how to convert NSarray into NSString

how to convert NSarray into NSString in objective-c. ...

How do I put objects in an NSArray into an NSSet?

Hi all, I have some NSDictionary objects stored in an NSArray called telephoneArray. I fetch the values for the key number and then replace the NSDictionary I've just read with a new object at the same index in the array. I then want to put these new objects into an NSSet. How can this be achieved? See my unsuccessful attempt below. ...

Best way to sort an NSArray of NSDictionary's?

Hi, I'm struggling with trying to sort an array of dictionarys. My dictionaries have a couple of values of interest, price, popularity etc. Any suggestions? ...

iPhone SDK: updating objects in an NSArray

Hi all, I have an NSArray of (Product) objects that are created by parsing an XML response from a server. In the object, it has images, and text, and ints, URLs. etc. There are 2 requests to the server 1: list of matching products from a search - small amount of detail 2: product details: the full details. When the second request i...

Compare NSArray with NSMutableArray adding delta objects to NSMutableArray

I have an NSMutableArray that is populated with objects of strings. For simplicity sake we'll say that the objects are a person and each person object contains information about that person. Thus I would have an NSMutableArray that is populated with person objects: person.firstName person.lastName person.age person.height And so on. ...

objective C string Confusion

I am having code NSString *cellValue1 = [products1 objectAtIndex:indexPath.row]; when i try to print NSLog(@"cell value is %@",cellValue1); in log i am not getting anything, if i use %s, i am getting some symbols, not the string located in cellValue1. Please help me. Thanks in advance. ...

Difference of 2 NSArray's for animated insert/delete in UITableView

At some point in my Application, I have an NSArray whose contents change. Those contents are shown in a UITableView. I'm trying to find a way to find the diff between the contents of before and after of the NSArray so i can pass the correct indexPaths to insertRowsAtIndexPaths:withRowAnimation: and deleteRowsAtIndexPaths:withRowAnimation...

Passing a NSArray between classes

So, my second question based off of this application I'm teaching myself Objective C with. I have a Data Source class, which for now looks mostly like: - (id) init { if (self = [super init]){ listNames = [[NSArray alloc] initWithObjects: @"Grocery", @"Wedding", @"History class",@"CS Class",@"Robotics",@"Nuclear Sciences", ...

iPhone: How to get the contents of the documents directory as a NSMutableArray?

How do I get the contents of the documents directory as a NSMutableArray? I can get it as a normal NSArray, but as soon as I try to do anything with that array, my app crashes. Thanks ...

How to save an NSMutableArray of images as a Photoshop file

I found Layers that will save the project as a Photoshop file that can be edited as Photoshop, but how do I do this? ...

Cocoa: Cannot Archive Array of Values Representing CGPoints

Hey guys, I have converted CGPoint To NSValue and put all the resulting values in q NSArray but when i use [NSKeyedArchiver archiveRootObject:ArrayName toFile:PointArrayFile]; it gives me error. If some one know please do help me how can I achieve this ... Thanks Umer Sufyan ...

Sort an array with special characters - iPhone

Hi everyone, I have an array with french strings let say: "égrener" and "exact" I would like to sort it such as égrener is the first. When I do: NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:YES]; NSArray *sortDescriptors = [NSArray arrayWithObject:descriptor]; NSArray *sortedArray = [myArray sor...

Retain, alloc, properties ... Topic to make your Obj-c life easier !

Hey everyone, The more I code, the more I get lost ... so I decided to create a topic entirely dedicated to the memory management for me (and others) not to waste hours understanding obj-c basics ... I'll update it as new questions are asked ! Okay below is some examples : // myArray is property (retain) myArray = otherArray; //myAr...

Confusion around NSMutableArray and NSArray

I have the following code: NSLog(@"items: %d", [items count]); NSLog(@"allObjects: %d", [self.allObjects count]); [self.allObjects addObjectsFromArray:items]; NSLog(@"allObjects: %d", [self.allObjects count]); Which produces the following output: items: 7 allObjects: 0 allObjects: 0 items is a NSArray allObjects is a NSMutableAr...

Sort by the mode in an Array in Objective-C iPhone

If I have an NSArray with some values in them. Is there a way using descriptors to sort it by the most frequent number in the array first and the least frequent number at the end, Array has( "3", "2", "1", "3", "3", "7", ) to Array has( "3", "3", "3", "1", "2", "7", ) ...

Objective-C NSArray NEWBIE Question:

Hi I have a weird problems with NSArray where some of the members of the objects in my array are going out of scope but not the others: I have a simple object called Section. It has 3 members. @interface Section : NSObject { NSNumber *section_Id; NSNumber *routeId; NSString *startLocationName; } @property(nonatomic,reta...