 |
 |
Instance variable NSArray
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Calgary, Alberta, Canada
Status:
Offline
|
|
I have an NSArray declared as an instance variable in a controller object that I have, in the object's - (id)init method I call another method that assigns that NSArray an array with the call [staffArray arrayWithObjects:<object1>, <object2>, etc.., nil]. I have one method that obtains objects from this array with no problem, however, I have another method that builds an NSPopUpButton with the contents of this array, and I get a SIGBUS if I don't have the array assigned inside the method that builds the NSPopUpButton. Anybody know why this is?
|
|
"The pool on the roof must have a leak"
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Originally posted by exrae:
<STRONG>I have an NSArray declared as an instance variable in a controller object that I have, in the object's - (id)init method I call another method that assigns that NSArray an array with the call [staffArray arrayWithObjects:<object1>, <object2>, etc.., nil]. I have one method that obtains objects from this array with no problem, however, I have another method that builds an NSPopUpButton with the contents of this array, and I get a SIGBUS if I don't have the array assigned inside the method that builds the NSPopUpButton. Anybody know why this is?</STRONG>
Are you retaining the array reference? I believe arrayWithObjects returns an NSArray object that's been sent an autorelease message. Therefore, try sending your array a RETAIN message after creating it.
That's my only guess.
F-bacher
[ 04-19-2002: Message edited by: Ghoser777 ]
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Bremen, Germany
Status:
Offline
|
|
Originally posted by Ghoser777:
<STRONG>
Are you retaining the array reference? I believe arrayWithObjects returns an NSArray object that's been sent an autorelease message. Therefore, try sending your array a release message after creating it.
That's my only guess.
F-bacher</STRONG>
You meant retain or ?
|
|
"Eine gute Basis ist die Grundlage für ein solides Fundament", Unknown
"If people do not believe that mathematics is simple, it is only because they do not realize how complicated life is", John von Neumann
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status:
Offline
|
|
Yes I did. Whoops. Fixed now.
F-bacher
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Sep 2000
Location: Calgary, Alberta, Canada
Status:
Offline
|
|
|
|
|
"The pool on the roof must have a leak"
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|