in my previous question i was given some code in order to make up this statment.
favoriteArray is an Mutable Array...
if (![self.favoritesArray containsObject:@"added"])
{
[self.favoritesArray addObject:@"added"];
}
else
{
[self.favoritesArray removeObject:@"added"];
}
//NSUInteger newRow = [self.favoritesArray cou...
Hey,
i used the instruments to find leaks in my iphone app and i found that i have leak in this line in my code
tableViewController.dataSource = [[NSMutableArray alloc] initWithArray:[subjects_dic allKeys]];
the property dataSource defined as retain.
is this a mistake ?!
...
Hi everyone,
I am trying to find if there is any object in the mutable array that matches with the object I pass. Please see the function below.
The name comes from table view controller, so the row that is tapped is saved into name and passed to this function. I am trying to check whether the name in the table view controller equals t...
Hi,
Hopefully I can make this clear, but I am new to Objective-C and to be honest not great with Arrays in the first place.
So, I have a Singleton class (called SingletonState) that I am using to pass variables around my app (please can we leave the whether I should use Singleton classes out of this - I will fix that later). In this c...
please help me
I want to sort NSMutableArray and yes I can do this by
NSSortDescriptor *sortPoint = [[NSSortDescriptor alloc] initWithKey:@"point" ascending:YES];
[hightScore sortUsingDescriptors:[NSArray arrayWithObject:sortPoint]];
but in NSMuatableArray(hightScore), I have 2 NSMutableDictionary like this
[item setObject:@"player_n...
hi,
i have an NSString that is value in plist format. i download this string from url. but i dont wanna write it to a file. when the string comes Asynchronous, i want to put it to nsmutablearray.
how can i convert string (in plist format) to nsmutablearray?
there is some methods, initWithContentsOfURL, initWithContentsOfFile. but no inti...
hi,
i have 2 NSMutableArray with same type. i want to add second nsmutablearray to first one.
NSMutableArray *tmpArray1 (10 objects in it)
NSMutableArray *tmpArray2 (10 objects in it)
if i use [tmpArray1 addobject:tmparray2]; tmpArray1's count goes to 11.
but i want to append tmparray2 to firstone. count must be 20.
thanks...
...
Hi, everyone,
I have a question about the objective-C. I use the following code to add a contains from an array to another array. However, the second array is null. Can anyone help me? Thank you.
titleArray = [[csvDataArrayString objectAtIndex:0] componentsSeparatedByString:@","];
NSString *title;
dataTitleArray = [[NSMutableArray al...
I have an NSMutableArray I am trying to populate using a for-loop and making NSStrings for it. These are to be the data source for my UIPickerView. You'll see some commented out lines where I manually made NSArrays and they showed up fine, but my for-loop NSMutableArray doesn't seem to accept the strings I'm making. The NSLogs show th...
Hi, everyone,
I have a question about the objective C. I have the following NSString *name shown below:
"First Name","Second Name","Last Name";
Actually, name is the header of the CSV and receive from the URL. And I use the follow statement to break the statement to array.
NSMutableArray *csvTitleArray;
csvTitleArray = [[name compo...
Hello,
I have an NSMutableArray which holds the dates in format dd/MM/yyyy of type NSString.
Now i need to display the sorted array of dates. Please suggest me how to achieve it.
Thank You.
...
I decided to start using removeAllObjects so that I could re-use some of my NSMutableArrays. However, I am finding that the call to removeAllObjects causes the array to get released and so it crashes when the viewController is displayed for the second time.
I've looked on the web and it seems that some people are saying that removeAllOb...
I have a NSMutableArray like this:
NSMutableArray *array =...; (array contain my custom object)
NSMutableArray *toRemove = [array getObjectsToRemove];
But when I try to call removeObjectsInArray ( [array removeObjectsInArray:toRemove]; ) it breaks my app! Can anybody tell me how to solve my problem :(
...
I have a plist dictionary with several arrays where each have different number of items. These items are dictionaries too. So basically it looks like this:
Root dictionary
names array
places array
Item 0 dictionary
Item 1 dictionary
placeName string: "House"
description string: "My House"
height number: 10
Item 2 dictionary
...
colo...
Dear all
I'm starting to feel rather stupid - I've browsed the site and found a few things that come close to my problem but just can't figure it out (help M. Zarra, after reading your book I felt pretty good about Core Data but now I'm at my wits' end!). Despite the expert's advice I've chosen to store an NSMutableArray as a transforma...
I have the following code:
NSInteger phoneCount = ABMultiValueGetCount(phones);
NSMutableArray *phoneKeys = [[[NSMutableArray alloc] init] autorelease];
NSMutableArray *phoneKeyValues = [[[NSMutableArray alloc] init] autorelease];
for(CFIndex i=0; i < phoneCount; i++) {
//NSString *label = [(NSString *)ABMultiValueCopyLabelAtIndex(...
Ok.
I have an array with multiple objects populated by my core data stack
.
Lets say each object has a name, startdate, enddate and amount attribute associated with them
What I need to do is reduce this array down to only the unique objects (not just values) based on the name, which is an NSString.
I've tried isEqual methods within fo...
Hi guys! sorry if this is a noob question but i'm having difficulty implementing 2 nsfetchedresultsController in a tableView.
i wanted a fetchedresultsController in each section of the table (2 sections), something like this:
Wishlist
product
product2
Bought
product3
I know that for this example i wouldn't need 2 nsfetchedResult...
I'm currently writing a Twitter client for iPhone and need a way to cache the public timeline. The data fetched is stored as 'Status' objects in an NSMutableArray.
The NSMutableArray stores 20 objects at a time.
What is the best way to do this?
...
Hy Everybody,
i have the following situation.
I have an NSMuttableArray filled with an xml file which I want to search.
When I enter something in the searchfield I get this Error:
"-[NSCFString countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x5b388b0"
What does it means and how can I fix it?!?
I s...