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

newConvert

macrumors regular
Original poster
Aug 25, 2006
214
3
Hey all,

I have created a function that will add people in a database, and I would like to use this function in my IBACTION method that is connected to a button.

Essentially all I have is:

- (IBAction)someFunction{

<other code>
addPerson:mad:"Person Name";
<other codee>
}

now for some reason it does not add the person into the DB, however when I copy the code out of the "Add Person" method and have it directly in the IBAction, it works... any ideas why?

The DB gets created/loaded when the app fires up, in the same class as the actions/methods.

Thanks so much!
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
addPerson is the name of the message but you need to tell it what object/class to send it to. Along the lines of [receiver message];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.