• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SIGBUS/SIGSEGV error problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGBUS/SIGSEGV error problems


  • Subject: Re: SIGBUS/SIGSEGV error problems
  • From: Koen van der Drift <email@hidden>
  • Date: Mon, 11 Aug 2003 21:45:09 -0400

On Monday, August 11, 2003, at 09:18 PM, Mike Brinkman wrote:

for (i = 0; i < [myArray count]; i++)
{
myObject = [[XObject alloc] init];
myObject = [myArray objectAtIndex:i];

// increment sum with floatValue of current object's amount
sum += [[myObject amount] floatValue];

// release myObject
[myObject release];
}


I don't think you need to init/release myObject in this case. The line myObject = [myArray objectAtIndex:i]; will return a pointer to the object in the array and you can use that to get the float.


- Koen.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >SIGBUS/SIGSEGV error problems (From: Mike Brinkman <email@hidden>)

  • Prev by Date: Re: SIGBUS/SIGSEGV error problems
  • Next by Date: Dropping files and folders on the application icon?
  • Previous by thread: Re: SIGBUS/SIGSEGV error problems
  • Next by thread: Re: SIGBUS/SIGSEGV error problems
  • Index(es):
    • Date
    • Thread