sigbus error 10 (newbie)
sigbus error 10 (newbie)
- Subject: sigbus error 10 (newbie)
- From: Daniel Child <email@hidden>
- Date: Fri, 18 Mar 2005 15:58:35 -1000
Hi All,
Just when I thought I was getting the hang of this.... I keep getting a signal 10 or signal 11 error with the following code:
// This method takes a string representing a stroke description (e.g. "SS-EE-SE")
// and checks the knownStrokes array to find out what types of strokes this
// description may correspond to. Usually, a description may correspond to only
// one kind of stroke, but occasionally the returned set of matching types may
// have more than one members in the set.
- (NSMutableSet *)strokeTypesHavingDescription:(NSString *)d
{
int i = 0;
NSMutableSet *matchingTypes = [[NSMutableSet alloc] init];
NSString *thisDesc = [[NSString alloc] init];
NSNumber *thisType = [[NSString alloc] init];
for (i = 0; i < numInList; i++)
// Note: numInList is a member variable that counts knownStrokes
{
thisDesc = [[knownStrokes objectAtIndex: i] desc];
thisType = [[knownStrokes objectAtIndex: i] strokeType];
// printf("thisType %i thisDesc %s\n", [thisType intValue], [thisDesc cString]);
if ([thisDesc isEqualToString: d])
{
[matchingTypes addObject: thisType];
printf("types retaincount is %i\n\n", [matchingTypes retainCount]);
}
// [thisDesc release];
// [thisType release];
}
printf("matchingTypes set's retain count is %i\n", [matchingTypes retainCount]);
return matchingTypes;
}
I've been fiddling with this for ages and can't see what is wrong. I have tried it with and without the release lines, as well as with or without the alloc/init following the variable declarations.
By the way, are the signal/sigbus error numbers useful hints at what is wrong?
Thanks in advance.
Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden