2010-11-10 55 views

回答

0

你想要做的是從你的資源包中抓取它,並將其保存到字典中。從那裏你可以訪問你的plist內的每個價值。當您準備好顯示的問題只是用

NSString *path = [[NSBundle mainBundle] bundlePath]; 
NSString *finalPath = [path stringByAppendingPathComponent:@"myList.plist"]; 
NSDictionary *plistData = [[NSDictionary dictionaryWithContentsOfFile:finalPath] retain]; 

然後:可以用的東西來實現這樣的[plistData objectForKey:]方法。你還需要幫助建立標籤嗎?

+0

是的,我發現它很難,會幫助我舉一個例子,謝謝你已經幫了我很多。 – gangmobile 2010-11-11 04:02:23

0

好男人。你想這樣設置:

CCLabel* questionLabel = [CCLabel labelWithString:@"Your Question" 
           fontName:@"Marker Felt" fontSize:64]; 


CGSize size = [[CCDirector sharedDirector] winSize]; 

label.position = ccp(size.width /2 , size.height/2); 

[self addChild: questionLabel]; 

這會在屏幕中間顯示你的標籤。您可以更改位置,字體等。您從plist訪問數據的方式取決於您如何設置它。但使用我以前給你的技巧,你應該沒有問題。

+0

pob21 obrigado pela ajuda,consegui resolver parcialmente o meu problema,eu consegui carregar os dados do plist,agora tenho que montar um plist mais elaborado,com algunsníveis,por examples:categoriafácilcomváriasperguntas e respostas,vê-lo mais tarde 。 – gangmobile 2010-11-11 13:05:58

+0

不客氣,至於不同的困難,最簡單的方法是使用3個不同的plist(簡單,中等,硬)。 – pob21 2010-11-11 19:51:37

相關問題