I have an ivar mutable array which i setup in viewDidLoad as follows:
names = [NSMutableArray arrayWithCapacity:30];
[names addObject:@"Joe"];
[names addObject:@"Dom"];
[names addObject:@"Bob"];
Then in a later method, on tap of a button, i do the following, but the array appears to be overreleasing... with Zombie messaged:
int r = a...
I don't think I am creating this array of UILabels correctly.
If I put a breakpoint after this line of code, it shows that the array is empty.
colorLabelArray = [[NSMutableArray alloc] initWithObjects: greenLabel, orangeLabel, blackLabel,purpleLabel, yellowLabel, redLabel, blueLabel, whiteLabel, nil];
If I do the same thing with UI...
Hi!
i've been trying to make a system in which i can record the scores of a game, linked with the profile of the player being used. I am not using any on-line leaderboard system (yet), at present I just need to have a score system at its basics.
I have managed to make it that the method I am using obtains the score and the profile be...
I was able to save an NSMutableArray of custom objects to NSUserDefaults by implementing NSCoding in the custom class. However, now I want to save an NSMutableArray of these arrays. The compiler complains when I try to do this. How can this be done?
...
Hi,
Does anyone have advice on how to best initialize an NSMutableArray when it comes to dictating the capacity? The documentation mentions that "...even though you specify a size when you create an array, the specified size is regarded as a “hint”; the actual size of the array is still 0." So...
1) If I init with a greater capacity t...
Hi, I'm having trouble retrieving a saved NSMutableArray containing a custom object. The app crashes and the console reports http://pastie.org/1226822. Here is my objects .h file http://pastie.org/1226823. Here is my objects .m file http://pastie.org/1226826. Here is how I save my data http://pastie.org/1226830. Here is how I retrieve my...
i use this code to check if any objects exist in my NSMutableArray
if yes i remove them all but it crashes although there are objects why?
if([NSMutableArray1 count]==1)
{
[poemoptionslist removeAllObjects];
}
if ([NSMutableArray1 count]==0)
{
[poemoptionslist addObject: final1];
}
CONSOLE OU...
If you have an NSMutableArray with three NSDictionarys like this:
{
name:steve, age:40;
name:steve, age:23;
name:paul, age:19
}
How do I turn that into an array with just two strings { steve, paul }. In other words, the unique names from the original NSMutableArray? Is there a way to do this using blocks?
...
[array objectAtIndex:i] doesn't work as an L value, so it can't be used to set the object at index i.
...
I have an editable pList with a dictionary of strings in the format:
21-10-2010 -> @"item1"
20-10-2010 -> @"item2"
19-10-2010 -> @"item3"
18-10-2010 -> @"item4"
17-10-2010 -> @"item5"
ect...
So with dates in stringformat as keys, and strings with different information as value. The lenght of the dictionary can become up to 2...
Hi,
I have an array of multiple images which I want to display on my screen (2 Columns, 4 Rows). If there are more than 8 Images in the row, than a new view should be created. Can someone please point me in the correct direction how to handle this?
Thanks for any feedback!
BR,
Stefan
...
I'm doing drawing app for ipad which need to save multiples of NSMutableArray of CGPoint (Converting into NSValue), suggest me for choosing coredata functions or any other approachs for saving more number of arrays
...
I'm using NSXMLParser to parse a small XML file containing information about videos. One of the elements in the XML is a URL that points to a thumbnail image associated with each video. I'm trying to parse the XML, get the ImageURL and then use this to fetch the image and store it along with strings such as the video name.
I just can't ...
Hi all! I am worried about than am I properly adding object and releasing them.
What NSMutableArray actually contain - object's copy or just a pointer to them?
What is the sequence in working with NSMutableArray? (alloc, init, work, release)
How to retain and release it properly?
NSMutableArray *listData = [[NSMutableArray alloc] init...
I have this function:
void myFunc(NSString* data) {
NSMutableArray *instrs = [[NSMutableArray alloc] initWithCapacity:[data length]];
for (int i=0; i < [data length]; i++) {
unichar c = [data characterAtIndex:i];
[instrs addObject:c];
}
NSEnumerator *e = [instrs objectEnumerator];
id inst;
while (...
I have been struggling with the best way of creating, accessing and updating values from a dynamic boolean array for more than a week now.
@interface myDelegate : NSObject
{
NSMutableArray *aShowNote;
}
@property (nonatomic, copy) NSMutableArray *aShowNote;
This is how I have initialised my array:
NSMutableArray *aShow = [[NSMutab...
Hello all!
I'm new to objective-C. I want to use NSMutableArray to store some objects i will access later.
I've got the interface:
@interface ControlWheel : RotatableObject <LeverSubject>
{
NSMutableArray *subjectArray_;
}
-(id) initWithCWDef: (ControlWheelDef*) def;
-(void) addSubject: (id) subject;
@end
Here is the implementation...
I have understandably attracted some smart ass answers to some bone head questions I have asked lately due to my complete misunderstanding of obj c and NSMutable arrays. So I've looked in a book I have and Google and it would appear that may be I shouldn't program because I'm still stuck.
Say I'm looping through method A and each loop ...