|
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Junior Member
Join Date: Jan 2010
Posts: 1
|
Hi,
Thanks in advance to all of those that can help me out here. I'm having all sorts of problems with NSMutableArrays. This is the code I am using: Code:
You must Login or Register to view and contribute code! This is done to increase participation in helping one another out, if you have been helped please pass on the favor. - (void)viewDidLoad {
NSMutableArray *myArray = [[NSMutableArray alloc] initWithCapacity:1];
[myArray addObject:@"Object"];
NSLog(@"About to count");
NSLog(@"Count = %@", [myArray count]);
[myArray release];
[super viewDidLoad];
}
[Session started at 2010-01-29 22:05:26 +0000.] 2010-01-29 22:05:28.037 Tester[3336:207] About to count That is it, the application crashes after this. I have tried this is an NSArray as well with the same outcome. I have also tried using either NSArray or NSMutableArray in some other applications that I had previously written (and worked) and it caused the same problem. Weirdly, NSLog is able to read the contents of an array but not count it. However, in another place I made if statement triggered by a comparison between an Array entry and another NSString. Despite the strings definitely matching the if statement does not run. Please help, I'm completely stuck and it's driving me mad. |
|
|
|
|
|
#2 (permalink) |
|
Administrator
Join Date: Mar 2008
Location: San Diego, CA
Posts: 508
|
If I were in your shoes I would go and find working sample code that accomplishes what I'm trying to do and copy it verbatim and move on without caring much about why this particular way of doing things is crashing.
|
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Search Engine Friendly URLs by vBSEO 3.3.0 RC1 |




Linear Mode
