button gives BAD_EXE

I am new to iPhone SDK. I am using butting in my NIB file.Here is code :

[btnSelectCountry setTitleColor:appData.DataColor 
btnSelectCountry.titleLabel.font= 12;

I put Exception break point in my application.and i tried to crash so i can create good product.and it crashes.Exception break point gives me BAD_EXE on

btnSelectCountry.titleLabel.font= 12;

I don't know why it gives my BAD_EXE. because before BAD_EXE, it was working absolutely fine. never crashed at that point.


You can't set a font equal to a number. Notice that when you start typing btnSelectCountry.titleLabel.font into xcode, it will tell you that it expects a UIFont *.

So, if you want to set the font like that, try something like

btnSelectCountry.titleLabel.font = button.titleLabel.font = [UIFont systemFontOfSize:12];

//use this code

[btnSelectCountry.titleLabel setFont:[UIFont fontWithName:@"Arial-BoldMT" size:15.0]];

//if it is working then check your appData property i.e appData.FontSmall;

Hope this will make you understand what is going wrong.

btnSelectCountry.titleLabel.font= [UIFont fontWithName:@"Helvetica" size:12];

Try this. You gave size to type font.

Need Your Help

Is there a way to add a single file to multiple (local) branches at once?

git version-control dvcs

Suppose I have a file that I had accidentally forgotten to track in git, such as Foo.sh. After developing for a while, I realize that I need this file to be tracked by git.

Which NoSQL Database for Mostly Writing

c mongodb cassandra high-volume nosql

I'm working on a system that will generate and store large amounts of data to disk. A previously developed system at the company used ordinary files to store its data but for several reasons it bec...