IPhone: How to write plist array of dictionary object?

What Jason said is correct, but it looks like there's another, more serious problem in your code: it appears that you're passing a primitive value (the defined constant YES ) as the first argument to setValue:forKey: which expects an argument of type id (in other words, an object, not a primitive) Instead, you can use an instance of NSNumber to wrap the boolean value, and then put it in the array, like so: dictionary setValue:NSNumber numberWithBool:YES forKey:@"Preferito".

What Jason said is correct, but it looks like there's another, more serious problem in your code: it appears that you're passing a primitive value (the defined constant YES) as the first argument to -setValue:forKey:, which expects an argument of type id (in other words, an object, not a primitive). Instead, you can use an instance of NSNumber to wrap the boolean value, and then put it in the array, like so: dictionary setValue:NSNumber numberWithBool:YES forKey:@"Preferito".

You are loading your initial plist from inside your application bundle. Unfortunately, you cannot write to this directory. When you need to do is check if your plist already exists in the user documents directory.

If it does, load it from there. If not, load your template (original) from inside the application bundle. When you write the file back, you must always write it to the user documents directory.

For more information on managing your application's files, please see the Files and Data Management section of the iPhone Application Programming Guide.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions