こんにちは、私はポインターの使い方を理解するのに苦労しています (初めてポインターを使用します) 誰かが私を正しい方向に向けることができることを願っています (しゃれた意図はありません) :P (サウンド、ページ番号、bg、オーディオ int を制御します) 、および表示されるテキスト) (NSString *) @"Page01Text"のテキストを含む plist を指すtextFromPlistポインター @"Page01Text "を受け取り、それをHighLighter クラスで使用し たい
サウンド、ページ番号、bg、オーディオ int、およびテキストなどの出力を hello world レイヤーに記録するTextManagerWithpageNum
ことができるので (その記録)、plist が読み取られていることはわかっていますが、何らかの理由でtextFromPlist をリンクできません。クラスの を使用しtextFromPlist
てTextManagerWithpageNum
、hilighter クラスを使用できるようにしたい(このクラスは、テキストをハイライトし、plist によって提供されるオーディオ インターバルで動作します) 返されるこのコード片 (NULL)
@interface HighLighter.h
TextManagerWithpageNum *myClassAccess;
//declaring the TextManagerWithpageNum class so I can access textFromPlist
@implementation HighLighter.m
-(NSString *)Sentance01
{
NSString *textFromTextManager = myClassAccess.textFromPlist;
NSString *storyText = [NSString stringWithFormat:@"%@",textFromTextManager];
return [[[NSString alloc]initWithString:StoryText]autorelease];
//doesn't crash but doesn't load text
NSLog(@"text form plist @%",storyText);
}
私が間違っているのは何ですか?(リンクしたい int 配列がありますが、NSString
これはもっと簡単だと思ったので、 から始めようと思いました。)どんな助けも素晴らしいでしょう、よろしく、ナタリー。
@interface TextManagerWithpageNum : CCLayer
NSString* textFromPlist_Pntr;
@property(nonatomic, readonly) NSString* textFromPlist;
//NSString* textFromPlist is an item on the plist @"page01" which contains text for the page
@property(nonatomic, readonly) NSString* audioInterval;
//NSString* AudioInterval is an array on the plist @"AudioTimings_PG01"
@implementation TextManagerWithpageNum
@synthesize textFromPlist = textFromPlist_Pntr;
@synthesize audioInterval = _audioInterval;