Tagged Questions
-1
votes
0answers
20 views
NSArray appears to have 1 object when data retrieved from Core Data but it is empty
I use core data to store dates. Before any dates have been stored the entity is obviously empty and the following checks whether there are any dates stored when the application opens. However in the ...
0
votes
3answers
26 views
Convert JSON to NSArray
I have a JSON array being output on a page. I would like to convert this JSON array into an NSArray.
This is the JSON output on the web page:
[{"city":"Current Location"},{"city":"Anaheim, ...
0
votes
2answers
14 views
Sort the Main NSArray using the SubArray key value pair
I want to sort my main array depending on the first_name in the array self.contacts
Code that is used to sort the array
-(void)Sort
{
NSSortDescriptor *sdName = [[NSSortDescriptor alloc] ...
0
votes
1answer
22 views
Find the index of an NSString NSArray, matching a specific string?
I have an array of NSString.
exampleArray = @[@"5", @"6", @"7", @"8", @"9", @"10", @"11", @"12", @"13", @"14", @"15", @"16", @"17", @"18", @"19", @"20"];
Let's say you have..
NSString ...
0
votes
2answers
31 views
Why is this code not putting the NSArray objects into the NSMutableArray?
I have a .txt file with 7 TAB-delimited strings in it. I want to take the 7 strings, one at a time, and separate each of them by the tab delimiter into an array, then put that array into a Mutable ...
0
votes
1answer
30 views
Manual VS Automatic Array Clarification
In my app, I'm going from creating an array of objects manually to creating an equal array where the objects are stored in a reference folder. I create the automatic array with ...
0
votes
1answer
13 views
Create Unique Arrays Based on Reference Subfolders
I'm trying to automate creating a unique array for each reference subfolder (blue folder) that contains the contents of the subfolder. I'd like to do this by way of a for loop. The process would be to ...
-3
votes
1answer
28 views
How to add values or add object into NSArray in Objective C using for loop?
Well this is my code:
NSDictionary *dicto;
NSString *ndccode;
NSString *string=@" ";
for (int i=0; i<array.count; i++) {
dicto=[array objectAtIndex:i];
ndccode=[dicto ...
0
votes
3answers
45 views
How can I create a static NSString[] of static NSString constants?
I have a collection of static NSString consts in one of my header files that I would like to utilize in a new static NSArray (or NSString[]) but am running into the following error
Initializer ...
0
votes
1answer
32 views
Unable to parse the format string while filtering array of dictionaries?
I have a array of dictionaries as below
<__NSArrayI 0x10053e7c0>(
{
busType = "A/C SLEEPER";
fare = 700;
},
{
busType = "Volvo A/C B9R Multi-Axle Semi Sleeper";
fare ...
-1
votes
0answers
23 views
[PFObject mutableCopyWithZone:]: unrecognized selector sent to instance
I am getting my data from Parse Backend into two arrays . I want to create a array that joins the two arrays based on common key (exerciseID) but for some reason I am getting a crash.
My routine ...
0
votes
1answer
43 views
How to create Array of Dictionaries from comma separated strings?
I am receiving comma separated string as below which is to be converted to array of dictionaries.I tried using [myString componentsSeparatedByString:@","]; which however gives a totally different ...
1
vote
0answers
34 views
Query to an NSArray or db parse.com
When passing data to a new viewController after clicking on a pin on a map view with MapKit, I have problem with the annotation index when clicked on rightCallOutAccesoryView. It is not correlating to ...
0
votes
0answers
29 views
Combine 2 NSArrays of NSDictionaries
Array1{ ( Name:david; Place:UK; Work:Google; url:"www.google.com"; id=1;,
Name:John; Place:UK; Work:Yahoo; url:"www.yahoo.com"; id=2;,
Name:david; Place:US; Work:stack; url:"www.facebook.com"; id=3; ...
0
votes
1answer
16 views
Get PFObject from query
I'm building an app that uses Parse as a backend service. I got a column named "Title" and a column named "Author" as well as many other columns. I'm using a specific title to try and get the author ...
0
votes
2answers
21 views
How to sort CoreData string attribute in descending order to find the highest current value?
I have a CordData store where the primary "key" is a string; I need to sort that key attribute into descending order so I can find the highest current key. I know I have to convert the key to an int ...
0
votes
1answer
19 views
How can I word wrap with NSMutableAttributedString?
NSArray *myArray = @[@"1st:array1",
@"2nd:array2",
@"3rd:array3"
];
NSString *labelString = [myArray componentsJoinedByString:@"\n"];
...
0
votes
4answers
37 views
How to separate NSArray values?
NSArray has 3 values
@[@"addd:etyrhetwrwr", @"fdfdd:jjjjhhhh", @"fsuy:jjhwgggggg"]
And I want to put this array into the UILabel with word wrap.
So when I run, it should show like this in label.
...
0
votes
2answers
40 views
Return first character of string in NSArray for UIPickerView didSelectRow
I have a UIPickerView which returns an NSArray with 4 strings. When the user scrolls the UIPickerView, a UITextField gets updated with the selected row. I would like to return the first character of ...
0
votes
1answer
33 views
Sorting Array of Objects by Date into TableView
I used this answer to sort 2 objects by date, and it worked perfectly: Get one NSArray
I now need to sort 3 objects by date, and can't quite modify what I have to get that right.
All of the Articles ...
-1
votes
1answer
10 views
orderBySortDescriptor not calling selector
The selector compareUserObject:toObject: is never called and the array is only sorted by comparing status with a simple equality check. The query is a Parse query. How do I get my custom ...
0
votes
1answer
30 views
NSArray not removing objects
I have 5 objects in Array and want to delete 2 in loop but I have a small minor problem in below code
NSMutableArray *totalPages = [[NSMutableArray alloc] init];
[totalPages addObject:@"Test1"];
...
8
votes
2answers
213 views
Swift class field of type var Array is converted to immutable NSArray instead of NSMutableArray
A simple Swift class has a field of type var Array. When the class is adapted to Objective-C the field type is exposed as NSArray (immutable) while it should be NSMutableArray (mutable)
class ...
1
vote
3answers
62 views
2 NSArrays, find intersection based on a property value?
I have 2 NSArrays of 2 different types of custom objects.
Object A properties:
ID:
Name:
Author:
Object B Properties:
bookID:
value:
terminator:
I need to filter an array of objects of type "A" ...
0
votes
3answers
46 views
See if NSDictionary key is in another NSArray
Database (
{
to = (NSString *)
from = (NSString *)
subject = (NSString *)
uid = int
body = (NSString *)
}, { ...
)
Downloaded (
{
to = ...
-1
votes
0answers
40 views
Save NSArray to NSDictionary
i have NSArray like this:
(
{
category = {
description = "";
name = category1;
};
},
{
category = {
description = "";
name = ...
0
votes
2answers
32 views
Do NSArrays stay sorted when saved then retrieved from a plist
Simple question do NSArrays stay sorted when saved to a plist and then retrieved?
I am having a sorting issue when i retrieve my array from my plist so i was curious.
I think it may also be a ...
-1
votes
0answers
51 views
NSArray object at index is kind of class check?
I have a problem with NSArray object at index. I have an NSArray "objects" full of objects of class lets say "MyClass". Im trying to use isKindOfClass check like this:
id object = self.objects[row];
...
-5
votes
2answers
36 views
Create array of dictionaries in objective c
I am fetching dictionaries from my local database.
My database array with name aryTitle_DB structure is as mentioned below.
( {
"date":13/9/2014;
"title"="abc"
}, { ...
-1
votes
1answer
25 views
NSArray find index for value
I have a simple NSArray, from which the user selects a value. This is then stored.
How can I then, programmatically, search the array for that stored value and return it's associated index (i.e. 0, ...
0
votes
1answer
58 views
copy and sort an NSArray in one step
I am trying to sort an NSArray.
Unfortunately the array appears to stay empty.
I start with an NSMutableArray with normal distributed data called "gaussianPopulation" which is then to be copied and ...
-1
votes
3answers
44 views
Adding objects to an NSmutableArray from a C Array
I have an NSmutable array and I am adding some strings present in the C array to it. By using this method
if (!self.arrayOfVariableNames) {
self.arrayOfVariableNames = [[NSMutableArray alloc] ...
2
votes
3answers
62 views
Objective-C Array allocation using @[] and initWithObjects
a working colleague and me are struggling to properly answer the exact difference between
two different ways of creating an array:
NSArray *array1 = @[@"this is my first entry",@"this is my second ...
0
votes
2answers
27 views
NSArray redefintion with a different type int & missing type specifier
The following code will not build and provides the warning of "Type specifier missing, defaults to 'int'" and the error "Redefinition of 'my_var' with a different type: 'int' vs 'NS Array *__strong'.
...
0
votes
1answer
61 views
Add multiple objects under key in NSMutableDictionary
What I am trying to achieve is the following, store one value (keyword) under the key (account) in one dictionary and then store that dictionary under another dictionary with the key (list) and ...
0
votes
1answer
44 views
objective-c NSArray online testing
I'm new to Objective-c, and trying to learn the basics of the language before I jump into iOS development. It seems like Xcode requires a more complete understanding of the whole iOS development ...
0
votes
2answers
47 views
Objective C Get Dictionary from Array[i]
I have an array of dictionaries that populate a tableView as seen below
self.tableCell.usernameLabel.text = [self.loadTableArrayCopy[indexPath.row] valueForKeyPath:@"user.full_name"];
If the user ...
0
votes
1answer
40 views
Structure UITableView with custom iPod Library
I having a problem trying to display albums & respective songs by certain artist in a tableView, separating the Albums title by section's and the songs in the rows.
I'm using this code to make an ...
-1
votes
2answers
20 views
Difference between sizeof and length of NSData
I'm confused. What is deference between sizeof and .length of NSData. Length is a count of characters? Right? but does it mean sizeof? Can anybody explain me more exactly plz
1
vote
6answers
129 views
App crashes when storing NSArray in NSUserDefaults
I couln't store an NSArray in NsUserDefaults. The app gets crashed
in this line
[savedData setObject:jsonValue forKey:@"JSONDATA"];
Below is my code. and i have mention my log error below
NSArray ...
0
votes
2answers
31 views
How do I see if one NSArray has all of the objects in another NSArray?
NSArray *arrOne has objects A, B, C, D, E
NSArray *arrTwo has objects B, E
I want to see if arrOne has the objects in arrTwo. In the above example, I would want it to return YES/TRUE.
If arrTwo has ...
0
votes
3answers
53 views
NSArray enumerating by group
Using Objective-C, is it possible to go through an array by groups :
exemple :
NSArray *arr = 1, 2, 3, ....100;
Every 10 objects, do something and go on
so :
object 0 to 9 : you do something with ...
0
votes
5answers
76 views
NSArray and “If-statement”
I'm new at developing apps. I have a NSArray with 2 images in it.
imageOneArray = [NSArray arrayWithObjects:[UIImage imageNamed:@"White.png"], [UIImage imageNamed:@"Black.png"], nil];
My question ...
1
vote
2answers
43 views
ReConvert NSString to NSArray
I have converted an NSArray to NSString using below code
Suppose i have an array with some data in it.
NSString *sample=[array description];
NSLog(@"%@",sample);
which prints:
(
{
URL = ...
-3
votes
2answers
44 views
iOS: JSON parsing to NSArray?
Hi I am getting the folowing JSON as response but getting error when try to parse it to NSArray.
NSArray * resp = [JSON objectForKey@"CONVCOLL"];
It throws exception to the above line. please help
...
0
votes
0answers
27 views
Make multi-level NSDictionary mutable [duplicate]
I'm saving out a multi-level NSDictionary to [NSUserDefaults standardUserDefaults], my app need to read it back and modify and save to UD again. Each of the object in dictionary is another dictionary ...
0
votes
0answers
50 views
How to regroup NSMutableArray on tableview
This is how I regroup the array in viewDidLoad :
arrayChild=[[NSMutableArray alloc]init];
arrayTitle=[[NSMutableArray alloc]init];
arrayParent=[CM getParentCategory];
for (int i=0; ...
-4
votes
5answers
65 views
how to convert NSString to NSArray [duplicate]
I have a string like
NSString* str = @"[90, 5, 6]";
I need to convert it to an array like
NSArray * numbers = [90, 5 , 6];
I did a quite long way like this:
+ (NSArray*) ...
-2
votes
2answers
39 views
Get NSRange from NSArray
So I have NSArray that contains objects like {117, 22}{http://t.co/7l3oiMDQt3} and I want to get 117 and 22 I tried to use ObjectAtIndex: and the app was crashed and then added this:
if(array.count ...
0
votes
4answers
45 views
Using NSPredicate to find elements in an NSArray similar to SQL WHERE IN clause
I have an NSArray of, say Article objects. Article object contains another NSArray of tags to the article.
So I want to find articles that contain a set of tags like [iphone, apple, music].
In SQL it ...