Re: NSString out of scope
Re: NSString out of scope
- Subject: Re: NSString out of scope
- From: Pierre Berloquin <email@hidden>
- Date: Tue, 1 Dec 2009 12:07:59 +0100
Graham:
Here is the whole sad truth about it :
My .h begins with
// The_Paris_PuzzlesViewController.h
#import <UIKit/UIKit.h>
#import <CoreFoundation/CoreFoundation.h>
#import "Affiche.h"
#import "VagPiece.h"
@protocol UIActionSheetDelegate;
@interface The_Paris_PuzzlesViewController : UIViewController
<UIActionSheetDelegate> {
NSMutableArray *lesImagesVues;
NSMutableString *langueChoisie;
...
and my .m begins with
// The_Paris_PuzzlesViewController.m
#import "The_Paris_PuzzlesViewController.h"
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#define kFilename @"data.plist"
@implementation The_Paris_PuzzlesViewController
// Implement loadView to create a view hierarchy programmatically, without
using a nib.
- (void)loadView {
lesImagesVues = [[NSMutableArray alloc] init];
langueChoisie = [[NSMutableString alloc] init];
I have no problem with lesImagesVues but langueChoisie is out of scope.
This remains so even if I initialize in viewDidLoad, even if I make it a
@property, and through out the code, etc.
Why ?
Thanks for your help
Pierre
2009/12/1 Graham Cox <email@hidden>
>
> On 01/12/2009, at 7:39 PM, Pierre Berloquin wrote:
>
> > How come an NSString or NSMutableString I declare in the view controler
> .h
> > interface
> >
> > NSMutableString *language;
> >
> >
> > is "out of scope" even before I do anything with it in the .m
> implementation
> >
> >
> > language = [[NSMutableString alloc] init];
>
>
> Good game, but can you supply some surrounding context?
>
> Is 'language' an ivar of a class or just sitting there as a global? Where
> is the alloc/init being called from? What is giving the error - the
> compiler? Debugger?
>
> Or have I already used up my 20 questions?
>
> --Graham
>
>
>
--
Blogs : http://bibliobs.nouvelobs.com/blog/jeux-litteraires
http://pierre-berloquin.blogspot.com/
Développement durable des neurones par le jeu de réflexion
www.crealude.net
Sustainable development of neurones through mind games
www.crealude.net/us
Que fait-on pour les mal-codants ?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden