Tagged Questions
0
votes
1answer
39 views
Why am I getting a NSFastEnumerationMutationHandler with this NSMutableArray code?
Can someone help me understand what I am doing wrong here that would caused this stack trace:
1 libobjc.A.dylib 0x3a8a897a objc_exception_throw + 26
2 CoreFoundation ...
0
votes
1answer
41 views
How do would you split this given NSString into a NSDictionary?
I have some data i aquire from some linux box and want to put it into a NSDictionary for later processing.
How wold you get this NSString into a NSDictionary like the following?
data
(
bytes
(
...
1
vote
4answers
84 views
Objective-C: Copy Array, Modify Element (Object) in the Copy ONLY
I've read through many SO posts before asking this question and I'm guessing this answer was in there somewhere, but I didn't see it. I'm new to Objective-C and I'm trying to do a (seemingly) simple ...
0
votes
1answer
38 views
NSMutableArray memory allocation
I have an NSMutableArray with 14 indexes acting as a global NSArray, lets call it 'A'. In each of these indexes I have a sub-array (therefore I have 14 sub-arrays within 'A').
These arrays then form ...
0
votes
2answers
35 views
how to compare 2 NSMutableArray and get different number of value
I want compare 2 NSMutableArray values and check which indexPath is different and store this numbers of index in one array.
for example I have these NSMutableArray :
NSMutableArray *a = ...
1
vote
5answers
89 views
NSArray removeObject removes all objects in array
My project creates a bomb, an explosion, then checks for collisions in the explosions and finally delete the bombs that didn't get hit in a collision. This is explained in more detail here. The ...
-3
votes
0answers
57 views
Reverse an NSMutableArray data [closed]
I can achieve reverse an NSMutableArray in two ways, they are
- insertObject:atIndex:0
- [[self.array reverseObjectEnumerator] allObjects]
from the above which one would perform better ...
0
votes
1answer
17 views
initWithArray:(NSArray *)array copyItems:(BOOL)flag
NSMutableDictionary *dic0 = [[NSMutableDictionary alloc] initWithObjectsAndKeys:@"string0", @"key0", nil];
NSDictionary *dic1 = [[NSDictionary alloc] initWithObjectsAndKeys:@"string1", @"key1", nil];
...
-2
votes
2answers
38 views
Italicise part of a string in a NSArray
tableData = [[NSMutableArray alloc] init];
[tableData addObjectsFromArray:[NSArray arrayWithObjects: @"ONE" @" " @"TWO", @"NEXT CELL", nil]];
I want the @"TWO" to be in italics. Anyone have any idea ...
0
votes
1answer
44 views
Search NSArray and add to NSMutableArray
I have an Xcode project with two NSArrays of objects, one named completionArray filled with @"yes" and @"no" and one named allRequirements with objects that represent college classes such as @"ITCS ...
0
votes
1answer
49 views
Bubble sort NSMutableArray
I have managed with some help to sort my NSMutableArray of NSDictionaries using the NSArray function sortedArrayUsingComparator However the Array I am wanting to sort is no just based off one value.
...
0
votes
1answer
50 views
Iphone - How do you sort an NSMutableArray into ascending order?
In Xcode i am trying to make a graph into which some points (X,Y) are given by the user.The user can choose how many points he or she wants to plot on the graph. I have stored the X axis points in an ...
-2
votes
3answers
60 views
IOS - How to load array in property list [closed]
Most of example for load data from plist is dictionary.
But I have a plist with array in 1st level data, like:
<plist version="1.0">
<array>
....
....
....
</array>
</plist>
...
-1
votes
3answers
98 views
About NSArray nil crash error
How to avoid this crash error!Crash in main thread Log is
ProcessArray:()
ProcessArray == 0
-[NSNull length]: unrecognized selector sent to instance 0x3c4e1090
my code:
ProcessArray = ...
0
votes
1answer
63 views
Any ideas on why NSArray response is not copying into another array
Here is my code.
self.array = [[NSMutableArray alloc] init];
[myApp getCampaigns:^(NSArray *response) {
[self.array addObjectsFromArray:response];
}];
if I use NSlog for response it shows two ...
0
votes
2answers
65 views
how to add object multi NSArray in one NSMutableArray
I want add object from 2 NSArray to NSMutableArray. I dont know about this.
this my code:
@interface ViewController : UITableViewController
{
NSArray *animal;
NSArray *color;
...
-1
votes
3answers
71 views
How can I move the values in NSMutableArray to NSArray
I have an array of recommendedcar IDs, and another array of allcar IDs. From this, I have to take the recommendedcar images. First, I check whether the recommended carid is in my allcar id; if it is, ...
1
vote
1answer
60 views
Increase Interval Gap In NSMutableArray
I m new in iPhone development. I've one NSMutableArray.
arrayNo = [[NSMutableArray alloc] initWithObjects:@"10",@"50", @"100", @"1000 ",@"2000", @"5000", @"10000",nil];
but now, what I want to do ...
-1
votes
1answer
72 views
NSMutableArray Not Retaining Objects Outside Method [closed]
In my -viewDidLoad method, I initialize many NSMutableDictionaries, and add them to an initialized NSMutableArray declared via @property in the class header file. The relevant code is shown below. In ...
0
votes
1answer
65 views
How many occurrence of each item appears in a NSMutableArray
I have an NSMutableArray with some NSNumber :
{1, 2, 3, 3, 2, 1, 6, 2}
I would like to know how many occurrence of each number appears in the list.
Ex :
1 = 2
2 = 3
3 = 2
6 = 1
1
vote
2answers
163 views
Why can't I add nil objects to NSMutableArrays?
I have a situation where I'd like to be able to maintain an array of pointers that might all possibly point to nil.
Equipment *equipment[19];
However, I've found that I cannot set an array of ...
-1
votes
1answer
86 views
Objective - c - Pointers and what really happens when you assign an array to another [closed]
So I am wondering what happens when I do
NSMutableArray *arr1 = [[NSMutableArray alloc] init];
NSMutableArray *arr2 = [[NSMutableArray alloc] init];
[arr1 addobject:ob1];
arr2 = arr1;
[self ...
-1
votes
1answer
65 views
NSArray Compare Different Count [closed]
i've lost my hair trying to do this :
I have 2 NSString objects, one is the reference and the other is the user's one. I want to check the spelling mistake between the two strings. I make ...
0
votes
3answers
60 views
Sequentially ordered NSMutableArray - replacing breaks in order
I've been having a mind blank over this problem, so I thought maybe some of you could shed a light on the situation.
To cut a long story short, I am building an app that fetches a school student's ...
0
votes
2answers
96 views
NSArray not sorting in number order [duplicate]
I am looking to make an array with items from a dictionary, and then order it in descending order so that the greatest value is at the top and the smallest is at the bottom. However, it seems to ...
0
votes
2answers
89 views
insertObject:AtIndex:0 does not work properly
I have this function in which the function insertObject:AtIndex:0 behaves weird . After inserting all objects to the NSMutableArray cardViewControllers, the final element is always nil.I did alloc ...
1
vote
2answers
167 views
Rebuild an NSArray by grouping objects that have matching id numbers?
I have an NSArray and each object in the array has a groupId and a name. Each object is unique but there are many with the same groupId. Is there a way i can tear the array apart and rebuild it so ...
1
vote
1answer
72 views
Why Isn't UITableView Populating From Array
I'm a noob to iphone development (3rd day in xcode) and I'm having trouble populating a tableview from an NSMutableArray. I'm using this tutorial as my guide and my implementation of it is slightly ...
1
vote
1answer
60 views
Why does the following lines of code not adding anything to the array and the array just produces null
Why does the following lines of code not adding anything to the array and the array just produces null.
NSString *LIstringURL = [[NSString alloc] ...
0
votes
1answer
75 views
How to populate a table view contents from two arrays?
I'm looking for a way to populate a table view with images and text from two separate (but parallel) arrays. I've been trying to start with two mutable arrays instantiated with all possible contents, ...
0
votes
3answers
32 views
How do I access methods of a class inside of an array
I have a custom class that holds information about a car like the stock number, vin and so on. I used properties as a getter and setter to set all the information. I then make an instance of this ...
0
votes
0answers
102 views
adding textfield.text to uitableview
to make a long story short I'm building a game, I am using a uitableview with a custom cell as a scoring system. after a lot of research, questions and testing, and thanks to a few people who gave me ...
0
votes
4answers
67 views
issue when retrieving elements from array of objects- objective C
I have a class Person with variables name,age,local and about, i added values of person object to a mutable array as shown:
Person *myPerson=[[Person alloc]init];
NSMutableArray ...
0
votes
0answers
31 views
detailtextlabel color change using array?
I have a potential predicament in relation to changing the color of the detailLabelText for numerous cells.
Currently the Title and DetailText are defined using two arrays:
...
0
votes
1answer
75 views
Change values of NSArray after init
For my homework I have to write the .h and .m to a Command-line application, the main is given by my teacher. It a simple Chutes and Ladders style board print-out of 100 spaces.
The Ladders and ...
1
vote
2answers
294 views
UIBezierPath Multiple Line Colors
My attempt to draw UIBezierPath lines with different colors is failing me. All the lines change to the currently selected color. All my path and information are all stored in an NSMutableArray called ...
0
votes
3answers
59 views
How to add imagepath inside array one by one in iphone
I am new to iPhone programming. How do I add an NSString to an NSArray. I have thumbnail images. If I click on any one of the images I want to store imagepath in the NSArray. Same if I click on the ...
2
votes
2answers
166 views
Why does a (copy, nonatomic) NSMutableArray property create NSArrays?
I made a mistake while creating a TableView class, and accidentally kept my @property as copy when I defined it:
@property (copy, nonatomic) NSMutableArray *words;
I initialised the array ...
1
vote
5answers
261 views
Differences between [NSArray arrayWithArray:] and [NSArray copy]
lately I work much with arrays and I'm wonder.. what's diffrences between those two lines.
NSArray *array = [NSArray arrayWithArray:someArray];
and
NSArray *array = [someArray copy];
Which of it ...
0
votes
1answer
28 views
How to change the name of a mutable array by a programmatically generated string
I am new in the forum and perhaps I asking a silly question, but I would like to know if I am running into a dead end.
I would like to change the name of a mutable array by a string which has been ...
-4
votes
1answer
119 views
Create NSMutable Array from User Inputs through UITextField in Xcode [closed]
I am trying to create an array that will store a float calculated from user inputs from two UITextFields. From searching the web I think I should be using an NSMutableArray. Ideally, there will be no ...
0
votes
1answer
66 views
NSMutable Array returning unrecognised values
I am using an NSMutable Array as a datasource to UITableView. I am fetching the values from database and adding it to mutable array. When the view loads I populate the table view with the mutable ...
1
vote
1answer
68 views
Can i modify data inside a NSArray compared to NSMutableArray?
I have found many discussions about NSMutableArray vs NSArray.
It's very interesting and i understand that you cannot add or delete objects inside a NSArray
But is it possible to change objects in a ...
0
votes
4answers
61 views
How to acces Class methods?
I have a class method which takes an Array as the parameter
+(void)classMethod:(NSArray*)array;
A message is being sent to this method from an outside ViewController with the value of the array.
...
-1
votes
1answer
31 views
Accessing the value of another array and storing it another array
I have two classes Class A and Class B
I want to access the value of an array in Class A and pass that value onto a method in Class B which takes an array as the argument.
I have created a global ...
-1
votes
2answers
111 views
accessing array with gcsize objects
I want to create different size of cell in an collectionview. In the collectionViewLayout sizeForItemAtIndexPath I created an array with CGSize objects. When I want to retrieve the objects stored in ...
0
votes
1answer
56 views
Add NSString to NSMutableArray if NSString is not already pressent - not working
Can't understand why this won't work, it simply says id num hasn't been used before every time... and never adds it to the array. Any help on this would be much appreciated. I'm almost certainly ...
0
votes
3answers
85 views
Compare and get the Index from NSMutableArray
I have an array, which is a collection of arrays.
say
(
( 1, x, y, a),
( 2, m, n, o),
( 3, s, t, u, v, w)
)
If I want to get the index of m, how do I get it?
Can that be done using NSMutableArray ...
3
votes
3answers
112 views
Is NSMutableArray better than NSArray for memory reasons?
I have a question regarding NSArray and NSMutableArray. I understand the difference between two primarily that NSArray is immutable and NSMutableArray is mutable. And as far as my research goes, there ...
-2
votes
3answers
141 views
how can i get every 4th element of the array? [closed]
My question is i have an NSMutableArray with the name of latLongArray which contains object if the array count is greater than 4.
I want to add every 4th object in another Array with name ...