I have an NSMutabaleArray and I want to check it whether it would be in sorted mode or not after insertion of any element. So what would be the fastest technique to do that.You need one loop to traverse and check if array[i+1] is greater than array[i
I am a beginner , i am trying to retrieve user details from _User class like this : var data:NSMutableArray = NSMutableArray() func loadData() { data.removeAllObjects() var userQuery = PFUser.query() userQuery?.findObjectsInBackgroundWithBlock({ (obj
I am trying to create an algorithm that essentially finds anagrams for a given word (Code below). After the user inputs their word, they press a button, and what it should be doing is looking at an array of words (populated from a txt file; I know th
I am trying to add an object to an NSMutableArray. Initially I assign some response data to the array, and can display it in a table view. After loading more data, it seems to be crashing when trying to add the new information to my original array. I
I have a mutable array of checked box NSMutableArray *arrayOfCheckedBox = [NSMutableArray arrayWithObjects:namePropertyString, lastNamePropertyString, companyPropertyString, workEmailPropertyString, personalEmailPropertyString, workPhonePropertyStrin
I have an NSMutableArray where objects can be added to. The objects added are SUPDataValue objects containing a bunch of SUP data. In an other view, I take this object array and divide it into an NSMutableArray containing an NSMutableArray for every
When I try to add nsinteger value into array it shows warning, Incompatible pointer to integer conversion sending 'NSInteger *' (aka 'int *') to parameter of type 'NSInteger' (aka 'int'); dereference with * and crashed when reach the code [sizary1 ad
I'm trying to create a mutable array of two integers @interface ViewController () { NSMutableArray *myArray; } initialized with capacity of two objects - (void)viewDidLoad { [super viewDidLoad]; myArray = [[NSMutableArray alloc]initWithCapacity:2]; [
I was hoping for some help with my app. I have a set up where multiple threads access a shared NSMutableDictionary owned by a singleton class. The threads access the dictionary in response to downloading JSON and processing it. The singleton class is
I have an array with following elements in ViewDidLoad method inputArray = [NSMutableArray arrayWithObjects:@"car", @"bus", @"helicopter", @"cruiz", @"bike", @"jeep", nil]; I have another UITextF
I have this... allTableData = [[NSMutableArray alloc] initWithObjects: [[Food alloc] initWithName:@"1" andDescription:@"Hi man!"], [[Food alloc] initWithName:@"2" andDescription:@"Hi woman"], nil ]; How can I do som
In the iOS app I'm building, I am currently managing a list of objects (Tasks) by using an NSMutableArray containing a number of NSMutableDictionary objects for each individual task. I would now like to encapsulate the logic I'm writing for managing
I have a problem with a piece of code that should add images to a NSMutableArray. For some reason the images are not added (the count of the array stays at 0). Can someone please tell me what I'm doing wrong here? - (void)incomingNotification:(NSNoti
I know this is going to be really basic, but I can't seem to figure it out. I have an NSMutableArray with two indexes, each with an NSMutableDictionary with a few values. I want to change one value in one index with [[anArray objectAtIndex:index] set
i have array of birthdates as array is getting filled from facebook so there are some friends whos birthdates are private so it contain NULL how to convert that array like empty string wherever there is null value the array is like below "<null>
I want a string of all the characters of the alphabet randomized. Right now, I create a mutable array of the 26 characters, shuffle them with the exchangeObjectAtIndex: method and then add each character to a string that I return. There has to be a b
I have an NSMutableArray of NSMutableDictionary (it's a plist). Each dictionary in the array has 2 keys: 'id' and 'lu'. How can I find the index in NSMutableArray of NSMutableDictionary where, for example, id = '47653'? I tried to do it but it's not
In my iPhone app i have an array of stings. fron that string i need to get the array of first charecters. For this i have implemented logic as follow. it works but in this i have retrieve charectes twicw 1.Small letters and 2.Capital letters. I need
I am adding an object "m" to NSMutableArray as follows: [m setObject:a forKey:@"a"]; [m setObject:b forKey:@"b"]; [m setObject:c forKey:@"c"]; [m setObject:d forKey:@"d"]; [myArray addObject:m]; [m release
I have a Card Object, which have 4 instance variables namely name(NSString), pin(NSString), points(NSNumber), pointsToDeduct(NSMutableArray). Card.h @interface Card : NSObject @property (nonatomic, strong) NSString *name; @property (nonatomic, strong
I need to append strings to an array kept inside of a dictionary each time a word matches a pattern of another word. The second line below (setObject) overwrites instead of appending. The end result should be arrays in a dictionary where the the key(
I am initializing a view controller with a NSMutableArray. But in init, I have to init with NSMutableArray, but all the elements disappeared after that. UIViewController* vc = [[[PhotoAlbumViewController alloc] initWithImages:imageArrayBig] autorelea
I have some details like-- for userone- name-user1 city-new york name-user2 city-oslo Now I want to add these details in a dictionary using key name and location and I want to make an array of that dictionary can anyone tell me what to do? NSArray* n
I have a NSMutableArray in my app which I initiate like this: H-FILE NSMutableArray *noteBookContent; @property (nonatomic, retain) NSMutableArray *noteBookContent; M-FILE @synthesize noteBookContent; I then have a method in which I open a txt file a
I thought that I was really close to release this new App of mine when I ran into a dead end. My code works without memory leaks in the simulator (Xcode 4.0.2) but reports memory leaks on my devices. I think my issue is related to that I copy an obje
I am having problem with adding objects to NSMutableArray *array. // Controller.m #import "Controller.h" @implementation Controller - (void)parser:(NSString *)string{ [array addObject:string]; NSLog(@"answerArray(1): %@",[array objectA
I'm quite new to ObjC and its mutable arrays. This is driving me crazy ;-) I do the following: mColumns = [NSMutableArray array]; for( int i=0; i<5; i++ ) [mColumns addObject:[[MyColumn alloc] init]]; After that code my array "mColumns" conta
I have a root view controller that I'm adding a subviewcontroller to. Rootviewcontroller: I'm trying to add a value from a dictionary as the sole member of the moviewController.list NSMutableArray. However its not getting added and the NSlog is telli
I am trying to edit a mutable array from a property and can't seem to directly make it work. Consider the following code that seems to work, but seems also very inefficient; I have to copy the whole property array just to make a change in one object.
data = [[NSMutableArray arrayWithCapacity:numISF]init]; count = 0; while (count <= numISF) { [data addObject:[[rouge_col_data alloc]init]]; count++; } When I step through the while loop, each object in the data array is 'out of scope' rouge col data