nsarray

NSArray data in UILabel

Hi friends, I am trying to put NSArray data by([array valueForKey:@"value_name"]) in uilabel it throws exception. Regards, sathish ...

Objective C Memory Management Woes

I know this has been discussed ad-nauseum but I just don't get some of the memory management. I understand that retain keeps the object alive and copy gives one a separate copy of an object. What I don't get is when it comes to ivars & properties, retain as a property means that the setter releases the old value & retains the new: prop...

Adding NSArray to NSDictionary is causing problems

Hi, I'm writing an app in XCode 3.2.3 for iOS 4. In my code, I am creating an NSArray of NSDictionaries, each containing two key/value pairs, a string and an NSArray of NSDictionaries (kind of confusing, I know). Just to give you a visual, here is the structure: <NSArray> <NSDictionary> <NSString/> <NSArray> ...

Converting NSArray to NSMutableArray

Solved after much googling. Use [arr mutableCopy]! ...

iphone NSLog when displaying an array

Hello - Two part question: First when I am using nslog to log the contents of an array, why is it that some of the objects in the array (all strings) have quotation marks around them and some dont? The log will look like: "Item 1", "item 2", item3, "item4" This leads to my second part of the question... The array in question is bei...

What is the best way to create a large set of dummy data?

I'm trying to create a set of dummy data to put into a program, and I was wondering what the best way to do that was. ...

Populating an NSArray/NSMutableArray, the right way

This is a general question about memory management and best practices when using Cocoa arrays. Which of the following is "better": NSArray *pageControllers = [[NSArray alloc] initWithObjects: [[Page1 alloc] initWithNibName:@"Page1" bundle:nil], [[Page2 alloc] initWithNibName:@"Page2" bundle:nil], [[Page3 alloc] initWithNibN...

How to retrieve part of the NSString * from NSString *

Hi, everyone, I want to ask an NSString * question. I have a NSString * object. The content is like the following example. (like the CSV file) Example: (my file is longer than this one so much) First Name,Last Name,Middle Name,Phone,Chan,Tim,Man,123-456-789,Tom,,,987-654-321 (if it is empty, no space between the ',') How can I use ...

Utility App and plist - is this the appropriate approach to making a flashcard style application?

Dear Developers, I am trying to integrate a question/answer section to one of my apps. I wanted to use a Utility style application where the question is loaded as a Uilable in the first view, and the answer is loaded in the flippedview. I was hoping to load the question and answer data from a plist, and integrate a shuffle option so ...

EXC_BAD_ACCESS when loading NSArray from .plist

I have a plist written from a NSMutableArray by [NSMutableArray writeToFile]. When trying to load that same plist with the following code: NSArray *testArray = [NSArray arrayWithContentsOfFile:[self pathForDataFile:@"reportingSpeicher.plist"]]; NSLog(@"count = %@",[testArray count]); I get bad access on the count or on any other opera...

how to convert the value of nsarray to integer value

Hi friend, I working on grouped table view based work in that in that i want to convert the value of NSarray into integer for specifing to section value of numberOfRowsInSection but it throws expection on putting following code. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { int sec; if (...

Executing Blocks From NSArray?

Hi, I was just thinking, as you can treat Blocks like objects if I create two of them and then add them to an NSArray is there a way to execute them from the array? int (^Block_001)(void) = ^{ return 101; }; int (^Block_002)(void) = ^{ return 202; }; NSArray *array = [NSArray arrayWithObjects:Block_001, Block_002, nil]; EDIT: Update f...

How to create a 2D NSArray or NSMutableArray in objective C?

Hi, everyone, I want to ask about the objective C question. I want to create a 2D NSArray or NSMutableArray in objective C. What should I do? The object stored in the array is NSString *. Thank you very mcuh. ...

Can you build an array of items from folder contents?

Let's say I've got a folder in my project with bunch of png files in it (or mp3 files, or mov files etc). I would like to create an NSArray populated with the items within that folder... for instance an array of UIImages for the folder of images (or just an array of NSStrings of the image name). Is this possible? I know I could create ...

display next item in plist NSmutable Array using UIbutton

Dear Developers, I am developing an iphone app that has a single View containing A UILabel. The UILabel displays strings from within a plist that is structued as follows; Root................................................(Array) .............Item 0.................................(Dictionary) .........................Question.........

2D array in the objective C

Hi, everyone, I want to ask a question about the objective C. I used to ask how to declare a 2D array in the objective in the past and I get the 2D array. However, I modify some of the code and try to display the content of the array. I found that the input is wrong. Can anyone help me to point out the mistake. // Program: conven...

how to access an NSDictionary through an ordered NSArray

So I have an NSDictionary that contains several objects with properties (key:values), but the issue is that I need them in a specific order. Stored as an NSArray is a list of objects that I would like to use as keys for the NSDictionary. I can output the NSArray and NSDictionary to the Console, however when I to access each of the valu...

Key Value Bindings iPhone

I have a bunch of NSDictionaries thats stored in an NSArray. The dictionaries store coordinates for buttons, their name, and their relating object to load when pressed (UIView). When the button is pressed I can retrieve which button it is in string format, for example "settings" and I would like to then run the object -(void)settings{}....

Objective-C NSArray

I'm new to Obj-C and iPhone SDK. The test application I'm stock with is a color switcher containing two buttons ("Back", "Forward") and one text label. The idea is to switch between rainbow colors (background) and setting an appropriate text label in a cyclic manner. I declared NSArray (which is to contain colors names) in RainbowViewCo...

NSPredicate to filter array of words to array of letters

I am trying to make "weighted" list of letters as words are created. I have a massive list of words in an NSArray. For example I am trying to acquire a new NSArray filled with just the 3rd letters of all the words based off the first two letters entered. So far I have... NSArray *filteredArray; if (currentWordSize == 0) { filteredA...