Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

justmyself

macrumors member
Original poster
Jan 2, 2009
32
0
Wanting to develop for the iPhone I thought it would be good practice to develop it on the Mac first on 10.4 assuming I could cut and past most of the code. I decided to start simple with a high / low game. However I found several things that don't seem to work.


Here is the code that doesn't work.
[instructions setFont:[NSFont fontWithName:mad:"Times" size:14.0]];
[[NSSound soundNamed:mad:"click.wav"] play];
[myButton setTitle:mad:"Play again?"];

Strangely enough this doesn't work
[instructions setStringValue:mad:"Pick of a number between 1 and 10"];

however, this does
instructions.text=@"Pick a number between 1 and 10";

all the good stuff like setIntValue and setStringValue doesn't work. What's going on? Any help would be appreciated.

Thank you
 

justmyself

macrumors member
Original poster
Jan 2, 2009
32
0
With much searching and experimenting the following does work

[instructions setFont:[UIFont fontWithName:mad:"Helvetica" size:18.0]];

Still needing help with sound though. argh... something about Audio Queue Services???

UILabel won't respond to setStringValue. Class reference from the docs.

Apples docs have always been difficult for me. I learn best with small simple examples. I'm working on it though. I did however find that the iPhone has a very limited set of fonts. Guess my only work around is an array of pictures of text. Crazy.
 

ghayenga

macrumors regular
Jun 18, 2008
190
0
Still needing help with sound though. argh... something about Audio Queue Services???

If all you need to do is *play* sound files then I would recommend using the AVAudioPlayer class from the AVFoundation framework. Audio Queue Services is very powerful, but very awkward to use and overkill if you don't need all that power.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.