Well, going strictly off the code you've posted, I don't think you're approaching it in the right direction.
If the player has not leveled high enough, or if they do not have enough money, why are they able to tap the button the first place? I guess it depends on what UI you are going for, but if you're not going to disable the button, then you're going to have to go with alerts or something to explain why something couldn't happen.
But let's imagine a simple table view listing out all of these items for sale. You're going to have an array of objects to populate this table. Not sure what your thinking is at this point, but you really should be making a custom model class for stuff like this. For lack of a better term, I'll call it an InventoryItem.
You don't want to hard-code the price like you have shown here, unless everything you could possibly buy would be the same price. I'd say the same thing for the skill level. So, things like this should be properties of your InventoryItem model. Ex:
InventoryItem
--- NSString name
--- int minimumSkillLevel
--- int (or float, depending) price
How far beyond this you go depends on what you need. You could either create separate models for each type you might have - Weapon, Food, Armor, etc - or you could add another property:
--- int classification
Here you'd have to keep track of some list of constants or something. Weapon = 1, Food = 2, and so on.
Then you'd have a method somewhere to build all of your standard items.
Code:
InventoryItem *item = [[InventoryItem alloc] init];
[item setMinimumSkillLevel:5];
[item setPrice:10];
[item setClassification:kWeaponSword];
[item setName:@"Sword"];
[[self masterInventoryList] addObject:item];
[item release], item = nil;
So you throw all of these into an array, and put those into the table. But can the user buy them?
- (BOOL)isAvailableForSale
Somehow this method would need to be able to access the player's data, so you could either pass in the player object, or get access to it via other means. Compare price to available funds, current skill level against the minimum required, and so on. Now you know whether to enable the button or not.
Your code would then change to something more along these lines.
Code:
InventoryItem *item = [[self masterInventoryList] objectAtIndex:row];
playerMoney = playerMoney - [item price];
[playerInventoryArray addObject:item];
...possibly add this depending on how you want to answer the UI question above:
Code:
if (playerLevel > [item minimumSkillLevel]) ...
Add whatever properties to the model object that you need. File paths to images, etc.
Saving gets a little more complicated with a custom object, but it's not too bad. You can investigate NSCoding, or you can create a method that will convert your custom model into a dictionary, at which point you can save it however you want.
Oh yeah, and you should have a Player model object, too.