nsarray

Using NSArray with Monotouch

Hi, How to insert items into NSArray object in C# (Monotouch)? I don't find appropriate method to do so? In Objective-C side, there is a constructor called "initWithObjects" but I don't find this on C# side. pom ...

Sort NSArray's by an int contained in the array

I have an array, let's call it "array" and inside of the array I have objects like this: "0 Here is an object" "4 Here's another object" "2 Let's put 2 here too!" "1 What the heck, here's another!" "3 Let's put this one right here" I would like to sort the arrays by that number, so it'll turn into this: "0 Here is an object" "1 W...

cocoa: NSString not removing all the characters

I have an int and for some reason it isn't working after 16 or so. Here's my code: NSArray *sortedArray; sortedArray = [doesntContainAnother sortedArrayUsingFunction:firstNumSort context:NULL]; int count2 = [sortedArray count]; //NSLog(@"%d", count2); int z = 0; while (z < count2) { NSString *myString = [sortedArray objectAtIndex:z]...

trying to display a key from an array of dictionaries in a detail view (tableview).

I have an array of dictionaries with each dictionary holding keys that store information about local places (name, address, vibe, facilities, etc.) . I have a tableview that is sorted according to the name, but I can't seem to get the detail view to view correctly. Here is a sample of the code I am trying to do to display the address inf...

NSArray item to NSString

In a method, I'm having following code: NSString* tempString = (NSString*)arg; NSArray* notificationDetails = [tempString componentsSeparatedByString:@"##"]; NSString* tempString1 = [notificationDetails objectAtIndex:2]; . . . . . . NSLog(tempString1); When I compile the code, its compiling without any error and warning. But while ru...

NSArray, UITableView

If I want the user to be able to edit entries to a table with number data, (the user would click on a table cell, then on that child view, they would enter a number, and return back to the main table view), I was thinking I would just add entries to a NSMutabaleArray. If so, when the user leaves the application, are those values still t...

iPhone SDK NSDictionary and NSArray confusion

I have been trying to get this to work for about three solid days and get my mind around it. Can someone advise. I have built the basics and they all work great but when I try to do that extra bit I cannot get my head around it. I am trying to build a table of technical terms, from a plist. This is an indexed and sections table by the al...

Need help with iphone sdk: not correctly saving .plist to documents directory

I've been spending way too long trying to figure out what is going wrong, so I hope someone her can help me out. My Code: - (IBAction)fedDog { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documen...

Show more than one Object in a NSTableView row

Hi, I'm new here at stackoverflow :) But I think, this is the right place to ask my question. I'm a new developer with Cocoa and Objective-c & I'm trying to write my first App for Mac: a ToDo App. At this moment, i can save ToDo's and delete them, but now, I want to add some features like CreationDate, some Tags (in mutablearray), and i...

Cocoa array to string truncated

I'm trying to join an array of objects into a string that will ultimately be used to populate the detail label of a table cell. if the text is too long it will automatcally truncate and add an elipse at the end. I want to avoid this by checking that the string is less than say 40 characters and adding an elipse in the middle instead. ...

NSArray and Sandbox Question

I don't quite understand, but basically I am trying to click a button and have a value added to my NSMutableArray myArray which is a property. I thought my method that would be called when a button is pressed would be something like: - (IBAction)addInterval { NSString *string = @"test"; [self.myArray addObject:string]; } But I don'...

How add data from NSMutableString into NSArray?

hi, is it an possible to add a value from an NSMutableString into an NSArray? Whats the snippet? ...

how to sort an NSArray using compare:options

I have an NSArray containing numbers as NSString objects. ie. [array addObject:[NSString stringWithFormat:@"%d", 100]]; How do I sort the array numerically? Can I use compare:options and specify NSNumericSearch as NSStringCompareOptions? Please give me an example/sample code. ...

Objective c, Memory Leak, reading from sqlite and assigning values to a NSDictionary and NSAarray

I have a list of shops in a ListController file. I've setted up a sqlite db, in which i've stored 60 shops. On the top of the list i have a search bar. I've made a class called DataController, that is responsible to load and store db datas. @interface DataController : NSObject { sqlite3 *database; NSArray *shops; NSDictionary* ...

how to check an nsmutablearray is null or not

How to check an NSMutableArray is null or not ? ...

Copy NSMutablearray to another

I am trying to copy mutablearray to another but it does not show me anything at the UItableview NSMutableArray *objectsToAdd= [[NSMutableArray alloc] initWithObjects:@"one",@"two"]; NSMutableArray *myArray = [[NSMutableArray alloc] initWithObjects:objectsToAdd,nil]; NSMutableArray *list = [[NSMutableArray alloc] init]; [self.list add...

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 because there is probably non plist objects in there. ...

Getting the string value from a NSArray

I have a NSArrayController and I when I get the selectedObjects and create a NSString with the value of valueForKey:@"Name" it returns ( "This is still a work in progress " ) and all I want to have is the text in the "" how would I get that? also, this my code: NSArray *arrayWithSelectedObjects = [[NSArray alloc] initWithArray:[...

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 right direction? Thanks. I'm a super NOOb on this. For the naming the strings: // setting the first name firstName.text = (NSString *)ABR...

randomize NSArray

I need to randomize an NSArray that I have loaded with quiz questions, but I need to keep the elements in a specific order. ...