| OS X - Development and Darwin Discussion and questions about development for Mac OS X. |
| Post Reply | New Thread | Subscribe |
|
|
Thread Tools |
![]() Member Since: Sep 11, 2009
Posts: 1
![]() |
Could somebody help me?
I declared NSMutableArray in header file like this: TPEditGlyphView.h: @interface TPEditGlyphView : NSView { ... NSMutableArray * observedKnots; .... } Next I try to use one, but any access makes "EXC_BAD_ACCESS".. TPEditGlyphView.m: //only places where observedKnots appears ..... -(void) awakeFromNib { ..... observedKnots = [NSMutableArray arrayWithCapacity:0]; //CRASH, EXPLOSION... } -(void) observeValueForKeyPath: keyPath ofObject: object change: change context:context { if (context == TPKnotsSelectionDidChangedContext) { for (TPKnot *knot in observedKnots) { //CRASH, EXPLOSION... .... } observedKnots = [NSMutableArray arrayWithCapacity:0]; for (TPKnot *knot in [knotsController selectedObjects]) { .... [observedKnots addObject: knot]; .... } } .... Where could be bug? |
| QUOTE Thanks | |
![]() Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
![]() ![]() ![]() ![]() ![]() ![]() ![]() Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
|
Do you have the foundation kit imported, as in;
Code:
#import <Foundation/Foundation.h> CameraTime - Time lapse photography for novice and advanced users. When asking questions, post the version of your software. You'll receive better answers. Please post your results to the thread as it is good feedback.
Last edited by xstep; 09-12-2009 at 04:29 PM. Reason: fixed spelling |
| QUOTE Thanks | |
![]() Member Since: Sep 13, 2009
Posts: 2
![]() |
Code:
double var_price[17]; NSString *var_name[17]; int var_stock[17]; NSString *var_itemcode[17]; int var_maxstock[17]; int var_arrayno; Code:
NSString *var_name[17]; NSString *var_itemcode[17]; double var_price[17]; int var_stock[17]; int var_maxstock[17]; int var_arrayno;
|
||||
| QUOTE Thanks | |||||
![]() Member Since: Sep 13, 2009
Posts: 2
![]() |
Just worked out what was causing my problem yesterday, it seems that if you declare
Code:
someobject* anarray[2] Code:
anarray[0] //valid anarray[1] //valid anarray[2] //invalid |
| QUOTE Thanks | |
| Post Reply | New Thread | Subscribe |
| Thread Tools | |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
|||||||
All times are GMT -4. The time now is 07:46 PM.
Powered by vBulletin